私はContainer.xamlでフォローコードを持っている:XAMLのユーザーコントロールにネストされた型を使用する方法は?
<UserControl x:Class="WpfLibraries.Container"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Border x:Name="Group" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="20" Background="White">
<StackPanel Orientation="Vertical" Margin="5,0,5,5">
<Border BorderBrush="Black" CornerRadius="10" HorizontalAlignment="Center" VerticalAlignment="Top" Width="auto" Height="auto" Background="{Binding Background, ElementName=Group}" BorderThickness="{Binding BorderThickness, ElementName=Group}" Margin="0,-20,0,0" >
<TextBlock VerticalAlignment="Center" Text="Group" FontSize="20" Margin="5"/>
</Border>
<StackPanel x:Name="ContentPanel" Orientation="Horizontal" Margin="0,10,0,0"/>
</StackPanel>
</Border>
私はこのようなスタックパネル「ContentPanel」にネスト種類を配置したいと思います:論理的に
<local:Container HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<local:Container.ContentPanel>
<!--More controls will be placed here-->
</local:Container.ContentPanel>
</local:Container>
「ローカル」と同じように具体的になりますか? –
@AbinMathew彼または彼女は、彼が現在書いているUserControlを同じUserControlに入れようとしています。 – Jai