【发布时间】:2016-07-15 12:02:12
【问题描述】:
我有树视图,我希望扩展器在其中隐藏/显示树视图。但我希望右侧的扩展器图标和左侧的扩展器标题。像这样
这就是我所做的
<Expander Grid.Row="0" FlowDirection="RightToLeft" >
<Expander.Header >
<StackPanel Orientation="Horizontal" FlowDirection="LeftToRight" >
<TextBlock Foreground="White" FontWeight="Bold">Global Setting</TextBlock>
<Path Data="{StaticResource IconGlobalNetworking}" Fill="#07B9D3" Margin="5"></Path>
<!--<Path Data="{StaticResource IconGlobalNetworking}" Fill="#07B9D3" Margin="5"></Path>-->
</StackPanel>
</Expander.Header>
<TreeView FlowDirection="LeftToRight" BorderThickness="0" Margin="30,0,0,0">
<TreeViewItem>
<TreeViewItem.Header>
<StackPanel Orientation="Horizontal">
<Path Data="{StaticResource IconServerStack}" Fill="#07B9D3" Margin="5"></Path>
<TextBlock Foreground="White" FontWeight="Bold" Margin="5">Managment Server</TextBlock>
</StackPanel>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<StackPanel Orientation="Horizontal">
<Path Data="{StaticResource IconSalientServer}" Fill="#07B9D3" Margin="5"></Path>
<TextBlock Foreground="White" FontWeight="Bold" Margin="5">License Server</TextBlock>
</StackPanel>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<StackPanel Orientation="Horizontal">
<Path Data="{StaticResource IconGlobalNetworking}" Fill="#07B9D3" Margin="5"></Path>
<TextBlock Foreground="White" FontWeight="Bold" Margin="5">Web Server</TextBlock>
</StackPanel>
</TreeViewItem.Header>
</TreeViewItem>
</TreeView>
</Expander>
它给了我这样的输出
我尝试过 exapnder 的“flowdirection=right”,但它会将整个标题和图标移动到右侧。我只想要右侧的 exapnder 图标。我怎样才能实现这一点。请帮助。
【问题讨论】:
-
你试过旋转两者吗?
-
在链接中指出这是重复的:
<Expander FlowDirection="RightToLeft"> <StackPanel FlowDirection="LeftToRight"> -
@Kirenenko:严格来说,这不是“轮换”。
-
我认为如果旋转的中心是元素中间的垂直轴,它就是一个旋转。可能不是最好的想法。
-
我已经完成了那个链接。它不工作