Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CalendarDatePicker - Cannot Dynamically Change PlaceholderText property once initially set. #10022

Open
johnt-star opened this issue Sep 20, 2024 · 0 comments
Labels
area-DateTimePickers DatePicker, TimePicker, CalendarDatePicker, CalendarView team-Controls Issue for the Controls team

Comments

@johnt-star
Copy link

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".
image

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
image

After several button clicks:
image

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

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
    <Button x:Name="myButton" Click="myButton_Click">Change Text</Button>
    <CalendarDatePicker Name="CalendarDatePickerMain" PlaceholderText="PlaceholderText"></CalendarDatePicker>
    <TextBlock Name="TextBlockMain"></TextBlock>
</StackPanel>

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

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Sep 20, 2024
@codendone codendone transferred this issue from microsoft/WindowsAppSDK Sep 26, 2024
@codendone codendone added area-DateTimePickers DatePicker, TimePicker, CalendarDatePicker, CalendarView team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Sep 26, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Sep 27, 2024
@marcelwgn marcelwgn removed the needs-triage Issue needs to be triaged by the area owners label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DateTimePickers DatePicker, TimePicker, CalendarDatePicker, CalendarView team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

3 participants