microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

unloaded event is triggered for the control when the control is set as content for the ContentDailog

Open saiganesh-sakthivel opened this issue 1 year ago • 7 comments

Describe the bug

The TextBox control is set as content for the contentDailog which is called to show inside the button click. When we call the content dailog through the button click, the unloaded event is called for the TextBox control. It should not called when the text box is display in the view.

Steps to reproduce the bug

  1. Run the Sample. SfCalendarDatePickerBug.zip
  2. TextBox in the mainpage will call loaded event properly without calling the unloaded evet. inside the loaded and unloaded event, we have set the text for the text box for better understandable.
  3. Click the button to display the content dailog with the TextBox as content.
  4. On that time, the unloaded event triggered, so the text in the content is set as unloaded. Expected Behavior
  5. It should not trigger the unloaded event.

Expected behavior

It should trigger the loaded event only.

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.2.5: 1.2.230313.1

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

saiganesh-sakthivel avatar Mar 30 '23 11:03 saiganesh-sakthivel