c# - WPF ignores d:IsHidden="True" in run mode (OK in design mode) -
why left image hidden in design mode , not hidden in runtime? looks wpf ignores attribute "ishidden". new empty solution, no single line of code - blend.
here code
<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>
at top of xaml, you'll see following:
mc:ignorable="d"
this says "ignore prefixed d: @ runtime."
you can either remove line (not recommended), or use visibility
property instead. not ignored.
Comments
Post a Comment