我有一个窗口 wpf 应用程序,显示项目列表。我希望将列表显示在右侧,而不是像目前那样显示在左侧。附上我的部分 xaml 文件。我尝试将属性水平对齐附加到文本块和图像,但没有任何改变。
<HierarchicalDataTemplate DataType="{x:Type cl:FolderData}" ItemsSource="{Binding Path=Children,UpdateSourceTrigger=PropertyChanged}">
<Border BorderThickness="1">
<!-- Drop="FolderStackPanel_PreviewDrop" -->
<StackPanel DragEnter="StackPanel_PreviewDragEnter" DragLeave="StackPanel_PreviewDragLeave"
Name="FolderStackPanel" Drop="FolderStackPanel_PreviewDrop" Orientation="Horizontal" ContextMenu="{StaticResource cmExportDelete}"
HorizontalAlignment="Right">
<Image Name="NodeIcon" Width="24" Margin="5" Height="24" Source="pack://application:,,,/ExportToolWpf;component/Images/folder_icon.png"/>
<StackPanel Orientation="Vertical" Margin="0,5,0,0" >
<TextBlock Name="NodeHeader" FontSize="11" Text="{Binding Path=FolderName}" />
<StackPanel Name="IdPanel" Orientation="Horizontal">
<TextBlock FontSize="10" Foreground="Gray" Text="Client ID:" />
<TextBlock FontSize="10" Foreground="Gray" Text="{Binding Path=ClientId}" Margin="0,0,7,0" />
<TextBlock FontSize="10" Foreground="Gray" Text="Project ID:"/>
<TextBlock FontSize="10" Foreground="Gray" Text="{Binding Path=ProjectId}" />
</StackPanel>
</StackPanel>
</StackPanel>
</Border> </HierarchicalDataTemplate>
我感谢您提供的任何帮助。谢谢,哈达斯。