Mahapps.metro: SplitButton contents disappearing on subsequent clicks

Created on 29 May 2019  路  2Comments  路  Source: MahApps/MahApps.Metro

Using an enumerable in an ItemsSource results in the contents of the button disappearing on each subsequent click.

Reproduce-able Code:

<mah:SplitButton x:Name="SplitButtonUpDown" Grid.Column="2" Margin="0,3,0,0" SelectedIndex="0" Background="{DynamicResource AccentColorBrush4}">
    <mah:SplitButton.ItemsSource>
        <x:Array Type="Grid">
            <Grid ToolTip="Downloads configuration from the server. Will overwrite all changes, except for private entries.">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                    <Grid Margin="0,5,0,0">
                        <iconPacks:Modern Kind="CloudDownload" Width="20" />
                    </Grid>
                    <Label Content="Download"/>
                </StackPanel>
            </Grid>
            <Grid ToolTip="Sends your configuration (without private entries) to the server for re-distribution.">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                    <Grid Margin="0,5,0,0">
                        <iconPacks:Modern Kind="CloudUpload" Width="20"/>
                    </Grid>
                    <Label Content="Upload"/>
                </StackPanel>
            </Grid>
        </x:Array>
    </mah:SplitButton.ItemsSource>
</mah:SplitButton>

I believe the items should not disappear upon subsequent clicks.

Screenshots:
First click--
1

Second click--
2

Third click--
3

Environment:

  • MahApps.Metro version [2.0.0-alpha0316]
  • OS: [Win 10 1809]
  • Visual Studio [2019 16.1.0 P2]
  • .NET Framework [4.5.2]

Repo example at: https://github.com/xagon0/316b4bf3-33e0-4746-80cc-3652d19dd241

Bug

All 2 comments

@xagon0 this has now been fixed, and it will be released in the next version of MahApps.Metro v2.0

@punker76 Fantastic! Thanks so much!

Was this page helpful?
0 / 5 - 0 ratings