0
我在下面的代碼我.xaml
:HorizontalContentAlignment不會出現
<StackPanel
Orientation="Horizontal"
DockPanel.Dock="Top" Background="Yellow"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="0,2,2,0"
Name="MainButtonsPanel"
Width="100" >
<Button Name="ButtonSaveChanges"
Background="LightGray"
Width="100"
Height="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}"
Command="{Binding MyCommand}"
CommandParameter="{Binding}" Visibility="Visible" />
<Button Name="ButtonEdit"
Background="Gray"
Width="100"
Height="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}"
Command="{Binding MyCommand}"
CommandParameter="{Binding}" />
</StackPanel>
它看起來像這樣運行:
我想要的灰色方塊對齊到對。我嘗試使用VerticalContentAlignment
,但當我編寫它時,它不會出現在我的.xaml
元素中...
有關如何實現這一點的任何想法?
完全是...謝謝!所以新手......:P – Sonhja