我尝试创建一些正确的 XAML以将文本排列在ComboBox
右侧,但我不能。
这是我的 XAMl ......任何线索我错过了什么?谢谢!
<ComboBox Height="25"
HorizontalAlignment="Left"
ItemsSource="{Binding NonArchivedSequences}"
SelectedItem="{Binding SelectedSequence}"
Margin="0,0,0,4"
Name="cbSequences"
VerticalAlignment="Top"
Width="504"
HorizontalContentAlignment="Stretch"
SelectionChanged="cbSequences_SelectionChanged"
Grid.Column="1">
<ComboBox.Resources>
<DataTemplate x:Key="DataTemplateSequenceData">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Margin="4,2,2,4"
TextWrapping="Wrap"
Text="{Binding Interval}"
d:LayoutOverrides="Width, Height"
VerticalAlignment="Center"
HorizontalAlignment="Left" />
<TextBlock Margin="4,2,2,4"
TextWrapping="Wrap"
Text="{Binding Name}"
d:LayoutOverrides="Width, Height" Grid.Column="1"
VerticalAlignment="Center"
HorizontalAlignment="Left" />
</Grid>
</DataTemplate>
</ComboBox.Resources>
<ComboBox.ItemTemplate>
<StaticResource ResourceKey="DataTemplateSequenceData"/>
</ComboBox.ItemTemplate>
</ComboBox>