1
如何设置UserControl的ZIndex? 我试图Silverlight设置UserControl的ZIndex
Canvas.SetZIndex((Tile)sender, 99);
((Tile)sender).SetValue(Canvas.ZIndexProperty, 99);
瓷砖是我有一个矩形,它是实际出现在屏幕上的用户控件内我的用户 的名称。 我也曾尝试
编辑:
这里是为我的用户
<UserControl x:Class="Carcassonne.Tile"
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"
d:DesignHeight="76" d:DesignWidth="76">
<Canvas x:Name="LayoutRoot" Background="Transparent">
<Rectangle x:Name="rect"
Width="76" Height="76"
HorizontalAlignment="Left">
<Rectangle.Fill>
<ImageBrush x:Name="tileImage">
<ImageBrush.RelativeTransform>
<RotateTransform x:Name="rotation" CenterX="0.5" CenterY="0.5" Angle="0" />
</ImageBrush.RelativeTransform>
</ImageBrush>
</Rectangle.Fill>
</Rectangle>
</Canvas>
</UserControl>
您是否位于Canvas面板内的用户控件?相对于你想要设置zIndex的是什么?换句话说,你能提供你的标记的XAML代码吗? – 2011-02-02 20:13:48
@Pavlo Glazkov是用户控件位于“画布”面板中。我有很多用户控件,我需要将它们的Z-Index设置为相对于主画布或相互之间的关系。请在我的开场白中看到我的编辑。 – Arizona1911 2011-02-02 20:59:54