我有一个 PopupBox,我想为其更改图标。目前它默认为 DotsVertical,我想将它设置为 DotsHorizontal
I have a PopupBox that I want to change the icon for. Currently it defaults to DotsVertical and I would like to have it as a DotsHorizontal
我正在为 WPF 应用程序使用 MaterialDesignInXAML。我有一个 PopupBox,我想为其更改图标。目前它默认为 DotsVertical
,我想将其设置为 DotsHorizontal
。
我尝试了以下但没有成功。
<materialDesign:PopupBox PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
<materialDesign:PopupBox.Content>
<materialDesign:PackIcon Kind="DotsHorizontal" />
</materialDesign:PopupBox.Content>
<StackPanel>
<TextBlock Text="Test1" />
<TextBlock Text="Test2" />
<TextBlock Text="Test3" />
</StackPanel>
</materialDesign:PopupBox>
提前致谢!
弄明白了,我会在这里留下答案,以防其他人遇到这个问题。有个叫ToggleContent
的属性
<materialDesign:PopupBox PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
<materialDesign:PopupBox.ToggleContent>
<materialDesign:PackIcon Kind="DotsHorizontal" />
</materialDesign:PopupBox.ToggleContent>
<StackPanel>
<TextBlock Text="Test1" />
<TextBlock Text="Test2" />
<TextBlock Text="Test3" />
</StackPanel>
</materialDesign:PopupBox>
要更改图标并保留当前样式,请使用:
<materialDesign:PopupBox PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
<materialDesign:PopupBox.ToggleContent>
<materialDesign:PackIcon Kind="DotsHorizontal"
Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=materialDesign:PopupBox}, Path=Foreground}" />
</materialDesign:PopupBox.ToggleContent>
<StackPanel>
<TextBlock Text="Test1" />
<TextBlock Text="Test2" />
<TextBlock Text="Test3" />
</StackPanel>
</materialDesign:PopupBox>
我正在为 WPF 应用程序使用 MaterialDesignInXAML。我有一个 PopupBox,我想为其更改图标。目前它默认为 DotsVertical
,我想将其设置为 DotsHorizontal
。
我尝试了以下但没有成功。
<materialDesign:PopupBox PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
<materialDesign:PopupBox.Content>
<materialDesign:PackIcon Kind="DotsHorizontal" />
</materialDesign:PopupBox.Content>
<StackPanel>
<TextBlock Text="Test1" />
<TextBlock Text="Test2" />
<TextBlock Text="Test3" />
</StackPanel>
</materialDesign:PopupBox>
提前致谢!
弄明白了,我会在这里留下答案,以防其他人遇到这个问题。有个叫ToggleContent
<materialDesign:PopupBox PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
<materialDesign:PopupBox.ToggleContent>
<materialDesign:PackIcon Kind="DotsHorizontal" />
</materialDesign:PopupBox.ToggleContent>
<StackPanel>
<TextBlock Text="Test1" />
<TextBlock Text="Test2" />
<TextBlock Text="Test3" />
</StackPanel>
</materialDesign:PopupBox>
要更改图标并保留当前样式,请使用:
<materialDesign:PopupBox PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
<materialDesign:PopupBox.ToggleContent>
<materialDesign:PackIcon Kind="DotsHorizontal"
Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=materialDesign:PopupBox}, Path=Foreground}" />
</materialDesign:PopupBox.ToggleContent>
<StackPanel>
<TextBlock Text="Test1" />
<TextBlock Text="Test2" />
<TextBlock Text="Test3" />
</StackPanel>
</materialDesign:PopupBox>