c# - Move image over another image in WPF -
After
I want to move the image to another image in WPF.
But when I move Image1, this Image2 is displaying Image2 instead of the bottom
Mainwindow.xaml
& lt; Image X: Name = "imgPattern1" HorizontalAlignment = "left" height = "170" margin = "523,10,0,0" VerticalAlignment = "top" width = "248" PreviewMouseDown = "imgPattern_PreviewMouseDown" PreviewMouseUp = "imgPattern_PreviewMouseUp" PreviewMouseMove = "imgPattern_PreviewMouseMove "& Gt; & Lt; Image.Style & gt; & Lt; Style TargetType = "Image" & gt; & Lt; Style.Triggers & gt; & Lt; Trigger Property = "EzineABl" value = "False" & gt; & Lt; Setter Property = "Opacity" value = "0.5" /> & Lt; / Catalyst & gt; & Lt; /Style.Triggers> & Lt; / Style & gt; & Lt; /Image.Style> & Lt; / Image & gt; & Lt; Image X: Name = "imgPattern2" HorizontalAlignment = "left" height = "170" margin = "523,10,0,0" VerticalAlignment = "top" width = "248" />
I Use pattern 2
thanks in advance
on attached property is called To move the pattern1 to move. Ensure that your second image already has a larger value or simply exchanges images in your XAML layout, then your second image becomes the first one
& lt; Image X: Name = "imgPattern1" HorizontalAlignment = "left" height = "170" margin = "523,10,0,0" VerticalAlignment = "top" width = "248" PreviewMouseDown = "imgPattern_PreviewMouseDown" PreviewMouseUp = "imgPattern_PreviewMouseUp" PreviewMouseMove = "imgPattern_PreviewMouseMove "& Gt; & Lt; Image.Style & gt; & Lt; Style TargetType = "Image" & gt; & Lt; Style.Triggers & gt; & Lt; Trigger Property = "EzineABl" value = "False" & gt; & Lt; Setter Property = "Opacity" value = "0.5" /> & Lt; / Catalyst & gt; & Lt; /Style.Triggers> & Lt; / Style & gt; & Lt; /Image.Style> & Lt; / Image & gt; & Lt; Image X: Name = "imgPattern2" HorizontalAlignment = "left" height = "170" margin = "523,10,0,0" VerticalAlignment = "top" width = "248" Canvas.ZIndex = 2 />
Comments
Post a Comment