-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Completed 🔥bug 🐛An unexpected issue that highlights incorrect behaviorAn unexpected issue that highlights incorrect behaviorcontrols 🎛️
Milestone
Description
Describe the bug
Possible to get a NRE using SwitchPresenter.
Steps to Reproduce
<StackPanel>
<TextBox x:Name="MyTextBox" />
<controls:SwitchPresenter Value="{x:Bind MyTextBox.Text, Mode=OneWay}">
<controls:Case Value="Magic">
<TextBlock>Everything you do...</TextBlock>
</controls:Case>
</controls:SwitchPresenter>
</StackPanel>Enter the text 'Magic' in the text box and the case shows as expected; however removing any text after then causes a NRE.
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Windows
StackTrace:
at Windows.UI.Xaml.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Microsoft.Toolkit.Uwp.UI.Controls.SwitchPresenter.set_Value(Object value)
at ControlPackagesTest.MainPage.XamlBindingSetters.Set_Microsoft_Toolkit_Uwp_UI_Controls_SwitchPresenter_Value(SwitchPresenter obj, Object value, String targetNullValue) in ControlPackagesTest\ControlPackagesTest\obj\x86\Debug\MainPage.g.cs:line 28
Expected behavior
No NRE
Metadata
Metadata
Assignees
Labels
Completed 🔥bug 🐛An unexpected issue that highlights incorrect behaviorAn unexpected issue that highlights incorrect behaviorcontrols 🎛️