microsoft / microsoft/microsoft-ui-xaml
CalendarDatePicker - Cannot Dynamically Change PlaceholderText property once initially set.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
After initially setting the PlaceholderText property, setting the property to another value
### Steps to reproduce the bug
1. Set the PlaceholderText property of a CalendarDatePicker to an initial value.
2. Dynamically change the PlaceholderText property.
Issue - the PlaceholderText is still the initial value instead of the new value.
### Expected behavior
You should be able to dynamically change the PlaceholderText value.
### Screenshots
Initial Property Value
The initial PlaceholderText property value is "PlaceholderText".

As you click the "Change Text" button, a counter is appended to the property.
A TextBlock shows the new property, but the PlaceholderText property remains the same

After several button clicks:

### NuGet package version
Windows App SDK 1.6.0: 1.6.240829007
### Packaging type
Packaged (MSIX)
### Windows version
Windows 10 version 22H2 (19045, 2022 Update)
### IDE
Visual Studio 2022
### Additional context
MainWindow.xaml code
Change Text
MainWindow.xaml.cs code
public sealed partial class MainWindow : Window
{
public int ICount;
public MainWindow()
{
this.InitializeComponent();
ICount = 0;
}
private void myButton_Click(object sender, RoutedEventArgs e)
{
string sPlaceHolder = "PlaceHolderText-" + ICount++.ToString();
CalendarDatePickerMain.PlaceholderText = sPlaceHolder;
TextBlockMain.Text = sPlaceHolder;
}
}
Attaching sample project
[CalendarDatePickerPlaceHolder.zip](https://github.com/user-attachments/files/17079967/CalendarDatePickerPlaceHolder.zip)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the attached sample project and reviewing MainWindow.xaml and MainWindow.xaml.cs, where CalendarDatePicker.PlaceholderText is set and changed on button clicks. Trace the CalendarDatePicker placeholder behavior and verify that the displayed placeholder updates after each assignment, matching the TextBlock value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100