Skip to content

Commit

Permalink
Add new Demo Gallery UX (microsoft#108)
Browse files Browse the repository at this point in the history
* Add new Demo Gallery UX

* Remove old images + minor changes

* minor fixes
  • Loading branch information
Albert Davletov authored Oct 2, 2020
1 parent f9726de commit 0dccd5d
Show file tree
Hide file tree
Showing 77 changed files with 2,101 additions and 183 deletions.
31 changes: 12 additions & 19 deletions Kiosk/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Navigation;

// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409

namespace IntelligentKioskSample
{
using IntelligentKioskSample.Views.DemoLauncher;
using ServiceHelpers;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using Views;
using Windows.ApplicationModel.Core;
using Windows.Data.Xml.Dom;
using Windows.UI.Notifications;
using Windows.UI.Popups;

/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
Expand All @@ -62,6 +62,14 @@ public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
this.UnhandledException += App_UnhandledException;
}

private async void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
{
// handle exceptions so that we dont crash
e.Handled = true;
await new MessageDialog("Error:" + e.Message, "An unhandled error occurred").ShowAsync();
}

/// <summary>
Expand Down Expand Up @@ -120,21 +128,6 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
shell.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

shell.AppFrame.NavigationFailed += OnNavigationFailed;

if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}

// Set the TitleBar to Dark Theme
var appView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
var titleBar = appView.TitleBar;
titleBar.BackgroundColor = Windows.UI.Colors.Black;
titleBar.ForegroundColor = Windows.UI.Colors.White;
titleBar.ButtonBackgroundColor = Windows.UI.Colors.Black;
titleBar.ButtonForegroundColor = Windows.UI.Colors.White;

CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = false;
}

// Place our app shell in the current Window
Expand Down Expand Up @@ -210,7 +203,7 @@ private static void ShowToastNotification(string errorMessage)
ToastTemplateType toastTemplate = ToastTemplateType.ToastText02;
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);
XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
toastTextElements[0].AppendChild(toastXml.CreateTextNode("Intelligent Kiosk"));
toastTextElements[0].AppendChild(toastXml.CreateTextNode("Intelligent Kiosk Sample"));
toastTextElements[1].AppendChild(toastXml.CreateTextNode(errorMessage));

ToastNotification toast = new ToastNotification(toastXml);
Expand Down
28 changes: 27 additions & 1 deletion Kiosk/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@
</Page.Resources>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>

<!-- Top-level navigation menu + app content -->
<NavigationView x:Name="navView"
<NavigationView Grid.Row="1"
x:Name="navView"
MenuItemTemplate="{StaticResource NavMenuItemTemplate}"
PaneDisplayMode="LeftCompact"
IsPaneOpen="False"
Expand All @@ -49,5 +55,25 @@
</Frame>
</NavigationView>

<Grid Grid.Row="1" Background="Black" x:Name="appOverlay" Visibility="Collapsed">
<TextBlock Text="Stand by, we are starting a new experience..." Style="{StaticResource HeaderTextBlockStyle}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>

<!--Title Bar-->
<Grid x:Name="TitleBar" Background="Black" Grid.Row="0" Grid.RowSpan="1" Height="32" VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Grid x:Name="TitleBarHandle" Grid.Column="0" Background="Black">
<TextBlock Margin="12,0" FontSize="12" VerticalAlignment="Center">Intelligent Kiosk Sample</TextBlock>
</Grid>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<Button x:Name="FullScreenButton" Style="{StaticResource TitleBarButtonStyle}" VerticalAlignment="Center" HorizontalAlignment="Right" Click="FullScreen_Click" ToolTipService.ToolTip="Enter full screen mode (Win+Shift+Enter)" >
<FontIcon FontFamily="Segoe MDL2 Assets" FontSize="9" Glyph="&#xE740;"/>
</Button>
</StackPanel>
</Grid>

</Grid>
</Page>
Loading

0 comments on commit 0dccd5d

Please sign in to comment.