Merged PR 1380882: Merge daneuber/redesign_addAboutAndPrivacy to redesign

An 'about' page is necessary for hosting the service agreement and privacy statement. Guidance recommendation is to add it in a Settings page, which is how this is architectured
This commit is contained in:
Danielle Neuberger 2018-01-31 22:37:09 +00:00
Родитель bf7d806ae2
Коммит 3837a3e0ca
10 изменённых файлов: 153 добавлений и 41 удалений

Просмотреть файл

@ -7,7 +7,7 @@
RequestedTheme="Light"
xmlns:contractNotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,5)"
xmlns:contractPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,5)">
<Application.Resources>
<ResourceDictionary>
<x:Double x:Key="WideScreenWidthTrigger">720</x:Double>
@ -214,10 +214,9 @@
</Style>
<Style x:Key="FooterHyperlinkStyle" TargetType="HyperlinkButton">
<Setter Property="Foreground" Value="White" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="{ThemeResource SystemControlHyperlinkTextBrush}" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="20" />
<Setter Property="FontSize" Value="15" />
<Setter Property="FontStyle" Value="Normal" />
<Setter Property="Padding" Value="10" />
</Style>

Просмотреть файл

@ -23,6 +23,7 @@
<PackageCertificateKeyFile>SampleGallery_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>B3A5EDB57C0F21E52B5CFB1BDFD89039CD803898</PackageCertificateThumbprint>
<RuntimeIdentifiers>win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot</RuntimeIdentifiers>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
@ -139,6 +140,9 @@
<DependentUpon>BaseCategoryPage.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\SDK 16299\SpringyImage\SpringyImage.xaml.cs" Condition="$(TargetPlatformBuild) &gt;15063" />
<Compile Include="Settings.xaml.cs">
<DependentUpon>Settings.xaml</DependentUpon>
</Compile>
<Compile Include="Shared\FeaturedSamplesHomePage.xaml.cs">
<DependentUpon>FeaturedSamplesHomePage.xaml</DependentUpon>
</Compile>
@ -421,7 +425,6 @@
<Content Include="Assets\Windows_logo_Cyan_rgb_D.png" />
<Content Include="Assets\ZOrderScrolling.jpg" />
<Content Include="Samples\SDK 15063\Interactions3D\stage.jpg" />
<None Include="Package.StoreAssociation.xml" />
<Content Include="Samples\SDK 10586\Perspective\jellyfish.jpg" />
<Content Include="Samples\SDK 10586\TransitionAnimation-FlipToReveal\Image.jpg" />
<Content Include="Samples\SDK 14393\ForegroundFocusEffects\Mask.png" />
@ -574,6 +577,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Settings.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Shared\FeaturedSamplesHomePage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

Просмотреть файл

@ -14,7 +14,7 @@
<Grid>
<contract5Present:NavigationView
x:Name="NavView"
IsSettingsVisible="False"
IsSettingsVisible="True"
SelectionChanged="NavViewSelectionChanged">
<Frame x:Name="ContentFrame" Margin="24"/>

Просмотреть файл

@ -102,12 +102,24 @@ namespace CompositionSampleGallery
private void NavViewSelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
{
NavigationItem navItem = (NavigationItem)((NavigationViewItem)args.SelectedItem).DataContext;
ContentFrame.Navigate(navItem.PageType, navItem);
Dictionary<string, string> properties = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
properties.Add("TargetView", navItem.Category.ToString());
Shared.AppTelemetryClient.TrackEvent("Navigate", properties, null);
// Verify nav item exists for navigation info. Settings page will return no navigation item.
if (navItem != null)
{
Dictionary<string, string> properties = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
properties.Add("TargetView", navItem.Category.ToString());
Shared.AppTelemetryClient.TrackEvent("Navigate", properties, null);
}
if (args.IsSettingsSelected)
{
ContentFrame.Navigate(typeof(Settings));
}
else
{
ContentFrame.Navigate(navItem.PageType, navItem);
}
// Reset the backstack when a new category is selected to avoid having to coordinate the cateogory
// selection as we navigate back through the backstack
ContentFrame.BackStack.Clear();

Просмотреть файл

@ -9,25 +9,33 @@
d:DesignHeight="300"
d:DesignWidth="400">
<Pivot
x:Name="MainPivot"
ItemsSource="{x:Bind Path=SampleCategories}"
PivotItemLoading="MainPivot_PivotItemLoading"
IsHeaderItemsCarouselEnabled="False">
<Pivot.HeaderTemplate>
<DataTemplate x:DataType="local:NavigationItem">
<TextBlock Text="{x:Bind Path=DisplayName}" />
</DataTemplate>
</Pivot.HeaderTemplate>
<Pivot.ItemTemplate>
<DataTemplate x:DataType="local:NavigationItem">
<Frame
Loaded="Frame_Loaded"
x:Name="ItemFrame"
Navigated="ItemFrame_Navigated">
</Frame>
</DataTemplate>
</Pivot.ItemTemplate>
</Pivot>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Pivot x:Name="MainPivot"
Grid.Row="0"
ItemsSource="{x:Bind Path=SampleCategories}"
PivotItemLoading="MainPivot_PivotItemLoading"
IsHeaderItemsCarouselEnabled="False">
<Pivot.HeaderTemplate>
<DataTemplate x:DataType="local:NavigationItem">
<TextBlock Text="{x:Bind Path=DisplayName}" />
</DataTemplate>
</Pivot.HeaderTemplate>
<Pivot.ItemTemplate>
<DataTemplate x:DataType="local:NavigationItem">
<Frame
Loaded="Frame_Loaded"
x:Name="ItemFrame"
Navigated="ItemFrame_Navigated">
</Frame>
</DataTemplate>
</Pivot.ItemTemplate>
</Pivot>
</UserControl>
<local:Footer x:Name="Footer" Grid.Row="1" HorizontalAlignment="Center" />
</Grid>
</UserControl>

Просмотреть файл

@ -0,0 +1,55 @@
<Page
x:Class="CompositionSampleGallery.Settings"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CompositionSampleGallery"
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}">
<ScrollViewer
x:Name="contentSV"
Grid.Row="0"
Padding="20,0,0,0"
IsTabStop="False"
UseSystemFocusVisuals="False"
VerticalScrollBarVisibility="Auto"
VerticalScrollMode="Auto">
<StackPanel HorizontalAlignment="Left">
<TextBlock Style="{StaticResource SubheaderTextBlockStyle}" Margin="0,40,0,20" Text="Settings" />
<TextBlock Text="No settings options are available at this time."/>
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Margin="0,50,0,0" Text="Feedback" />
<TextBlock>Please leave feedback for this app using the Feedback button below.</TextBlock>
<Button Click="OnFeedbackButtonClick" Content="Feedback" Margin="0,8,0,0" />
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Margin="0,20,0,0" Text="About" />
<RichTextBlock MaxWidth="840" Margin="0,10,0,0" IsTextSelectionEnabled="True">
<Paragraph>
This app showcases core platform building blocks which power Fluent design and can be used to create more delightful, engaging experiences. The source code to this app is available on
<Hyperlink NavigateUri="https://github.com/Microsoft/WindowsUIDevLabs">
https://github.com/Microsoft/WindowsUIDevLabs
</Hyperlink>.
</Paragraph>
</RichTextBlock>
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Margin="0,20,0,0" Text="Disclaimer" />
<RichTextBlock MaxWidth="840" Margin="0,10,0,50" IsTextSelectionEnabled="True">
<Paragraph>THIS CODE AND INFORMATION IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.</Paragraph>
<Paragraph>
<LineBreak /> Copyright (c) Microsoft Corporation. All rights reserved.
</Paragraph>
<Paragraph Margin="0,10,0,10">
<Hyperlink NavigateUri="https://go.microsoft.com/fwlink/?LinkId=822631">Microsoft Services Agreement</Hyperlink>,
<Hyperlink NavigateUri="https://go.microsoft.com/fwlink/?LinkId=521839">Microsoft Privacy Statement</Hyperlink>
</Paragraph>
</RichTextBlock>
</StackPanel>
</ScrollViewer>
</Grid>
</Page>

Просмотреть файл

@ -0,0 +1,22 @@
using System;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace CompositionSampleGallery
{
public sealed partial class Settings : Page
{
public Settings()
{
this.InitializeComponent();
}
private async void OnFeedbackButtonClick(object sender, RoutedEventArgs e)
{
await Launcher.LaunchUriAsync(new Uri("feedback-hub:"));
}
}
}

Просмотреть файл

@ -7,13 +7,12 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid>
<RichTextBlock FontSize="12" Margin="20">
<Paragraph>THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
</Paragraph>
<Paragraph>
<LineBreak/> Copyright (c) Microsoft Corporation. All rights
</Paragraph>
</RichTextBlock>
<Grid x:Name="FooterPartial">
<HyperlinkButton x:Name="SettingsButton" Click="SettingsButton_Click" Style="{ThemeResource FooterHyperlinkStyle}" >
<StackPanel Orientation="Horizontal">
<SymbolIcon x:Name="Settings" Symbol="Setting"/>
<TextBlock Text="View Settings and About" Margin="10,0,0,0"/>
</StackPanel>
</HyperlinkButton>
</Grid>
</UserControl>

Просмотреть файл

@ -24,5 +24,10 @@ namespace CompositionSampleGallery
{
this.InitializeComponent();
}
private void SettingsButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
MainNavigationViewModel.ShowSettings();
}
}
}

Просмотреть файл

@ -112,6 +112,11 @@ namespace CompositionSampleGallery
{
s_instance._hostingUI.Navigate(typeof(SearchResultsPage), queryText);
}
public static void ShowSettings()
{
s_instance._hostingUI.Navigate((typeof(Settings)), null);
}
}
public class NavigationItem