Skip to content

Commit

Permalink
Add HamburgerMenu sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
TrinityDevelopers committed Mar 27, 2020
1 parent 2b5421a commit a200603
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 20 deletions.
15 changes: 12 additions & 3 deletions ZenovaLauncher/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ZenovaLauncher"
StartupUri="MainWindow.xaml"
xmlns:ui="http://schemas.modernwpf.com/2019">
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand All @@ -14,12 +15,20 @@
<ui:ColorPaletteResources
TargetTheme="Dark"
Accent="#FF0A954E"
AltHigh="#FF282828" />
AltHigh="#FF282828"
AltMedium="#FF1E1E1E" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ui:ThemeResources.ThemeDictionaries>
</ui:ThemeResources>
<ui:MahAppsColorPaletteResources />
<ResourceDictionary Source="/MahApps.Metro;component/Styles/Sizes.xaml" />
<ResourceDictionary Source="/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="/MahApps.Metro;component/Styles/Controls.GroupBox.xaml" />
<ResourceDictionary Source="/MahApps.Metro;component/Themes/HamburgerMenu.xaml" />

<ui:XamlControlsResources />
<ResourceDictionary Source="/ModernWpf.MahApps;component/Styles/Controls.xaml" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
Expand Down
74 changes: 59 additions & 15 deletions ZenovaLauncher/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,78 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ZenovaLauncher"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
Title="Zenova Launcher"
Height="600" Width="1000"
MinHeight="600" MinWidth="1000"
xmlns:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="80" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<Grid Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" Background="{DynamicResource NavigationViewDefaultPaneBackground}">

</Grid>

<ui:HamburgerMenuEx
x:Name="NavView"
IsPaneOpen="True"
HamburgerVisibility="Collapsed"
ItemInvoked="NavView_ItemInvoked"
Grid.Column="0" Grid.Row="1" >
<mah:HamburgerMenu.ItemsSource>
<mah:HamburgerMenuItemCollection x:Name="NavViewItems">
<mah:HamburgerMenuIconItem
Label="News"
Tag="NewsPage.xaml">
<mah:HamburgerMenuIconItem.Icon>
<ui:SymbolIcon Symbol="Home" />
</mah:HamburgerMenuIconItem.Icon>
</mah:HamburgerMenuIconItem>

<mah:HamburgerMenuIconItem
Label="Minecraft Bedrock"
Tag="MainPage.xaml">
<mah:HamburgerMenuIconItem.Icon>
<ui:SymbolIcon Symbol="Keyboard" />
</mah:HamburgerMenuIconItem.Icon>
</mah:HamburgerMenuIconItem>

<mah:HamburgerMenuIconItem
Label="Help"
Tag="HelpPage.xaml">
<mah:HamburgerMenuIconItem.Icon>
<ui:SymbolIcon Symbol="Library" />
</mah:HamburgerMenuIconItem.Icon>
</mah:HamburgerMenuIconItem>
</mah:HamburgerMenuItemCollection>
</mah:HamburgerMenu.ItemsSource>

<mah:HamburgerMenu.OptionsItemsSource>
<mah:HamburgerMenuItemCollection x:Name="NavViewOptions">
<mah:HamburgerMenuIconItem
Label="Settings"
Tag="SettingsPage.xaml">
<mah:HamburgerMenuIconItem.Icon>
<ui:SymbolIcon Symbol="Setting" />
</mah:HamburgerMenuIconItem.Icon>
</mah:HamburgerMenuIconItem>
</mah:HamburgerMenuItemCollection>
</mah:HamburgerMenu.OptionsItemsSource>

<StackPanel Grid.Column="0">
<ui:DropDownButton Content="DropDownButton">
<ui:DropDownButton.Flyout>
<ui:MenuFlyout Placement="Top">
<MenuItem Header="Send" />
<MenuItem Header="Reply" />
<MenuItem Header="Reply All" />
</ui:MenuFlyout>
</ui:DropDownButton.Flyout>
</ui:DropDownButton>
</StackPanel>
</ui:HamburgerMenuEx>

<Grid Grid.Column="1">
<Grid Grid.Column="1" Grid.RowSpan="2">
<Button
Content="Launch Minecraft"
FontSize="18"
Content="Launch"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Width="200"
Expand Down
11 changes: 9 additions & 2 deletions ZenovaLauncher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using MahApps.Metro.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -20,8 +21,14 @@ namespace ZenovaLauncher
/// </summary>
public partial class MainWindow : Window
{
public MainWindow() {
public MainWindow()
{
InitializeComponent();
}
private void NavView_ItemInvoked(object sender, HamburgerMenuItemInvokedEventArgs e)
{

}
}

}
14 changes: 14 additions & 0 deletions ZenovaLauncher/ZenovaLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,27 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlzEx, Version=4.0.0.0, Culture=neutral, PublicKeyToken=69f1c32f803d307e, processorArchitecture=MSIL">
<HintPath>..\packages\ControlzEx.4.2.0\lib\net462\ControlzEx.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=2.0.0.0, Culture=neutral, PublicKeyToken=51482d6f650b2b3f, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.2.0.0-alpha0660\lib\net47\MahApps.Metro.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.3\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="ModernWpf, Version=0.8.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ModernWpfUI.0.8.1\lib\net45\ModernWpf.dll</HintPath>
</Reference>
<Reference Include="ModernWpf.Controls, Version=0.8.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ModernWpfUI.0.8.1\lib\net45\ModernWpf.Controls.dll</HintPath>
</Reference>
<Reference Include="ModernWpf.MahApps, Version=0.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ModernWpfUI.MahApps.0.8.0\lib\net45\ModernWpf.MahApps.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
Expand Down
4 changes: 4 additions & 0 deletions ZenovaLauncher/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ControlzEx" version="4.2.0" targetFramework="net472" />
<package id="MahApps.Metro" version="2.0.0-alpha0660" targetFramework="net472" />
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.3" targetFramework="net472" />
<package id="ModernWpfUI" version="0.8.1" targetFramework="net472" />
<package id="ModernWpfUI.MahApps" version="0.8.0" targetFramework="net472" />
<package id="System.Runtime.WindowsRuntime" version="4.7.0" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
</packages>

0 comments on commit a200603

Please sign in to comment.