E_UNEXPECTED UWP Catastrophic Failure

10

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.

crash
visual-studio-2015
uwp
blend
asked on Stack Overflow Dec 15, 2015 by phm • edited Jun 27, 2016 by Hans Kesting

1 Answer

2

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>
answered on Stack Overflow Jun 29, 2016 by Frix33 • edited May 23, 2017 by Community

User contributions licensed under CC BY-SA 3.0