Skip to content

Commit

Permalink
Separate Into individual pages
Browse files Browse the repository at this point in the history
  • Loading branch information
TrinityDevelopers committed Mar 27, 2020
1 parent a200603 commit 42b9316
Show file tree
Hide file tree
Showing 12 changed files with 315 additions and 24 deletions.
2 changes: 1 addition & 1 deletion ZenovaLauncher/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemeResources RequestedTheme="Dark">
<ui:ThemeResources RequestedTheme="Dark" >
<ui:ThemeResources.ThemeDictionaries>
<ResourceDictionary x:Key="Dark">
<ResourceDictionary.MergedDictionaries>
Expand Down
14 changes: 14 additions & 0 deletions ZenovaLauncher/HelpPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Page x:Class="ZenovaLauncher.HelpPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ZenovaLauncher"
xmlns:ui="http://schemas.modernwpf.com/2019"
mc:Ignorable="d"
Background="Transparent">

<Grid>

</Grid>
</Page>
28 changes: 28 additions & 0 deletions ZenovaLauncher/HelpPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ZenovaLauncher
{
/// <summary>
/// Interaction logic for HelpPage.xaml
/// </summary>
public partial class HelpPage : Page
{
public HelpPage()
{
InitializeComponent();
}
}
}
21 changes: 21 additions & 0 deletions ZenovaLauncher/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Page x:Class="ZenovaLauncher.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ZenovaLauncher"
xmlns:ui="http://schemas.modernwpf.com/2019"
mc:Ignorable="d"
Background="Transparent">

<Grid>
<Button
Content="Launch Minecraft"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Width="200"
Height="50"
Margin="20"
Style="{DynamicResource AccentButtonStyle}" />
</Grid>
</Page>
28 changes: 28 additions & 0 deletions ZenovaLauncher/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ZenovaLauncher
{
/// <summary>
/// Interaction logic for MainPage.xaml
/// </summary>
public partial class MainPage : Page
{
public MainPage()
{
InitializeComponent();
}
}
}
88 changes: 66 additions & 22 deletions ZenovaLauncher/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,59 @@
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
Title="Zenova Launcher"
Height="600" Width="1000"
MinHeight="600" MinWidth="1000"
Height="593" Width="987"
MinHeight="593" MinWidth="987"
WindowStartupLocation="CenterScreen"
ui:WindowHelper.UseModernWindowStyle="True">
<Window.Resources>
<ResourceDictionary>
<Style x:Key="AccountFlyoutPresenter" BasedOn="{StaticResource {x:Type ui:FlyoutPresenter}}" TargetType="{x:Type ui:FlyoutPresenter}">
<Setter Property="CornerRadius" Value="0,0,0,0" />
</Style>
</ResourceDictionary>
</Window.Resources>

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="180" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="80" />
<RowDefinition Height="60" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

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

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

<Grid Grid.Row="0" Grid.Column="0">
<ui:DropDownButton
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Background="Transparent"
CornerRadius="0,0,0,0">
<ui:DropDownButton.Content>
<StackPanel>
<TextBlock Text="Account" />
<TextBlock FontSize="10" Text="fiddleandrew@hotmail.com" />
</StackPanel>
</ui:DropDownButton.Content>
<ui:DropDownButton.Flyout>
<ui:Flyout FlyoutPresenterStyle="{StaticResource AccountFlyoutPresenter}" Placement="Bottom">
<StackPanel>
<TextBlock Text="andrew.miller2@mavs.uta.edu" />
<TextBlock Text="fiddleandrew@hotmail.com" />
<TextBlock Text="micahlusk@gmail.com" />
</StackPanel>
</ui:Flyout>
</ui:DropDownButton.Flyout>
</ui:DropDownButton>
</Grid>


<ui:HamburgerMenuEx
x:Name="NavView"
IsPaneOpen="True"
Expand All @@ -33,27 +69,28 @@
Grid.Column="0" Grid.Row="1" >
<mah:HamburgerMenu.ItemsSource>
<mah:HamburgerMenuItemCollection x:Name="NavViewItems">

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

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

<mah:HamburgerMenuIconItem
Label="Help"
Tag="HelpPage.xaml">
<mah:HamburgerMenuIconItem.Icon>
<ui:SymbolIcon Symbol="Library" />
<ui:SymbolIcon Symbol="Help" />
</mah:HamburgerMenuIconItem.Icon>
</mah:HamburgerMenuIconItem>
</mah:HamburgerMenuItemCollection>
Expand All @@ -70,18 +107,25 @@
</mah:HamburgerMenuIconItem>
</mah:HamburgerMenuItemCollection>
</mah:HamburgerMenu.OptionsItemsSource>

</ui:HamburgerMenuEx>

<Grid Grid.Column="1" Grid.RowSpan="2">
<Button
Content="Launch"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Width="200"
Height="50"
Margin="20"
Style="{DynamicResource AccentButtonStyle}" />
<ui:TransitionFrame x:Name="ContentFrame" Navigated="ContentFrame_Navigated">
<ui:TransitionFrame.DefaultNavigationInTransition>
<ui:NavigationInTransition>
<ui:NavigationInTransition.Forward>
<ui:SuppressTransition />
</ui:NavigationInTransition.Forward>
</ui:NavigationInTransition>
</ui:TransitionFrame.DefaultNavigationInTransition>
<ui:TransitionFrame.DefaultNavigationOutTransition>
<ui:NavigationOutTransition>
<ui:NavigationOutTransition.Backward>
<ui:SuppressTransition />
</ui:NavigationOutTransition.Backward>
</ui:NavigationOutTransition>
</ui:TransitionFrame.DefaultNavigationOutTransition>
</ui:TransitionFrame>
</Grid>
</Grid>
</Window>
46 changes: 45 additions & 1 deletion ZenovaLauncher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,54 @@ public partial class MainWindow : Window
public MainWindow()
{
InitializeComponent();

NavView.SelectedItem = NavViewItems.OfType<HamburgerMenuItem>().First();
Navigate(NavView.SelectedItem);
}

private void NavView_ItemInvoked(object sender, HamburgerMenuItemInvokedEventArgs e)
{

if (e.IsItemOptions)
{
Navigate(NavView.SelectedOptionsItem);
}
else
{
Navigate(NavView.SelectedItem);
}
}

private void ContentFrame_Navigated(object sender, NavigationEventArgs e)
{
NavView.SelectedItem = NavViewItems.OfType<HamburgerMenuItem>().FirstOrDefault(x => GetNavigateUri(x) == e.Uri);
NavView.SelectedOptionsItem = NavViewOptions.OfType<HamburgerMenuItem>().FirstOrDefault(x => GetNavigateUri(x) == e.Uri);

var selectedItem = NavView.SelectedItem ?? NavView.SelectedOptionsItem;
if (selectedItem is HamburgerMenuItem item)
{
NavView.Header = item.Label;
}
}

private void Navigate(object item)
{
if (item is HamburgerMenuItem menuItem)
{
Uri navigateUri = GetNavigateUri(menuItem);
if (ContentFrame.CurrentSource != navigateUri)
{
ContentFrame.Navigate(navigateUri);
}
}
}

private Uri GetNavigateUri(HamburgerMenuItemBase item)
{
if (item.Tag is Uri uri)
{
return uri;
}
return new Uri((string)item.Tag, UriKind.Relative);
}
}

Expand Down
14 changes: 14 additions & 0 deletions ZenovaLauncher/NewsPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Page x:Class="ZenovaLauncher.NewsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ZenovaLauncher"
xmlns:ui="http://schemas.modernwpf.com/2019"
mc:Ignorable="d"
Background="Transparent">

<Grid>

</Grid>
</Page>
28 changes: 28 additions & 0 deletions ZenovaLauncher/NewsPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ZenovaLauncher
{
/// <summary>
/// Interaction logic for NewsPage.xaml
/// </summary>
public partial class NewsPage : Page
{
public NewsPage()
{
InitializeComponent();
}
}
}
14 changes: 14 additions & 0 deletions ZenovaLauncher/SettingsPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Page x:Class="ZenovaLauncher.SettingsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ZenovaLauncher"
xmlns:ui="http://schemas.modernwpf.com/2019"
mc:Ignorable="d"
Background="Transparent">

<Grid>

</Grid>
</Page>
28 changes: 28 additions & 0 deletions ZenovaLauncher/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ZenovaLauncher
{
/// <summary>
/// Interaction logic for SettingsPage.xaml
/// </summary>
public partial class SettingsPage : Page
{
public SettingsPage()
{
InitializeComponent();
}
}
}
Loading

0 comments on commit 42b9316

Please sign in to comment.