【发布时间】:2015-06-01 08:36:03
【问题描述】:
为什么左侧图像在设计模式中隐藏,而不是在运行时隐藏?看起来 WPF 忽略了属性“IsHidden”。新的空解决方案,没有一行代码 - 只是 Blend。
这是我的代码
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="WpfApplication222.MainWindow"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Image HorizontalAlignment="Left" Height="157.093" Margin="98.316,88.148,0,0" VerticalAlignment="Top" Width="95" Source="pack://siteoforigin:,,,/img0.jpg" RenderTransformOrigin="0.5,0.5" d:IsHidden="True">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-37.445"/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image HorizontalAlignment="Left" Height="122" Margin="350,92,0,0" VerticalAlignment="Top" Width="106" RenderTransformOrigin="0.5,0.5" Source="pack://siteoforigin:,,,/img14.jpg">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="13.144"/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>
</Grid>
【问题讨论】:
-
您是否尝试过重建项目/解决方案?
-
d:IsHidden在设计模式下隐藏元素,而不是在运行时。使用Visibility="Hidden"隐藏两者。 -
@General-Doomer,谢谢!
标签: c# wpf hidden expression-blend