-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(timepicker): Fix timepicker flyout NRE when unloading
- Loading branch information
1 parent
c820ccb
commit 106ab50
Showing
5 changed files
with
106 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...ITests.Shared/Windows_UI_Xaml_Controls/TimePicker/TimePicker_Flyout_Automated_Reload.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<UserControl x:Class="UITests.Shared.Windows_UI_Xaml_Controls.TimePicker.TimePicker_Flyout_Automated_Reload" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Shared.Windows_UI_Xaml_Controls.TimePicker" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<Grid x:Name="root"> | ||
<TimePicker x:Name="TestTimePicker" /> | ||
</Grid> | ||
</UserControl> |
44 changes: 44 additions & 0 deletions
44
...sts.Shared/Windows_UI_Xaml_Controls/TimePicker/TimePicker_Flyout_Automated_Reload.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
namespace UITests.Shared.Windows_UI_Xaml_Controls.TimePicker | ||
{ | ||
|
||
[SampleControlInfo("Time Picker")] | ||
public sealed partial class TimePicker_Flyout_Automated_Reload : UserControl | ||
{ | ||
public TimePicker_Flyout_Automated_Reload() | ||
{ | ||
this.InitializeComponent(); | ||
|
||
_ = Dispatcher.RunAsync( | ||
Windows.UI.Core.CoreDispatcherPriority.Normal, | ||
() => { | ||
root.Children.Remove(TestTimePicker); | ||
_ = Dispatcher.RunAsync( | ||
Windows.UI.Core.CoreDispatcherPriority.Normal, | ||
() => | ||
{ | ||
root.Children.Add(TestTimePicker); | ||
this.TestTimePicker.Time = new TimeSpan(3, 12, 0); | ||
}); | ||
} | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters