Search code examples
xamlbuttonuwpvisual-studio-2017designer

UWP - hamburgerbutton does not show in running app


My problem is that i added a hamburgerbutton to my xaml code and the visual studio 2017 xamldesigner does show it. But if I run/debug the app there is no hamburgerbutton anymore. The visibility is set on true. How do I get it visible in my app ?

My xaml code:

<Button x:Name="HamburgerButton"  FontFamily="Segoe MDL2 Assets" Content="&#xE700;" 
                    Width="45" Height="41" Background="LightGray" Click="HamburgerButton_Click" Margin="0,10,1225,669" Visibility="Visible" RenderTransformOrigin="1.244,3.281" HorizontalAlignment="Right"/>

Solution

  • I'm not sure if you intended to include this, but that's probably the reason why it's messed up: RenderTransformOrigin="1.244,3.281" and Margin="0,10,1225,669". Try removing them first and check if you can see the button again. Then, I would suggest to change how you implement the positioning.

    Using that kind of value for your Margin is a bad practice. This ruins the responsiveness of your application. I would suggest that you use Grid's RowDefinition and ColumnDefinition to place your control (button, in this case) somewhere.

    Hope it helps!