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

Setting HamburgerMenu.SelectedIndex or Item cause the lost of its content #3089

Closed
OrihuelaConde opened this Issue Oct 20, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@OrihuelaConde

OrihuelaConde commented Oct 20, 2017

It could be my error but I need assistance.

What steps will reproduce this issue?

When I set HamburgerMenu.SelectedIndex it lost its content.

Expected outcome

I want to open the app and select the first item in the menu.

Environment

  • MahApps.Metro 1.5.0
  • Windows 10 1703
  • Visual Studio 2017 14.4
  • .NET Framework 4.6.1

Code

C#

public MainWindow()
{
InitializeComponent();
HamburgerMenu.SelectedIndex = 0;
MainFrame.Navigate(_ventasPage);
}

XAML

    <Controls:HamburgerMenu x:Name="HamburgerMenu" DisplayMode="CompactInline"
                            Foreground="White"
                            IsPaneOpen="False"
                            ItemTemplate="{StaticResource MenuItemTemplate}"
                            OptionsItemTemplate="{StaticResource MenuItemTemplate}"
                            PaneBackground="#FF444444"
                            ItemClick="HamburgerMenu_ItemClick">
        <Controls:HamburgerMenu.ItemsSource>
            <Controls:HamburgerMenuItemCollection>
                <Controls:HamburgerMenuIconItem Icon="{iconPacks:PackIconModern Tag, Width=25, Height=25}" Label="Ventas" Tag="Ventas"/>
                <Controls:HamburgerMenuIconItem Icon="{iconPacks:PackIconModern Settings, Width=25, Height=25}" Label="Administración" Tag="Administracion"/>
                <Controls:HamburgerMenuIconItem Icon="{iconPacks:PackIconModern SocialDropbox, Width=25, Height=25}" Label="Stock" Tag="Stock"/>
            </Controls:HamburgerMenuItemCollection>
        </Controls:HamburgerMenu.ItemsSource>

        <!--  Content  -->
        <Controls:HamburgerMenu.Content>
            <Grid>
                <Frame x:Name="MainFrame" NavigationUIVisibility="Hidden" Navigating="MainFrame_Navigating" LoadCompleted="MainFrame_LoadCompleted"/>
                <Controls:ProgressRing x:Name="Progreso"/>
            </Grid>
        </Controls:HamburgerMenu.Content>
    </Controls:HamburgerMenu>
</Grid>
@dchaib

This comment has been minimized.

dchaib commented Oct 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment