UserControlのZIndexを設定するにはどうすればよいですか? 私が試してみましたSilverlightの設定ZIndex of UserControl
Canvas.SetZIndex((Tile)sender, 99);
((Tile)sender).SetValue(Canvas.ZIndexProperty, 99);
タイルは、私が実際に画面に表示されるものであるユーザーコントロール内の四角形を持っている私のUserControl の名前です。 は私も
編集しようとしている:ここで
を私のユーザーコントロールのためのXAML
<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>
ユーザーコントロールはキャンバスパネル内にありますか?あなたはzIndexを設定しようとしていますか?言い換えれば、マークアップのXAMLコードを提供できますか? –
@Pavlo Glazkovはい、ユーザーコントロールはキャンバスパネル内にあります。私は多くのユーザーコントロールを持っており、メインのキャンバスまたは互いに対してZ-インデックスを設定する必要があります。私のオープニングポストで私の編集を見てください。 – Arizona1911