有时候由于某些解析错误,VS/Blend设计器无法渲染XAML。但是它能够编译和运行得很好。我可以注释掉有问题的标签/行,然后XAML就能够再次正常渲染了。我知道Ignorable属性,但它会在编译期间忽略某个属性。我希望有另一种方法,让XAML设计器在设计时忽略标签,但允许在运行时编译它。那么,有没有办法告诉XAML设计器这样做呢?我正在使用Visual Studio 2012和Blend 2012。
mc:Ignorable="d"
和一个例子;
<Grid>
<Grid.Resources>
<Style TargetType="RadioButton"><!-- Could Substitute TargetType for a specific control
<Setter Property="d:IsHidden" Value="True"/>
</Style>
</Grid.Resources>
<RadioButton/><!-- This guy should now be hidden in Design Time -->
</Grid>