This repository has been archived by the owner on Nov 18, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-added Controls and Sample app components
- Loading branch information
1 parent
10609b5
commit 35614a7
Showing
180 changed files
with
12,969 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,3 +250,4 @@ paket-files/ | |
# JetBrains Rider | ||
.idea/ | ||
*.sln.iml | ||
*.appx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Application | ||
x:Class="WinUX.UWP.Samples.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:samples="using:WinUX.UWP.Samples" | ||
RequestedTheme="Light"> | ||
|
||
<Application.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="ms-appx:///WinUX.UWP.Xaml/Themes/Generic.xaml" /> | ||
<ResourceDictionary Source="AppResources.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
|
||
<samples:Locator x:Key="Locator" /> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
namespace WinUX.UWP.Samples | ||
{ | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
using Windows.ApplicationModel; | ||
using Windows.ApplicationModel.Activation; | ||
using Windows.Foundation.Metadata; | ||
using Windows.UI; | ||
using Windows.UI.ViewManagement; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
using GalaSoft.MvvmLight.Ioc; | ||
|
||
using WinUX.ApplicationModel.Lifecycle; | ||
using WinUX.Design.Material; | ||
using WinUX.Diagnostics; | ||
using WinUX.Diagnostics.Tracing; | ||
using WinUX.Mvvm.Services; | ||
using WinUX.UWP.Samples.ViewModels; | ||
using WinUX.Xaml; | ||
|
||
public sealed partial class App : Application | ||
{ | ||
public App() | ||
{ | ||
this.InitializeComponent(); | ||
this.Suspending += OnSuspending; | ||
this.Resuming += OnResuming; | ||
} | ||
|
||
protected override async void OnLaunched(LaunchActivatedEventArgs e) | ||
{ | ||
UpdateTitleBar(); | ||
|
||
Frame rootFrame = Window.Current.Content as Frame; | ||
if (rootFrame == null) | ||
{ | ||
rootFrame = new Frame(); | ||
rootFrame.NavigationFailed += OnNavigationFailed; | ||
Window.Current.Content = rootFrame; | ||
|
||
await AppDiagnostics.Current.StartAsync(); | ||
} | ||
|
||
UIDispatcher.Initialize(); | ||
|
||
if (e.PrelaunchActivated) return; | ||
|
||
if (rootFrame.Content == null) | ||
{ | ||
await InitializeAppShellAsync(e.Arguments); | ||
rootFrame.Navigate(typeof(AppShell)); | ||
} | ||
|
||
Window.Current.Activate(); | ||
} | ||
|
||
private static async Task InitializeAppShellAsync(object navigationParameter) | ||
{ | ||
try | ||
{ | ||
var shellVm = SimpleIoc.Default.GetInstance<AppShellViewModel>(); | ||
if (shellVm != null) | ||
{ | ||
await shellVm.InitializeAsync(); | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
EventLogger.Current.WriteError(ex.Message); | ||
} | ||
|
||
NavigationService.Current.Navigate(typeof(MainPage), navigationParameter); | ||
} | ||
|
||
private static void UpdateTitleBar() | ||
{ | ||
if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.ApplicationView")) | ||
{ | ||
var titleBar = ApplicationView.GetForCurrentView().TitleBar; | ||
if (titleBar != null) | ||
{ | ||
titleBar.ForegroundColor = Colors.White; | ||
titleBar.BackgroundColor = MaterialDesignColors.Blue.Color700; | ||
|
||
titleBar.ButtonInactiveForegroundColor = Colors.Black; | ||
titleBar.ButtonInactiveBackgroundColor = MaterialDesignColors.Blue.Color50; | ||
|
||
titleBar.InactiveForegroundColor = Colors.Black; | ||
titleBar.InactiveBackgroundColor = MaterialDesignColors.Blue.Color100; | ||
|
||
titleBar.ButtonHoverForegroundColor = Colors.Black; | ||
titleBar.ButtonHoverBackgroundColor = MaterialDesignColors.Blue.Color400; | ||
|
||
titleBar.ButtonForegroundColor = Colors.White; | ||
titleBar.ButtonBackgroundColor = MaterialDesignColors.Blue.Color800; | ||
|
||
titleBar.ButtonPressedForegroundColor = Colors.White; | ||
titleBar.ButtonPressedBackgroundColor = MaterialDesignColors.Blue.Color900; | ||
} | ||
} | ||
|
||
if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) | ||
{ | ||
var statusBar = StatusBar.GetForCurrentView(); | ||
if (statusBar != null) | ||
{ | ||
statusBar.BackgroundOpacity = 1; | ||
statusBar.BackgroundColor = MaterialDesignColors.Blue.Color700; | ||
statusBar.ForegroundColor = Colors.White; | ||
} | ||
} | ||
} | ||
|
||
private static void OnNavigationFailed(object sender, NavigationFailedEventArgs e) | ||
{ | ||
throw new Exception("Failed to load Page " + e.SourcePageType.FullName); | ||
} | ||
|
||
private static void OnSuspending(object sender, SuspendingEventArgs e) | ||
{ | ||
AppLifecycleManager.Current.SuspendAsync(e); | ||
} | ||
|
||
private static void OnResuming(object sender, object e) | ||
{ | ||
AppLifecycleManager.Current.ResumeAsync(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<ResourceDictionary | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
|
||
<Style x:Key="StandardListViewStyle" TargetType="ListViewBase"> | ||
<Setter Property="Padding" Value="0,0,0,0"/> | ||
<Setter Property="MinHeight" Value="0" /> | ||
<Setter Property="MinWidth" Value="0" /> | ||
<Setter Property="IsTabStop" Value="False"/> | ||
<Setter Property="TabNavigation" Value="Once"/> | ||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> | ||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> | ||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled"/> | ||
<Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="False"/> | ||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled"/> | ||
<Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="False"/> | ||
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled"/> | ||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/> | ||
<Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True"/> | ||
<Setter Property="IsSwipeEnabled" Value="True"/> | ||
<Setter Property="Width" Value="Auto" /> | ||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> | ||
<Setter Property="ItemContainerTransitions"> | ||
<Setter.Value> | ||
<TransitionCollection> | ||
<AddDeleteThemeTransition/> | ||
<ContentThemeTransition/> | ||
<ReorderThemeTransition/> | ||
<EntranceThemeTransition IsStaggeringEnabled="False"/> | ||
</TransitionCollection> | ||
</Setter.Value> | ||
</Setter> | ||
|
||
<Setter Property="ItemsPanel"> | ||
<Setter.Value> | ||
<ItemsPanelTemplate> | ||
<ItemsStackPanel Orientation="Vertical" Width="Auto" HorizontalAlignment="Stretch"/> | ||
</ItemsPanelTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="ListViewBase"> | ||
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"> | ||
<ScrollViewer x:Name="ScrollViewer" AutomationProperties.AccessibilityView="Raw" BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}" IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" TabNavigation="{TemplateBinding TabNavigation}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"> | ||
<ItemsPresenter FooterTransitions="{TemplateBinding FooterTransitions}" FooterTemplate="{TemplateBinding FooterTemplate}" Footer="{TemplateBinding Footer}" HeaderTemplate="{TemplateBinding HeaderTemplate}" Header="{TemplateBinding Header}" HeaderTransitions="{TemplateBinding HeaderTransitions}" Padding="{TemplateBinding Padding}"/> | ||
</ScrollViewer> | ||
</Border> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
<Style x:Key="ItemContainerStyle" TargetType="SelectorItem"> | ||
<Setter Property="Height" Value="150" /> | ||
<Setter Property="Margin" Value="0,10,0,5" /> | ||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> | ||
<Setter Property="VerticalContentAlignment" Value="Stretch" /> | ||
<Setter Property="HorizontalAlignment" Value="Stretch"/> | ||
<Setter Property="Width" Value="Auto" /> | ||
</Style> | ||
|
||
<Style x:Key="SampleBorderStyle" TargetType="Border"> | ||
<Setter Property="BorderThickness" Value="0,0,0,1" /> | ||
<Setter Property="BorderBrush" Value="{StaticResource SystemControlForegroundAccentBrush}" /> | ||
<Setter Property="Padding" Value="10" /> | ||
</Style> | ||
|
||
<Style x:Key="SampleButtonStyle" TargetType="Button"> | ||
<Setter Property="Height" Value="50" /> | ||
<Setter Property="HorizontalAlignment" Value="Stretch" /> | ||
</Style> | ||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<views:PageBase | ||
x:Class="WinUX.UWP.Samples.AppShell" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:controls="using:WinUX.Xaml.Controls" | ||
xmlns:views="using:WinUX.MvvmLight.Xaml.Views" | ||
mc:Ignorable="d" | ||
DataContext="{Binding AppShellViewModel, Source={StaticResource Locator}}"> | ||
|
||
<Grid> | ||
<controls:AppMenu x:Name="AppMenu" | ||
PaneButtonBackground="{StaticResource BlueBrush700}" | ||
PaneButtonForeground="White" | ||
PaneBackground="{StaticResource BlueBrush500}" | ||
AppMenuButtonBackground="Transparent" | ||
AppMenuButtonForeground="White" | ||
AppMenuButtonCheckedBackground="{StaticResource BlueBrush800}" | ||
AppMenuButtonCheckedForeground="White" | ||
AppMenuButtonHoverBackground="{StaticResource BlueBrush400}" | ||
AppMenuButtonPressedBackground="{StaticResource BlueBrush800}" | ||
SecondarySeparatorColor="{StaticResource BlueBrush200}" | ||
PrimaryButtons="{x:Bind ViewModel.PrimaryAppButtons}" | ||
SecondaryButtons="{x:Bind ViewModel.SecondaryAppButtons}" | ||
FlyoutButtons="{x:Bind ViewModel.FlyoutButtons}" | ||
VisualStateNarrowMinWidth="{x:Bind NarrowAdaptiveWidth}" | ||
VisualStateNormalMinWidth="{x:Bind NormalAdaptiveWidth}" | ||
ContentMargin="0,48,0,0"/> | ||
|
||
<Grid Height="48" Margin="48,0,0,0" VerticalAlignment="Top" Background="{StaticResource BlueBrush500}"> | ||
<TextBlock Margin="10,5" Text="{x:Bind ViewModel.Title, Mode=OneWay}" VerticalAlignment="Center" FontSize="20" FontWeight="Light" Foreground="White" /> | ||
</Grid> | ||
</Grid> | ||
</views:PageBase> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace WinUX.UWP.Samples | ||
{ | ||
using WinUX.Mvvm.Services; | ||
using WinUX.UWP.Samples.ViewModels; | ||
using WinUX.Xaml.Controls; | ||
|
||
/// <summary> | ||
/// An empty page that can be used on its own or navigated to within a Frame. | ||
/// </summary> | ||
public sealed partial class AppShell | ||
{ | ||
public AppShell() | ||
{ | ||
Instance = this; | ||
this.InitializeComponent(); | ||
|
||
this.AppMenu.NavigationService = NavigationService.Current; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the instance of the shell. | ||
/// </summary> | ||
public static AppShell Instance { get; private set; } | ||
|
||
/// <summary> | ||
/// Gets the app menu. | ||
/// </summary> | ||
public static AppMenu Menu => Instance.AppMenu; | ||
|
||
/// <summary> | ||
/// Gets the data context for the app shell. | ||
/// </summary> | ||
public AppShellViewModel ViewModel => this.DataContext as AppShellViewModel; | ||
} | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+327 Bytes
WinUX.UWP.Samples/Assets/Square44x44Logo.targetsize-16_altform-unplated.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+520 Bytes
WinUX.UWP.Samples/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+4.45 KB
WinUX.UWP.Samples/Assets/Square44x44Logo.targetsize-256_altform-unplated.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+585 Bytes
WinUX.UWP.Samples/Assets/Square44x44Logo.targetsize-32_altform-unplated.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+785 Bytes
WinUX.UWP.Samples/Assets/Square44x44Logo.targetsize-48_altform-unplated.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace WinUX.UWP.Samples.Components | ||
{ | ||
public sealed class IntegerSampleProperty : SampleProperty | ||
{ | ||
/// <summary> | ||
/// Gets or sets the minimum integer value. | ||
/// </summary> | ||
public double MinValue { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the maximum integer value. | ||
/// </summary> | ||
public double MaxValue { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<UserControl | ||
x:Class="WinUX.UWP.Samples.Components.PropertyPane" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
DataContextChanged="OnDataContextChanged"> | ||
|
||
<ScrollViewer RequestedTheme="Light"> | ||
<StackPanel x:Name="RootPanel" Padding="15,20,15,20" Background="{StaticResource BlueBrush50}" /> | ||
</ScrollViewer> | ||
</UserControl> |
Oops, something went wrong.