Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,019 changes: 1,019 additions & 0 deletions WindowsApp22/.vs/config/applicationhost.config

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions WindowsApp22/WindowsApp22.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsApp22", "WindowsApp22\WindowsApp22.csproj", "{6047F97B-B07E-485C-8554-717D3C28512B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6047F97B-B07E-485C-8554-717D3C28512B}.Debug|ARM.ActiveCfg = Debug|ARM
{6047F97B-B07E-485C-8554-717D3C28512B}.Debug|ARM.Build.0 = Debug|ARM
{6047F97B-B07E-485C-8554-717D3C28512B}.Debug|ARM.Deploy.0 = Debug|ARM
{6047F97B-B07E-485C-8554-717D3C28512B}.Debug|x64.ActiveCfg = Debug|x64
{6047F97B-B07E-485C-8554-717D3C28512B}.Debug|x64.Build.0 = Debug|x64
{6047F97B-B07E-485C-8554-717D3C28512B}.Debug|x64.Deploy.0 = Debug|x64
{6047F97B-B07E-485C-8554-717D3C28512B}.Debug|x86.ActiveCfg = Debug|x86
{6047F97B-B07E-485C-8554-717D3C28512B}.Debug|x86.Build.0 = Debug|x86
{6047F97B-B07E-485C-8554-717D3C28512B}.Debug|x86.Deploy.0 = Debug|x86
{6047F97B-B07E-485C-8554-717D3C28512B}.Release|ARM.ActiveCfg = Release|ARM
{6047F97B-B07E-485C-8554-717D3C28512B}.Release|ARM.Build.0 = Release|ARM
{6047F97B-B07E-485C-8554-717D3C28512B}.Release|ARM.Deploy.0 = Release|ARM
{6047F97B-B07E-485C-8554-717D3C28512B}.Release|x64.ActiveCfg = Release|x64
{6047F97B-B07E-485C-8554-717D3C28512B}.Release|x64.Build.0 = Release|x64
{6047F97B-B07E-485C-8554-717D3C28512B}.Release|x64.Deploy.0 = Release|x64
{6047F97B-B07E-485C-8554-717D3C28512B}.Release|x86.ActiveCfg = Release|x86
{6047F97B-B07E-485C-8554-717D3C28512B}.Release|x86.Build.0 = Release|x86
{6047F97B-B07E-485C-8554-717D3C28512B}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
17 changes: 17 additions & 0 deletions WindowsApp22/WindowsApp22/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<common:BootStrapper x:Class="WindowsApp22.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:common="using:Template10.Common">

<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles\Custom.xaml" />
</ResourceDictionary.MergedDictionaries>

<!-- custom resources go here -->

</ResourceDictionary>
</Application.Resources>

</common:BootStrapper>
45 changes: 45 additions & 0 deletions WindowsApp22/WindowsApp22/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using Windows.UI.Xaml;
using System.Threading.Tasks;
using WindowsApp22.Services.SettingsServices;
using Windows.ApplicationModel.Activation;
using Template10.Mvvm;
using Template10.Common;
using System.Linq;
using Windows.UI.Xaml.Data;

namespace WindowsApp22
{
/// Documentation on APIs used in this page:
/// https://github.com/Windows-XAML/Template10/wiki

[Bindable]
sealed partial class App : BootStrapper
{
public App()
{
InitializeComponent();
SplashFactory = (e) => new Views.Splash(e);

#region app settings

// some settings must be set in app.constructor
var settings = SettingsService.Instance;
RequestedTheme = settings.AppTheme;
CacheMaxDuration = settings.CacheMaxDuration;
ShowShellBackButton = settings.UseShellBackButton;
AutoSuspendAllFrames = true;
AutoRestoreAfterTerminated = true;
AutoExtendExecutionSession = true;

#endregion
}

public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
{
// TODO: add your long-running task here
await NavigationService.NavigateAsync(typeof(Views.MainPage));
}
}
}

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WindowsApp22/WindowsApp22/Assets/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions WindowsApp22/WindowsApp22/Help.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Template 10</title>
</head>
<body style="margin: 0; padding: 0;">
<meta http-equiv="refresh" content="2;url=http://aka.ms/T10-Minimal">
</body>
</html>
31 changes: 31 additions & 0 deletions WindowsApp22/WindowsApp22/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity
Name="cdbe1a5b-390e-4037-b6a4-4021bfcf55fc"
Publisher = "CN=Muwanga"
Version = "1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="cdbe1a5b-390e-4037-b6a4-4021bfcf55fc" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>WindowsApp22</DisplayName>
<PublisherDisplayName>Muwanga</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="WindowsApp22.App">
<uap:VisualElements DisplayName="WindowsApp22.App" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Sample" BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>
29 changes: 29 additions & 0 deletions WindowsApp22/WindowsApp22/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WindowsApp22")]
[assembly: AssemblyDescription("http://aka.ms/template10")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WindowsApp22")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("WindowsApp22")]
[assembly: AssemblyCulture("")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
31 changes: 31 additions & 0 deletions WindowsApp22/WindowsApp22/Properties/Default.rd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.

Runtime Directives are documented at http://go.microsoft.com/fwlink/?LinkID=391919

To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>

To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />

Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Seralize="All" />
-->

<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />


<!-- Add your application specific runtime directives here. -->


</Application>
</Directives>
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using Template10.Common;
using Template10.Utils;
using Windows.UI.Xaml;

namespace WindowsApp22.Services.SettingsServices
{
public class SettingsService
{
public static SettingsService Instance { get; } = new SettingsService();
Template10.Services.SettingsService.ISettingsHelper _helper;
private SettingsService()
{
_helper = new Template10.Services.SettingsService.SettingsHelper();
}

public bool UseShellBackButton
{
get { return _helper.Read<bool>(nameof(UseShellBackButton), true); }
set
{
_helper.Write(nameof(UseShellBackButton), value);
BootStrapper.Current.NavigationService.GetDispatcherWrapper().Dispatch(() =>
{
BootStrapper.Current.ShowShellBackButton = value;
BootStrapper.Current.UpdateShellBackButton();
});
}
}

public ApplicationTheme AppTheme
{
get
{
var theme = ApplicationTheme.Light;
var value = _helper.Read<string>(nameof(AppTheme), theme.ToString());
return Enum.TryParse<ApplicationTheme>(value, out theme) ? theme : ApplicationTheme.Dark;
}
set
{
_helper.Write(nameof(AppTheme), value.ToString());
(Window.Current.Content as FrameworkElement).RequestedTheme = value.ToElementTheme();
}
}

public TimeSpan CacheMaxDuration
{
get { return _helper.Read<TimeSpan>(nameof(CacheMaxDuration), TimeSpan.FromDays(2)); }
set
{
_helper.Write(nameof(CacheMaxDuration), value);
BootStrapper.Current.CacheMaxDuration = value;
}
}
}
}

82 changes: 82 additions & 0 deletions WindowsApp22/WindowsApp22/Styles/Custom.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Template10.Controls">

<x:Double x:Key="NarrowMinWidth">0</x:Double>
<x:Double x:Key="NormalMinWidth">521</x:Double>
<x:Double x:Key="WideMinWidth">1200</x:Double>

<Color x:Key="CustomColor">SteelBlue</Color>
<Color x:Key="ContrastColor">White</Color>
<Color x:Key="SystemAccentColor">SteelBlue</Color>

<ResourceDictionary.ThemeDictionaries>

<ResourceDictionary x:Key="Light">

<SolidColorBrush x:Key="CustomColorBrush" Color="{ThemeResource CustomColor}" />
<SolidColorBrush x:Key="ContrastColorBrush" Color="{ThemeResource ContrastColor}" />
<SolidColorBrush x:Key="ExtendedSplashBackground" Color="{ThemeResource CustomColor}" />
<SolidColorBrush x:Key="ExtendedSplashForeground" Color="{ThemeResource ContrastColor}" />

<Style TargetType="controls:PageHeader">
<Setter Property="Background" Value="{ThemeResource CustomColorBrush}" />
<Setter Property="Foreground" Value="{ThemeResource ContrastColorBrush}" />
</Style>

<Style TargetType="controls:Resizer">
<Setter Property="GrabberBrush" Value="{ThemeResource CustomColorBrush}" />
<Setter Property="GrabberVisibility" Value="Visible" />
</Style>

</ResourceDictionary>

<ResourceDictionary x:Key="Default">

<SolidColorBrush x:Key="CustomColorBrush" Color="{ThemeResource CustomColor}" />
<SolidColorBrush x:Key="ContrastColorBrush" Color="{ThemeResource ContrastColor}" />
<SolidColorBrush x:Key="ExtendedSplashBackground" Color="{ThemeResource CustomColor}" />
<SolidColorBrush x:Key="ExtendedSplashForeground" Color="{ThemeResource ContrastColor}" />

<Style TargetType="controls:PageHeader">
<Setter Property="Background" Value="{ThemeResource CustomColorBrush}" />
<Setter Property="Foreground" Value="{ThemeResource ContrastColorBrush}" />
</Style>

<Style TargetType="controls:Resizer">
<Setter Property="GrabberBrush" Value="{ThemeResource CustomColorBrush}" />
<Setter Property="GrabberVisibility" Value="Visible" />
</Style>

</ResourceDictionary>

<ResourceDictionary x:Key="HighContrast">

<SolidColorBrush x:Key="ExtendedSplashBackground" Color="Black" />
<SolidColorBrush x:Key="ExtendedSplashForeground" Color="White" />

<Style TargetType="controls:HamburgerMenu">
<Setter Property="PaneBorderThickness" Value="0" />
<Setter Property="SecondarySeparator" Value="{ThemeResource SystemColorWindowTextColor}" />
<Setter Property="NavButtonBackground" Value="{ThemeResource SystemColorWindowColor}" />
<Setter Property="NavButtonForeground" Value="{ThemeResource SystemColorWindowTextColor}" />
<Setter Property="NavAreaBackground" Value="{ThemeResource SystemColorWindowColor}" />
<Setter Property="HamburgerForeground" Value="{ThemeResource SystemColorWindowColor}" />
<Setter Property="HamburgerBackground" Value="{ThemeResource SystemColorWindowTextColor}" />
<Setter Property="VisualStateNarrowMinWidth" Value="{ThemeResource NarrowMinWidth}" />
<Setter Property="VisualStateNormalMinWidth" Value="{ThemeResource NormalMinWidth}" />
<Setter Property="VisualStateWideMinWidth" Value="{ThemeResource WideMinWidth}" />
</Style>

<Style TargetType="controls:PageHeader">
<Setter Property="Background" Value="{ThemeResource SystemColorWindowColor}" />
<Setter Property="Foreground" Value="{ThemeResource SystemColorWindowTextColor}" />
<Setter Property="VisualStateNarrowMinWidth" Value="{ThemeResource NarrowMinWidth}" />
<Setter Property="VisualStateNormalMinWidth" Value="{ThemeResource NormalMinWidth}" />
</Style>

</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>


Loading