我尝试创建一些正确的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>
答案 0 :(得分:1)
也许HorizontalAlignment =“正确”你有左