Skip to content

Commit

Permalink
Added a configure wifi page and linked to it from settings of the app…
Browse files Browse the repository at this point in the history
… shell

Issue #14
  • Loading branch information
lprichar committed Apr 17, 2017
1 parent cb42117 commit 9f68718
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 9 deletions.
3 changes: 2 additions & 1 deletion SirenOfShame.Uwp.Ui/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@
Content=""
AutomationProperties.Name="Settings"
ToolTipService.ToolTip="Settings"
Visibility="Collapsed"/>
Click="SettingsOnClick"
/>
</Grid>
</SplitView.Pane>

Expand Down
30 changes: 22 additions & 8 deletions SirenOfShame.Uwp.Ui/AppShell.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using Windows.ApplicationModel.Core;
using Windows.UI.Core;
Expand Down Expand Up @@ -130,11 +131,14 @@ private void TogglePaneButton_Checked(object sender, RoutedEventArgs e)
{
//NavPaneDivider.Visibility = Visibility.Visible;
CheckTogglePaneButtonSizeChanged();
SettingsNavPaneButton.IsTabStop = true;
}

private void RootSplitView_PaneClosed(SplitView sender, object args)
{
NavPaneDivider.Visibility = Visibility.Collapsed;

SettingsNavPaneButton.IsTabStop = false;
}

/// <summary>
Expand Down Expand Up @@ -168,17 +172,22 @@ private void NavMenuList_ItemInvoked(object sender, ListViewItem listViewItem)
if (item.DestPage != null &&
item.DestPage != AppFrame.CurrentSourcePageType)
{
AppFrame.Navigate(item.DestPage, item.Arguments);
if (item.DestPage == typeof(MainUiPage))
{
AppFrame.BackStack.Clear();
}
ShowBackButton();
RootSplitView.IsPaneOpen = false;
NavigateTo(item.DestPage, item.Arguments);
}
}
}

private void NavigateTo(Type sourcePageType, object arguments)
{
AppFrame.Navigate(sourcePageType, arguments);
if (sourcePageType == typeof(MainUiPage))
{
AppFrame.BackStack.Clear();
}
ShowBackButton();
RootSplitView.IsPaneOpen = false;
}

private void OnNavigatingToPage(object sender, NavigatingCancelEventArgs e)
{
if (e.NavigationMode == NavigationMode.Back)
Expand Down Expand Up @@ -227,5 +236,10 @@ private void CheckTogglePaneButtonSizeChanged()
{
// meh, for tablet support maybe someday
}

private void SettingsOnClick(object sender, RoutedEventArgs e)
{
NavigateTo(typeof(ConfigureWifi), null);
}
}
}
3 changes: 3 additions & 0 deletions SirenOfShame.Uwp.Ui/Controls/MyWrapPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace SirenOfShame.Uwp.Ui.Controls
{
/// <summary>
/// From https://codepaste.net/8gr5go
/// </summary>
public class MyWrapPanel : Panel
{

Expand Down
7 changes: 7 additions & 0 deletions SirenOfShame.Uwp.Ui/SirenOfShame.Uwp.Ui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
<Compile Include="Views\ConfigureServer.xaml.cs">
<DependentUpon>ConfigureServer.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ConfigureWifi.xaml.cs">
<DependentUpon>ConfigureWifi.xaml</DependentUpon>
</Compile>
<Compile Include="Views\MainUiPage.xaml.cs">
<DependentUpon>MainUiPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -245,6 +248,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ConfigureWifi.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\MainUiPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down
13 changes: 13 additions & 0 deletions SirenOfShame.Uwp.Ui/Views/ConfigureWifi.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Page
x:Class="SirenOfShame.Uwp.Ui.Views.ConfigureWifi"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SirenOfShame.Uwp.Ui.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock Style="{StaticResource TitleTextBlockStyle}">Configure Wifi</TextBlock>
</Grid>
</Page>
30 changes: 30 additions & 0 deletions SirenOfShame.Uwp.Ui/Views/ConfigureWifi.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace SirenOfShame.Uwp.Ui.Views
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class ConfigureWifi : Page
{
public ConfigureWifi()
{
this.InitializeComponent();
}
}
}

0 comments on commit 9f68718

Please sign in to comment.