Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SplitButton contents disappearing on subsequent clicks #3513

Closed
xagon0 opened this issue May 29, 2019 · 2 comments · Fixed by #3675
Closed

SplitButton contents disappearing on subsequent clicks #3513

xagon0 opened this issue May 29, 2019 · 2 comments · Fixed by #3675
Assignees
Labels
Milestone

Comments

@xagon0
Copy link

xagon0 commented May 29, 2019

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

@punker76 punker76 self-assigned this Nov 5, 2019
@punker76 punker76 added the Bug label Nov 5, 2019
@punker76 punker76 added this to the 2.0.0 milestone Nov 5, 2019
punker76 added a commit that referenced this issue Nov 5, 2019
Derive SplitButton from ComboBox to fix disappearing Items. Implementing only the interesting stuff from the ComboBox is not possible because of too many internal things.

- Derive from ComboBox
- `IsExpanded` DP is now `IsDropDownOpen`
- Remove `ListBoxStyle` DP
- The `SplitButton` template uses now an ItemsPresenter like the ComboBox instead a full ListBox
- The `IsEditable` property will be ignored and is always set to false
punker76 added a commit that referenced this issue Nov 5, 2019
@punker76
Copy link
Member

punker76 commented Nov 5, 2019

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

@xagon0
Copy link
Author

xagon0 commented Nov 5, 2019

@punker76 Fantastic! Thanks so much!

amkuchta pushed a commit to amkuchta/MahApps.Metro that referenced this issue Nov 19, 2019
…clicks

Derive SplitButton from ComboBox to fix disappearing Items. Implementing only the interesting stuff from the ComboBox is not possible because of too many internal things.

- Derive from ComboBox
- `IsExpanded` DP is now `IsDropDownOpen`
- Remove `ListBoxStyle` DP
- The `SplitButton` template uses now an ItemsPresenter like the ComboBox instead a full ListBox
- The `IsEditable` property will be ignored and is always set to false
amkuchta pushed a commit to amkuchta/MahApps.Metro that referenced this issue Nov 19, 2019
amkuchta pushed a commit to amkuchta/MahApps.Metro that referenced this issue Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants