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

David Lee picture David Lee · Jun 21, 2017 · Viewed 7.5k times · Source

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!

Answer

David Lee picture David Lee · Jun 21, 2017

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>