feat: add warning, resolve a crash issue.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
x:DataType="vm:EnumSelectorDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel>
|
||||
<u:Banner Type="Warning" Header="Native AOT non-compatible" Content="EnumSelector highly relies on reflection, it is not compatible with NativeAOT compilation. " Classes="Warning"></u:Banner>
|
||||
<ToggleSwitch Name="description" Content="Show Description" />
|
||||
<TextBlock Text="Select Type" />
|
||||
<ComboBox
|
||||
|
||||
@@ -92,7 +92,10 @@ public class EnumSelector: TemplatedControl
|
||||
var newValue = args.NewValue.Value;
|
||||
if (newValue is null)
|
||||
{
|
||||
SetCurrentValue(SelectedValueProperty, null);
|
||||
if (Values?.Any() == true)
|
||||
{
|
||||
SetCurrentValue(SelectedValueProperty, null);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user