I am using MaterialDesignInXAML for a WPF application. 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
.
I tried the following with no luck.
<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>
Thanks in advance!
In order to change the Icon and preserve the current style use this:
<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>
Figured it out and will leave an answer here in case anyone else comes across this issue. There is a property called 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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With