I am getting the following:
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
when the ListView attribute is set to Null in the Visual State. It makes no sense, why does VS and Blend complain?
<VisualState.Setters>
<Setter Target="listView.(Selector.IsSynchronizedWithCurrentItem)" Value="{x:Null}"/>
</VisualState.Setters>
EDIT
A similar issue:
<VisualState.Setters>
<Setter Target="NumberButtonBox.(RelativePanel.RightOf)" Value="{x:Null}" />
<Setter Target="NumberButtonBox.(RelativePanel.Below)" Value="GridPlaceholder" />
</VisualState.Setters>
where NumberButtonBox is defined as
<Viewbox x:Name="NumberButtonBox" RelativePanel.RightOf="GridPlaceholder" MaxWidth="250" MaxHeight="450" MinWidth="200">
The error shows only on the setter using a value of {x:Null}
, not on the other line. Changing the order of the Setter lines has no effect.
Is setting the property to Null in this way the correct way to clear this value? At runtime it does work, just the editor has issues with this.
The only alternative to set null without crash at design time is this (as reported in this similar question)
example:
<Style x:Key="MyList" TargetType="ListView">
<Setter Property="Transitions" >
<Setter.Value>
<TransitionCollection></TransitionCollection>
</Setter.Value>
</Setter>
</Style>
instead of:
Style x:Key="MyList"
TargetType="ListView">
<Setter Property="Transitions"
Value="{x:Null}"/>
</Style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With