Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

E_UNEXPECTED UWP Catastrophic Failure

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.

like image 959
phm Avatar asked Dec 15 '15 15:12

phm


1 Answers

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>
like image 189
Frix33 Avatar answered Nov 04 '22 09:11

Frix33