crash - E_UNEXPECTED UWP 灾难性故障

标签 crash visual-studio-2015 uwp blend

我得到以下信息:

Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))



当 ListView 属性在 Visual State 中设置为 Null 时。没道理,VS和Blend为什么会提示?
<VisualState.Setters>
     <Setter Target="listView.(Selector.IsSynchronizedWithCurrentItem)" Value="{x:Null}"/>
</VisualState.Setters>

编辑
一个类似的问题:
 <VisualState.Setters>
   <Setter Target="NumberButtonBox.(RelativePanel.RightOf)" Value="{x:Null}" />
   <Setter Target="NumberButtonBox.(RelativePanel.Below)" Value="GridPlaceholder" />
</VisualState.Setters>

其中 NumberButtonBox 定义为
<Viewbox x:Name="NumberButtonBox" RelativePanel.RightOf="GridPlaceholder" MaxWidth="250" MaxHeight="450" MinWidth="200">

该错误仅在使用值 {x:Null} 的 setter 上显示,不在另一条线上。更改 Setter 行的顺序无效。

以这种方式将属性设置为 Null 是清除此值的正确方法吗?在运行时它确实有效,只是编辑器对此有问题。

最佳答案

在设计时设置 null 而不会崩溃的唯一替代方法是这个(如 this similar question 中所述)

例子:

<Style x:Key="MyList" TargetType="ListView">
    <Setter Property="Transitions" >
        <Setter.Value>
            <TransitionCollection></TransitionCollection>
        </Setter.Value>
    </Setter>
</Style>

代替:
Style x:Key="MyList"
        TargetType="ListView">
    <Setter Property="Transitions" 
            Value="{x:Null}"/>
</Style>

关于crash - E_UNEXPECTED UWP 灾难性故障,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34292889/

相关文章:

android - 远程服务崩溃时 Activity 崩溃

android - 在输入文本上键入时,带有XWalkView的Android App崩溃

c++ - Haskell ghc Visual Studio DLL 奇怪的行为

c# - 如何将存储文件分配给 ByteArray?

winrt-xaml - Windows 通用可调整大小网格

c# - 如何检查用户在 UWP 上是否空闲?

android - Delphi Android RESTRequest: channel 无法恢复,将被丢弃

facebook - 检查设备是否已登录服务时无法重现应用程序崩溃

typescript - 在 Visual Studio 2015 CTP6 + TypeScript 1.4 中使用外部模块

visual-studio - Visual Studio 2015 需要管理员权限