Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
6172b96
Initial Theming Restructure, moved Color Resources out of App.xaml in…
WilliamABradley Jan 21, 2018
5943fa8
-Moved defined Styles in App.xaml to Styles/Generic.xaml.
WilliamABradley Jan 21, 2018
45701ca
-Transitioned remaining Static defined and StaticResource color resou…
WilliamABradley Jan 22, 2018
399793c
Merge branch 'master' into DarkTheme.
WilliamABradley Jan 24, 2018
0055353
-Fixed Dark Theme issues with BladeView, DropShadowPanel, FrameworkEl…
WilliamABradley Jan 24, 2018
e02196d
Finished fixing Control Samples for Dark Theme.
WilliamABradley Jan 24, 2018
e20c346
-Fixed Dark Theme for Samples of Notifications, Animations and Services.
WilliamABradley Jan 24, 2018
d439bb7
-Fixed Dark Theme for remaining samples.
WilliamABradley Jan 24, 2018
53912d8
-Added ThemeInjector, a way to inject AcrylicBrushes into a ResourceD…
WilliamABradley Jan 25, 2018
e90a79f
-Carefully ripped out all Sample Logic from the Shell Page, put into …
WilliamABradley Jan 27, 2018
0470a1f
-Made it half-way through restyling the SampleController.
WilliamABradley Jan 27, 2018
18d6754
Removed ApplicationPageBackgroundThemeBrush from Samples to let the C…
WilliamABradley Jan 27, 2018
4a1623c
-Fixed Documentation Positioning.
WilliamABradley Jan 27, 2018
222583f
-Fixed Window Visual States for Sample Contoller, Narrow View can now…
WilliamABradley Jan 28, 2018
23f44d4
-Rounded Commands Bar.
WilliamABradley Jan 30, 2018
70e567b
Moved Monaco Editor logic out of SampleController into it's own XamlC…
WilliamABradley Feb 2, 2018
29c0f39
Moved About background to Shell Page, merging with the SampleControll…
WilliamABradley Feb 2, 2018
7bead29
Added Acrylic and Background Toggles to Sample Controller, these will…
WilliamABradley Feb 2, 2018
747e51a
Merged changes from UWPCommunityToolkit/Master into DarkTheme.
WilliamABradley Feb 12, 2018
4a432e8
Added ThemeListener to Sample JSON in prepartion for #1650 merging.
WilliamABradley Feb 14, 2018
9e4b14b
Merged UWPCommunityToolkit/Master into DarkTheme.
WilliamABradley Feb 14, 2018
3bf9dad
Merge branch 'master' into DarkTheme
WilliamABradley Mar 19, 2018
e82e3c1
Merge branch 'master' into DarkTheme
WilliamABradley Apr 8, 2018
fe570aa
-Fixed CodeRenderer, Added ThemeListener to react to Theme Changes.
WilliamABradley Apr 8, 2018
dd6ac39
-Fixed CodeRenderer again...
WilliamABradley Apr 8, 2018
9516610
-DocFX Extensions in SampleAppMarkdownRenderer now have a Dark Theme …
WilliamABradley Apr 8, 2018
32524b5
Merge branch 'master' into DarkTheme
WilliamABradley Apr 14, 2018
2e2c857
Tweaked Colors, fixed Header
WilliamABradley Apr 21, 2018
71f28bb
Added some better names for Style Keys, adjust some more colors.
WilliamABradley Apr 21, 2018
71c5efa
Bugfix and old Theme Removal + Shadow tweaks.
WilliamABradley Apr 21, 2018
075cb57
Merge branch 'master' into DarkTheme
WilliamABradley Apr 21, 2018
9dd69a6
Fixed code diffs.
WilliamABradley Apr 21, 2018
f154f15
Styled About Page to Concepts, moved About the App to the landingPage…
WilliamABradley Apr 21, 2018
2db49c7
Fixed SampleController VisualStates, fixed CodeRenderer using the wro…
WilliamABradley Apr 21, 2018
05ae8d6
Fixed Theme Selection on Documentation only pages.
WilliamABradley Apr 21, 2018
3e6d382
Fixed Animation Samples with Commands.
WilliamABradley Apr 21, 2018
e048526
Fixed missing Search Button.
WilliamABradley Apr 21, 2018
5181a4d
Fixed new Sample Pages.
WilliamABradley Apr 21, 2018
ed98ba4
Fixed GiThUb casing.
WilliamABradley Apr 21, 2018
e2fae5a
Adjusted some styling, removed VisualHelpers, as the ColorHelper prov…
WilliamABradley May 2, 2018
9217ae4
Merge branch 'master' into DarkTheme
WilliamABradley May 2, 2018
ced1d66
Added back Deprecation Warning.
WilliamABradley May 2, 2018
6dcc081
Re-arranged SampleController for easier readability.
WilliamABradley May 2, 2018
09662fa
Made Notifications Samples stand out more from Background.
WilliamABradley May 2, 2018
af218af
Fixed ShellCommands not loading for some pages.
WilliamABradley May 2, 2018
5fcad50
Hyperlink doesn't follow ThemeResource :(
WilliamABradley May 2, 2018
9b536cd
Updated to latest ColorCode-Universal Package for Updated Dark Theme.
WilliamABradley May 2, 2018
9a506d3
Merge branch 'master' into DarkTheme
WilliamABradley May 5, 2018
23fc2ae
Updated Monaco Editor, added Theme Handling.
WilliamABradley May 5, 2018
6102e9a
Updated ThemeListener Sample.
WilliamABradley May 5, 2018
2728e41
Made ThemeChanged inline.
WilliamABradley May 6, 2018
079620d
Fixed ScrollViewerExtensions Sample Page.
WilliamABradley May 13, 2018
4cc252c
Fixed other ScrollViewer Extensions Page.
WilliamABradley May 13, 2018
875c7b7
Yet another fix for ScrollViewerExtensions.
WilliamABradley May 13, 2018
2375722
Merge branch 'master' into DarkTheme
WilliamABradley May 17, 2018
6b517d3
Design tweaks for Sample App.
WilliamABradley May 17, 2018
234e6ba
Updated ColorCode.UWP to fix dependency issues, added a few more desi…
WilliamABradley May 17, 2018
55e2b91
Fixed waitRing and ExceptionNotification.
WilliamABradley May 17, 2018
193a56d
Merge branch 'master' into DarkTheme
WilliamABradley May 18, 2018
fa1932e
Merge branch 'master' into DarkTheme
WilliamABradley May 18, 2018
f6a3688
Made Gaze pages theme friendly.
WilliamABradley May 18, 2018
e1f362d
Merge branch 'master' into DarkTheme
WilliamABradley May 19, 2018
e89ba8d
Merge branch 'master' into DarkTheme
WilliamABradley May 22, 2018
db63c54
Merge branch 'master' into DarkTheme
WilliamABradley May 29, 2018
37147ae
Updated old headers.
WilliamABradley May 29, 2018
b0b9d7d
Fixed additional conflicts.
WilliamABradley May 29, 2018
3430b90
Fixed Sample App Compilation.
WilliamABradley May 29, 2018
4861702
Updated new Samples for Dark Theme.
WilliamABradley May 29, 2018
acc4bce
Fixed double up.
WilliamABradley Jun 7, 2018
dc1a489
Merge branch 'master' into DarkTheme
WilliamABradley Jun 7, 2018
f067069
Fixed Sample app compilation.
WilliamABradley Jun 7, 2018
6afd9cc
Fixed ThemeListener documentation and Release compilation.
WilliamABradley Jun 7, 2018
7008265
Fixed PrintHelper sample, added border around DocFX quotes in light t…
WilliamABradley Jun 7, 2018
5d9c893
Added Monaco to landing links, changed Blur and Gaze Tracing samples.
WilliamABradley Jun 7, 2018
2c0fe1b
Merge branch 'master' into DarkTheme
nmetulev Jun 13, 2018
49d594d
Merge branch 'master' into DarkTheme
WilliamABradley Jul 1, 2018
df35446
Moved Expander inline into Pivot Header.
WilliamABradley Jul 1, 2018
9bd679a
Merge branch 'master' into DarkTheme
nmetulev Jul 9, 2018
dc7c907
Merge branch 'master' into DarkTheme
nmetulev Jul 9, 2018
59be005
Merge branch 'master' into DarkTheme
nmetulev Jul 9, 2018
e52219e
Merge branch 'master' into DarkTheme
WilliamABradley Jul 29, 2018
840d88c
Theme Switcher in Sample Page now only affects the Sample Area.
WilliamABradley Jul 31, 2018
6246597
Fixes for DataGrid Sample Page
WilliamABradley Jul 31, 2018
584bc69
Separated Github Logo Data into Separate Resource File.
WilliamABradley Jul 31, 2018
a5a411b
Documented ISampleNavigation, Removed Saturation Behaviour warning.
WilliamABradley Jul 31, 2018
4d8c8d9
Merge branch 'master' into DarkTheme
nmetulev Jul 31, 2018
84f9d05
Theme Picker now only affects the Sample Area, rather than the whole …
WilliamABradley Aug 1, 2018
654f64f
Removed Analytics Sample.
WilliamABradley Aug 1, 2018
41091e1
Fixed Github Icon being visible only once.
WilliamABradley Aug 1, 2018
dd37f22
Removed remaining Analytics file.
WilliamABradley Aug 1, 2018
375a5d0
Merge branch 'master' into DarkTheme
nmetulev Aug 1, 2018
333aa16
Merge branch 'master' into DarkTheme
nmetulev Aug 1, 2018
122b9cb
fix for sample background
nmetulev Aug 1, 2018
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,273 changes: 11 additions & 1,262 deletions Microsoft.Toolkit.Uwp.SampleApp/App.xaml

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion Microsoft.Toolkit.Uwp.SampleApp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.Toolkit.Uwp.Helpers;
using Microsoft.Toolkit.Uwp.SampleApp.Common;
using Microsoft.Toolkit.Uwp.SampleApp.SamplePages;
using Microsoft.Toolkit.Uwp.SampleApp.Styles;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.System.Profile;
Expand Down Expand Up @@ -100,6 +101,8 @@ protected override void OnBackgroundActivated(BackgroundActivatedEventArgs args)

private async System.Threading.Tasks.Task RunAppInitialization(string launchParameters)
{
ThemeInjector.InjectThemeResources(Application.Current.Resources);

// Go fullscreen on Xbox
if (AnalyticsInfo.VersionInfo.GetDeviceFormFactor() == DeviceFormFactor.Xbox)
{
Expand Down Expand Up @@ -167,4 +170,4 @@ private void OnSuspending(object sender, SuspendingEventArgs e)
deferral.Complete();
}
}
}
}
17 changes: 17 additions & 0 deletions Microsoft.Toolkit.Uwp.SampleApp/Common/ISampleNavigation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Toolkit.Uwp.SampleApp
{
/// <summary>
/// Sample LifeCycle Events.
/// </summary>
public interface ISampleNavigation
{
/// <summary>
/// Callback to Clean up Resources while Navigating away.
/// </summary>
void NavigatingAway();
}
}
10 changes: 5 additions & 5 deletions Microsoft.Toolkit.Uwp.SampleApp/Controls/AadAuthControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
mc:Ignorable="d"
Visibility="{x:Bind Path=IsEnabled, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}">
<Grid MaxWidth="800"
Background="{StaticResource Brush-Grey-05}">
Background="{ThemeResource Brush-Grey-05}">
<Grid Margin="24"
Background="{StaticResource Brush-Grey-04}"
BorderBrush="#FFCCCCCC"
Background="{ThemeResource Brush-Grey-04}"
BorderBrush="#33CCCCCC"
BorderThickness="1"
CornerRadius="4">
<Grid.RowDefinitions>
Expand All @@ -27,7 +27,7 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<Grid Background="#FFCCCCCC">
<Grid Background="#33CCCCCC">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
Expand All @@ -36,7 +36,7 @@
Margin="12,6"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Foreground="{StaticResource Brush-Grey-01}"
Foreground="{ThemeResource Brush-Grey-01}"
Text="Azure Active Directory v2.0 Configuration"/>
</Grid>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private void ClientId_TextChanged(object sender, TextChangedEventArgs e)

private void GraphService_SignInFailed(object sender, Toolkit.Services.MicrosoftGraph.SignInFailedEventArgs e)
{
Shell.Current.ShowExceptionNotification(e.Exception);
SampleController.Current.ShowExceptionNotification(e.Exception);
}

private string[] GetAdminPermissions()
Expand Down
45 changes: 39 additions & 6 deletions Microsoft.Toolkit.Uwp.SampleApp/Controls/CodeRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ public class CodeRenderer : Control
private string _displayedText;
private ILanguage _language;
private bool _rendered;
private ElementTheme _theme;

public CodeRenderer()
{
DefaultStyleKey = typeof(CodeRenderer);
_theme = SystemTheme();
SampleController.Current.ThemeChanged += Current_ThemeChanged;
}

/// <summary>
Expand Down Expand Up @@ -84,8 +87,8 @@ protected override void OnApplyTemplate()

private void RenderDocument()
{
_codeView.Blocks.Clear();
_formatter = new RichTextBlockFormatter();
_codeView?.Blocks?.Clear();
_formatter = new RichTextBlockFormatter(_theme);
_formatter.FormatRichTextBlock(_displayedText, _language, _codeView);
_rendered = true;
}
Expand All @@ -101,13 +104,15 @@ private void CopyButton_Click(object sender, RoutedEventArgs e)

private async void PrintButton_Click(object sender, RoutedEventArgs e)
{
Shell.Current.DisplayWaitRing = true;
SampleController.Current.DisplayWaitRing = true;

var printblock = new RichTextBlock
{
FontFamily = _codeView.FontFamily
FontFamily = _codeView.FontFamily,
RequestedTheme = ElementTheme.Light
};
_formatter.FormatRichTextBlock(_displayedText, _language, printblock);
var printFormatter = new RichTextBlockFormatter(ElementTheme.Light);
printFormatter.FormatRichTextBlock(_displayedText, _language, printblock);

_printHelper = new PrintHelper(_container);
_printHelper.AddFrameworkElementToPrint(printblock);
Expand All @@ -127,7 +132,7 @@ private void ReleasePrintHelper()

_printHelper.Dispose();

Shell.Current.DisplayWaitRing = false;
SampleController.Current.DisplayWaitRing = false;
}

private async void PrintHelper_OnPrintSucceeded()
Expand All @@ -148,5 +153,33 @@ private void PrintHelper_OnPrintCanceled()
{
ReleasePrintHelper();
}

private void Current_ThemeChanged(object sender, Models.ThemeChangedArgs e)
{
// Only Handle System Theme Changes.
if (e.CustomSet)
{
return;
}

_theme = SystemTheme();
try
{
_rendered = false;
RenderDocument();
}
catch
{
}
}

/// <summary>
/// Casts Application Theme to Element Theme, as Formatter accepts ElementTheme.
/// </summary>
/// <returns>Element Theme</returns>
private ElementTheme SystemTheme()
{
return SampleController.Current.SystemTheme() == ApplicationTheme.Dark ? ElementTheme.Dark : ElementTheme.Light;
}
}
}
42 changes: 42 additions & 0 deletions Microsoft.Toolkit.Uwp.SampleApp/Controls/CodeRenderer.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.Toolkit.Uwp.SampleApp.Controls"
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.Controls">

<Style TargetType="controls:CodeRenderer">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:CodeRenderer">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid x:Name="Container"
Grid.RowSpan="2"
Opacity="0" />
<ScrollViewer
Grid.Row="0"
HorizontalScrollMode="Auto"
HorizontalScrollBarVisibility="Auto">
<RichTextBlock Name="codeView"
FontFamily="Consolas"
Padding="10" />
</ScrollViewer>
<StackPanel Grid.Row="1"
HorizontalAlignment="Center"
Orientation="Horizontal">
<Button x:Name="CopyButton"
Margin="5"
Content="Copy" />
<Button x:Name="PrintButton"
Margin="5"
Content="Print" />
</StackPanel>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
Loading