Permalink
Browse files

Initial checkin of the doto sample

  • Loading branch information...
1 parent d2f557a commit 3a4f65a9c892212e5990cad54fcef1b5a4c13a54 @paulbatum paulbatum committed Sep 19, 2012
Showing with 63,529 additions and 0 deletions.
  1. +4 −0 README.md
  2. +6 −0 samples/doto/.gitignore
  3. +18 −0 samples/doto/C#/App.xaml
  4. +84 −0 samples/doto/C#/App.xaml.cs
  5. BIN samples/doto/C#/Assets/Logo.png
  6. BIN samples/doto/C#/Assets/SmallLogo.png
  7. BIN samples/doto/C#/Assets/SplashScreen.png
  8. BIN samples/doto/C#/Assets/StoreLogo.png
  9. BIN samples/doto/C#/Assets/WideLogo.png
  10. +39 −0 samples/doto/C#/Common/BoolToVisibilityConverter.cs
  11. +94 −0 samples/doto/C#/Common/DelegateCommand.cs
  12. +80 −0 samples/doto/C#/Common/DotoServiceFilter.cs
  13. +23 −0 samples/doto/C#/Common/Extensions.cs
  14. +37 −0 samples/doto/C#/Common/IPopupService.cs
  15. +38 −0 samples/doto/C#/Common/InstallationId.cs
  16. +28 −0 samples/doto/C#/Common/SimpleCommand.cs
  17. +1,007 −0 samples/doto/C#/Common/StandardStyles.xaml
  18. +158 −0 samples/doto/C#/Common/Styles.xaml
  19. +52 −0 samples/doto/C#/Common/ViewModel.cs
  20. +15 −0 samples/doto/C#/Controls/FadingImage.xaml
  21. +62 −0 samples/doto/C#/Controls/FadingImage.xaml.cs
  22. +63 −0 samples/doto/C#/Controls/InviteUser.xaml
  23. +37 −0 samples/doto/C#/Controls/InviteUser.xaml.cs
  24. +45 −0 samples/doto/C#/Controls/ViewInvites.xaml
  25. +24 −0 samples/doto/C#/Controls/ViewInvites.xaml.cs
  26. +117 −0 samples/doto/C#/MainPage.xaml
  27. +202 −0 samples/doto/C#/MainPage.xaml.cs
  28. +30 −0 samples/doto/C#/Model/Device.cs
  29. +46 −0 samples/doto/C#/Model/Invite.cs
  30. +32 −0 samples/doto/C#/Model/Item.cs
  31. +32 −0 samples/doto/C#/Model/ListMembership.cs
  32. +101 −0 samples/doto/C#/Model/Profile.cs
  33. +25 −0 samples/doto/C#/Model/Setting.cs
  34. +27 −0 samples/doto/C#/Package.appxmanifest
  35. +29 −0 samples/doto/C#/Properties/AssemblyInfo.cs
  36. +147 −0 samples/doto/C#/ViewModels/InviteUserViewModel.cs
  37. +698 −0 samples/doto/C#/ViewModels/MainViewModel.cs
  38. +56 −0 samples/doto/C#/ViewModels/ViewInvitesViewModel.cs
  39. +11 −0 samples/doto/C#/ViewModels/ViewState.cs
  40. +209 −0 samples/doto/C#/doto.csproj
  41. +61 −0 samples/doto/C#/doto.sln
  42. +4 −0 samples/doto/C#/packages.config
  43. BIN samples/doto/C#/packages/Callisto.1.0.10/Callisto.1.0.10.nupkg
  44. BIN samples/doto/C#/packages/Callisto.1.0.10/lib/winrt45/Callisto.dll
  45. BIN samples/doto/C#/packages/Callisto.1.0.10/lib/winrt45/Callisto.pri
  46. +635 −0 samples/doto/C#/packages/Callisto.1.0.10/lib/winrt45/Callisto/Themes/Generic.xaml
  47. +4 −0 samples/doto/C#/packages/repositories.config
  48. +44 −0 samples/doto/README.md
  49. +38 −0 samples/doto/ServerScripts/devices.insert.js
  50. +100 −0 samples/doto/ServerScripts/invites.insert.js
  51. +5 −0 samples/doto/ServerScripts/invites.read.js
  52. +46 −0 samples/doto/ServerScripts/invites.update.js
  53. +33 −0 samples/doto/ServerScripts/items.del.js
  54. +74 −0 samples/doto/ServerScripts/items.insert.js
  55. +22 −0 samples/doto/ServerScripts/items.read.js
  56. +54 −0 samples/doto/ServerScripts/listMembers.del.js
  57. +13 −0 samples/doto/ServerScripts/listMembers.insert.js
  58. +5 −0 samples/doto/ServerScripts/listMembers.read.js
  59. +28 −0 samples/doto/ServerScripts/profiles.insert.js
  60. +58,687 −0 samples/doto/setup.rtf
View
4 README.md
@@ -36,6 +36,10 @@ The Windows SDK has a suite of unit tests but the process for running these test
When you build the solution the output is written to the ```/azure-mobile-services/sdk/windows/bin``` folder. To reference the SDK from a C# Windows Store application, use the dll located at
```/azure-mobile-services/sdk/windows/bin/{Flavor}/Windows 8/Managed/Microsoft.WindowsAzure.MobileServices.Managed.dll``` (where {Flavor} is Debug or Release).
+## Sample Application: Doto
+
+Doto is a simple, social todo list application that demonstrates the features of Windows Azure Mobile Services. You can find doto under ```/azure-mobile-services/samples/doto```.
+
## Need Help?
Be sure to check out the Mobile Services [Developer Forum](http://social.msdn.microsoft.com/Forums/en-US/azuremobile/) if you are having trouble. The Mobile Services product team actively monitors the forum and will be more than happy to assist you.
View
6 samples/doto/.gitignore
@@ -0,0 +1,6 @@
+bin/
+bld/
+obj/
+*.user
+*.suo
+AppPackages/
View
18 samples/doto/C#/App.xaml
@@ -0,0 +1,18 @@
+<Application
+ x:Class="Doto.App"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:Doto"
+ RequestedTheme="Dark"
+ >
+
+ <Application.Resources>
+ <ResourceDictionary>
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="Common/Styles.xaml"/>
+ </ResourceDictionary.MergedDictionaries>
+
+ </ResourceDictionary>
+ </Application.Resources>
+</Application>
+
View
84 samples/doto/C#/App.xaml.cs
@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using Microsoft.WindowsAzure.MobileServices;
+using Windows.ApplicationModel;
+using Windows.ApplicationModel.Activation;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227
+
+namespace Doto
+{
+ /// <summary>
+ /// Provides application-specific behavior to supplement the default Application class.
+ /// </summary>
+ sealed partial class App : Application
+ {
+ /// <summary>
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ /// </summary>
+ public App()
+ {
+ this.InitializeComponent();
+ this.Suspending += OnSuspending;
+ }
+
+ /// <summary>
+ /// Invoked when the application is launched normally by the end user. Other entry points
+ /// will be used when the application is launched to open a specific file, to display
+ /// search results, and so forth.
+ /// </summary>
+ /// <param name="args">Details about the launch request and process.</param>
+ protected override void OnLaunched(LaunchActivatedEventArgs args)
+ {
+ // Do not repeat app initialization when already running, just ensure that
+ // the window is active
+ if (args.PreviousExecutionState == ApplicationExecutionState.Running)
+ {
+ Window.Current.Activate();
+ return;
+ }
+
+ if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
+ {
+ //TODO: Load state from previously suspended application
+ }
+
+ // Create a Frame to act navigation context and navigate to the first page
+ var rootFrame = new Frame();
+ if (!rootFrame.Navigate(typeof(MainPage)))
+ {
+ throw new Exception("Failed to create initial page");
+ }
+
+ // Place the frame in the current Window and ensure that it is active
+ Window.Current.Content = rootFrame;
+ Window.Current.Activate();
+ }
+
+ /// <summary>
+ /// Invoked when application execution is being suspended. Application state is saved
+ /// without knowing whether the application will be terminated or resumed with the contents
+ /// of memory still intact.
+ /// </summary>
+ /// <param name="sender">The source of the suspend request.</param>
+ /// <param name="e">Details about the suspend request.</param>
+ private void OnSuspending(object sender, SuspendingEventArgs e)
+ {
+ var deferral = e.SuspendingOperation.GetDeferral();
+ //TODO: Save application state and stop any background activity
+ deferral.Complete();
+ }
+ }
+}
View
BIN samples/doto/C#/Assets/Logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN samples/doto/C#/Assets/SmallLogo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN samples/doto/C#/Assets/SplashScreen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN samples/doto/C#/Assets/StoreLogo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN samples/doto/C#/Assets/WideLogo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
39 samples/doto/C#/Common/BoolToVisibilityConverter.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Data;
+
+namespace Doto
+{
+ public class BoolToVisibilityConverter : IValueConverter
+ {
+ public BoolToVisibilityConverter()
+ {
+ VisibleValue = true;
+ }
+
+ public bool VisibleValue { get; set; }
+
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ bool interpreted = System.Convert.ToBoolean(value);
+ return interpreted == VisibleValue ? Visibility.Visible : Visibility.Collapsed;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ if (value == null || value.GetType() != typeof(Visibility))
+ {
+ return !VisibleValue;
+ }
+
+ Visibility visibility = (Visibility)value;
+
+ return visibility == Visibility.Visible ? VisibleValue : !VisibleValue;
+
+ }
+ }
+}
View
94 samples/doto/C#/Common/DelegateCommand.cs
@@ -0,0 +1,94 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+
+namespace Doto
+{
+ /// <summary>
+ /// Represents a command for use in databinding and MVVM, supports enable, disable
+ /// and execution
+ /// </summary>
+ public class DelegateCommand : DelegateCommand<object>, INotifyPropertyChanged
+ {
+ public DelegateCommand(Action execute, bool isEnabled = true)
+ : base(o => execute())
+ {
+ IsEnabled = isEnabled;
+ }
+
+ public bool IsEnabled
+ {
+ get { return _isEnabled; }
+ set
+ {
+ _isEnabled = value;
+ OnPropertyChanged("IsEnabled");
+ RaiseCanExecuteChanged();
+ }
+ }
+
+ public void Execute()
+ {
+ Execute(null);
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void OnPropertyChanged(string propertyName)
+ {
+ PropertyChangedEventHandler pceh = PropertyChanged;
+ if (pceh != null)
+ {
+ pceh(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+ }
+
+ /// <summary>
+ /// Represents a command for use in databinding and MVVM, supports enable, disable
+ /// and execution with a command parameter
+ /// </summary>
+ /// <typeparam name="T">The expected type of the command parameter</typeparam>
+ public class DelegateCommand<T> : ICommand where T : class
+ {
+ protected bool _isEnabled = true;
+ private readonly Action<T> _execute;
+ private readonly Predicate<T> _canExecute;
+
+ public DelegateCommand(Action<T> execute, Predicate<T> canExecute = null)
+ {
+ _execute = execute;
+ _canExecute = canExecute ?? (t => _isEnabled);
+ }
+
+ public bool CanExecute(object parameter)
+ {
+ return _canExecute((T)parameter);
+ }
+
+ public void RaiseCanExecuteChanged()
+ {
+ OnCanExecuteChanged();
+ }
+
+ protected virtual void OnCanExecuteChanged()
+ {
+ var handler = CanExecuteChanged;
+ if (handler != null)
+ {
+ handler(this, EventArgs.Empty);
+ }
+ }
+
+ public event EventHandler CanExecuteChanged;
+
+ public void Execute(object parameter)
+ {
+ _execute((T)parameter);
+ }
+ }
+}
View
80 samples/doto/C#/Common/DotoServiceFilter.cs
@@ -0,0 +1,80 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.WindowsAzure.MobileServices;
+using Windows.Foundation;
+using Windows.Storage.Streams;
+using System.Threading;
+using Microsoft.Live;
+using System.Diagnostics;
+
+namespace Doto
+{
+ /// <summary>
+ /// This example implementation of IServiceFilter is used to create the
+ /// busy/progress indicator feature in Doto by counting outgoing calls from
+ /// the mobile service client and responses from the Mobile Service. If a call
+ /// is in progress, Doto shows the progress indicator
+ /// </summary>
+ public class DotoServiceFilter : IServiceFilter
+ {
+ private int _callCount = 0;
+ private readonly object _countLock = new object();
+ private Action<bool> _busyIndicator;
+
+ public DotoServiceFilter(Action<bool> busyIndicator)
+ {
+ _busyIndicator = busyIndicator;
+ }
+
+ public Windows.Foundation.IAsyncOperation<IServiceFilterResponse> Handle(IServiceFilterRequest request,
+ IServiceFilterContinuation continuation)
+ {
+ return HandleAsync(request, continuation).AsAsyncOperation();
+ }
+
+ private async Task<IServiceFilterResponse> HandleAsync(IServiceFilterRequest request,
+ IServiceFilterContinuation continuation)
+ {
+ int ic = _callCount;
+
+ bool invokeBusy = false;
+
+ lock (_countLock)
+ {
+ if (_callCount == 0)
+ {
+ invokeBusy = true;
+ }
+ _callCount++;
+ }
+
+ if (invokeBusy)
+ {
+ _busyIndicator.Invoke(true);
+ }
+
+ IServiceFilterResponse response = await continuation.Handle(request).AsTask();
+
+ bool invokeIdle = false;
+
+ lock (_countLock)
+ {
+ if (_callCount == 1)
+ {
+ invokeIdle = true;
+ }
+ _callCount--;
+ }
+
+ if (invokeIdle) {
+ _busyIndicator.Invoke(false);
+ }
+
+ return response;
+ }
+ }
+}
View
23 samples/doto/C#/Common/Extensions.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Doto
+{
+ /// <summary>
+ /// A selection of useful extension methods
+ /// </summary>
+ public static class Extensions
+ {
+ public static void AddRange<T>(this ObservableCollection<T> collection, IEnumerable<T> items)
+ {
+ foreach (var item in items)
+ {
+ collection.Add(item);
+ }
+ }
+ }
+}
View
37 samples/doto/C#/Common/IPopupService.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Doto
+{
+ /// <summary>
+ /// Since the ViewModels frequently need to interact with the View programmatically
+ /// (not through binding) to display dialogs and flyouts, we use this interface
+ /// to abstract the ViewModel from the specific implementation in the View
+ /// </summary>
+ public interface IPopupService
+ {
+ Task ShowDialogAsync(string title, string message, params SimpleCommand[] commands);
+ Dismiss ShowInviteUserFlyout(InviteUserViewModel viewModel);
+ Dismiss ShowViewInvitesFlyout(ViewInvitesViewModel viewInvitesViewModel);
+ Dismiss ShowAddItemFlyout();
+ Dismiss ShowNewListFlyout();
+ Dismiss ShowChooseListFlyout();
+ }
+
+ public class Dismiss
+ {
+ private readonly Action _onDismiss;
+
+ public Dismiss(Action onDismiss)
+ {
+ _onDismiss = onDismiss;
+ }
+
+ public void DismissFlyout() {
+ _onDismiss();
+ }
+ }
+}
View
38 samples/doto/C#/Common/InstallationId.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Windows.Storage;
+
+namespace Doto
+{
+ /// <summary>
+ /// Generates a persistant unique identifier for this installation that is persisted in
+ /// local storage. This is used by Doto to manage channelUrls for push notifications
+ /// </summary>
+ public static class InstallationId
+ {
+ private static string _fileName = "installation-id.dat";
+ private static string _value = null;
+ private static object _lock = new object();
+
+ public static async Task<string> GetInstallationId()
+ {
+ if (_value != null)
+ {
+ return _value;
+ }
+
+ var file = await ApplicationData.Current.LocalFolder.CreateFileAsync(_fileName, CreationCollisionOption.OpenIfExists);
+ _value = await FileIO.ReadTextAsync(file);
+ if (string.IsNullOrWhiteSpace(_value))
+ {
+ _value = Guid.NewGuid().ToString();
+ await FileIO.WriteTextAsync(file, _value);
+ }
+
+ return _value;
+ }
+ }
+}
View
28 samples/doto/C#/Common/SimpleCommand.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Doto
+{
+ /// <summary>
+ /// A simple, UI-technology-agnostic representation of a simple command for
+ /// use in Doto's dialogs and Settings
+ /// </summary>
+ public class SimpleCommand
+ {
+ public SimpleCommand()
+ {
+ }
+
+ public SimpleCommand(string text, Action action)
+ {
+ Text = text;
+ Action = action;
+ }
+
+ public string Text { get; set; }
+ public Action Action { get; set; }
+ }
+}
View
1,007 samples/doto/C#/Common/StandardStyles.xaml
@@ -0,0 +1,1007 @@
+<!--
+ This file contains XAML styles that simplify application development.
+
+ These are not merely convenient, but are required by most Visual Studio project and item templates.
+ Removing, renaming, or otherwise modifying the content of these files may result in a project that
+ does not build, or that will not build once additional pages are added. If variations on these
+ styles are desired it is recommended that you copy the content under a new name and modify your
+ private copy.
+-->
+
+<ResourceDictionary
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+ <!-- Non-brush values that vary across themes -->
+
+ <ResourceDictionary.ThemeDictionaries>
+ <ResourceDictionary x:Key="Default">
+ <x:String x:Key="BackButtonGlyph">&#xE071;</x:String>
+ <x:String x:Key="BackButtonSnappedGlyph">&#xE0BA;</x:String>
+ </ResourceDictionary>
+
+ <ResourceDictionary x:Key="HighContrast">
+ <x:String x:Key="BackButtonGlyph">&#xE0A6;</x:String>
+ <x:String x:Key="BackButtonSnappedGlyph">&#xE0C4;</x:String>
+ </ResourceDictionary>
+ </ResourceDictionary.ThemeDictionaries>
+
+ <!-- RichTextBlock styles -->
+
+ <Style x:Key="BasicRichTextStyle" TargetType="RichTextBlock">
+ <Setter Property="Foreground" Value="{StaticResource ApplicationForegroundThemeBrush}"/>
+ <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
+ <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
+ <Setter Property="TextTrimming" Value="WordEllipsis"/>
+ <Setter Property="TextWrapping" Value="Wrap"/>
+ <Setter Property="Typography.StylisticSet20" Value="True"/>
+ <Setter Property="Typography.DiscretionaryLigatures" Value="True"/>
+ <Setter Property="Typography.CaseSensitiveForms" Value="True"/>
+ </Style>
+
+ <Style x:Key="BaselineRichTextStyle" TargetType="RichTextBlock" BasedOn="{StaticResource BasicRichTextStyle}">
+ <Setter Property="LineHeight" Value="20"/>
+ <Setter Property="LineStackingStrategy" Value="BlockLineHeight"/>
+ <!-- Properly align text along its baseline -->
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <TranslateTransform X="-1" Y="4"/>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="ItemRichTextStyle" TargetType="RichTextBlock" BasedOn="{StaticResource BaselineRichTextStyle}"/>
+
+ <Style x:Key="BodyRichTextStyle" TargetType="RichTextBlock" BasedOn="{StaticResource BaselineRichTextStyle}">
+ <Setter Property="FontWeight" Value="SemiLight"/>
+ </Style>
+
+ <!-- TextBlock styles -->
+
+ <Style x:Key="BasicTextStyle" TargetType="TextBlock">
+ <Setter Property="Foreground" Value="{StaticResource ApplicationForegroundThemeBrush}"/>
+ <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
+ <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
+ <Setter Property="TextTrimming" Value="WordEllipsis"/>
+ <Setter Property="TextWrapping" Value="Wrap"/>
+ <Setter Property="Typography.StylisticSet20" Value="True"/>
+ <Setter Property="Typography.DiscretionaryLigatures" Value="True"/>
+ <Setter Property="Typography.CaseSensitiveForms" Value="True"/>
+ </Style>
+
+ <Style x:Key="BaselineTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BasicTextStyle}">
+ <Setter Property="LineHeight" Value="20"/>
+ <Setter Property="LineStackingStrategy" Value="BlockLineHeight"/>
+ <!-- Properly align text along its baseline -->
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <TranslateTransform X="-1" Y="4"/>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="HeaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
+ <Setter Property="FontSize" Value="56"/>
+ <Setter Property="FontWeight" Value="Light"/>
+ <Setter Property="LineHeight" Value="40"/>
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <TranslateTransform X="-2" Y="8"/>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="SubheaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
+ <Setter Property="FontSize" Value="26.667"/>
+ <Setter Property="FontWeight" Value="Light"/>
+ <Setter Property="LineHeight" Value="30"/>
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <TranslateTransform X="-1" Y="6"/>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="TitleTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
+ <Setter Property="FontWeight" Value="Normal"/>
+ </Style>
+
+ <Style x:Key="ItemTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}"/>
+
+ <Style x:Key="BodyTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
+ <Setter Property="FontWeight" Value="SemiLight"/>
+ </Style>
+
+ <Style x:Key="CaptionTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
+ <Setter Property="FontSize" Value="12"/>
+ <Setter Property="Foreground" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}"/>
+ </Style>
+
+ <!-- Button styles -->
+
+ <!--
+ TextButtonStyle is used to style a Button using subheader-styled text with no other adornment. This
+ style is used in the GroupedItemsPage as a group header and in the FileOpenPickerPage for triggering
+ commands.
+ -->
+ <Style x:Key="TextButtonStyle" TargetType="Button">
+ <Setter Property="MinWidth" Value="0"/>
+ <Setter Property="MinHeight" Value="0"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="Button">
+ <Grid Background="Transparent">
+ <TextBlock
+ x:Name="Text"
+ Text="{TemplateBinding Content}"
+ Margin="3,-7,3,10"
+ TextWrapping="NoWrap"
+ Style="{StaticResource SubheaderTextStyle}"/>
+ <Rectangle
+ x:Name="FocusVisualWhite"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="1.5"/>
+ <Rectangle
+ x:Name="FocusVisualBlack"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="0.5"/>
+
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal"/>
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPointerOverForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPressedForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonDisabledForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="FocusStates">
+ <VisualState x:Name="Focused">
+ <Storyboard>
+ <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="FocusVisualWhite" Storyboard.TargetProperty="Opacity"/>
+ <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="FocusVisualBlack" Storyboard.TargetProperty="Opacity"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Unfocused"/>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <!--
+ TextRadioButtonStyle is used to style a RadioButton using subheader-styled text with no other adornment.
+ This style is used in the SearchResultsPage to allow selection among filters.
+ -->
+ <Style x:Key="TextRadioButtonStyle" TargetType="RadioButton">
+ <Setter Property="MinWidth" Value="0"/>
+ <Setter Property="MinHeight" Value="0"/>
+ <Setter Property="Margin" Value="0,0,30,0"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="RadioButton">
+ <Grid Background="Transparent">
+ <TextBlock
+ x:Name="Text"
+ Text="{TemplateBinding Content}"
+ Margin="3,-7,3,10"
+ TextWrapping="NoWrap"
+ Style="{StaticResource SubheaderTextStyle}"/>
+ <Rectangle
+ x:Name="FocusVisualWhite"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="1.5"/>
+ <Rectangle
+ x:Name="FocusVisualBlack"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="0.5"/>
+
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal"/>
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPointerOverForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPressedForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonDisabledForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="FocusStates">
+ <VisualState x:Name="Focused">
+ <Storyboard>
+ <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="FocusVisualWhite" Storyboard.TargetProperty="Opacity"/>
+ <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="FocusVisualBlack" Storyboard.TargetProperty="Opacity"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Unfocused"/>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="CheckStates">
+ <VisualState x:Name="Checked"/>
+ <VisualState x:Name="Unchecked">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Indeterminate"/>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <!--
+ AppBarButtonStyle is used to style a Button for use in an App Bar. Content will be centered and should fit within
+ the 40-pixel radius glyph provided. 16-point Segoe UI Symbol is used for content text to simplify the use of glyphs
+ from that font. AutomationProperties.Name is used for the text below the glyph.
+ -->
+ <Style x:Key="AppBarButtonStyle" TargetType="Button">
+ <Setter Property="Foreground" Value="{StaticResource AppBarItemForegroundThemeBrush}"/>
+ <Setter Property="VerticalAlignment" Value="Stretch"/>
+ <Setter Property="FontFamily" Value="Segoe UI Symbol"/>
+ <Setter Property="FontWeight" Value="Normal"/>
+ <Setter Property="FontSize" Value="20"/>
+ <Setter Property="AutomationProperties.ItemType" Value="App Bar Button"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="Button">
+ <Grid x:Name="RootGrid" Width="100" Background="Transparent">
+ <StackPanel VerticalAlignment="Top" Margin="0,12,0,11">
+ <Grid Width="40" Height="40" Margin="0,0,0,5" HorizontalAlignment="Center">
+ <TextBlock x:Name="BackgroundGlyph" Text="&#xE0A8;" FontFamily="Segoe UI Symbol" FontSize="53.333" Margin="-4,-19,0,0" Foreground="{StaticResource AppBarItemBackgroundThemeBrush}"/>
+ <TextBlock x:Name="OutlineGlyph" Text="&#xE0A7;" FontFamily="Segoe UI Symbol" FontSize="53.333" Margin="-4,-19,0,0"/>
+ <ContentPresenter x:Name="Content" HorizontalAlignment="Center" Margin="-1,-1,0,0" VerticalAlignment="Center"/>
+ </Grid>
+ <TextBlock
+ x:Name="TextLabel"
+ Text="{TemplateBinding AutomationProperties.Name}"
+ Foreground="{StaticResource AppBarItemForegroundThemeBrush}"
+ Margin="0,0,2,0"
+ FontSize="12"
+ TextAlignment="Center"
+ Width="88"
+ MaxHeight="32"
+ TextTrimming="WordEllipsis"
+ Style="{StaticResource BasicTextStyle}"/>
+ </StackPanel>
+ <Rectangle
+ x:Name="FocusVisualWhite"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="1.5"/>
+ <Rectangle
+ x:Name="FocusVisualBlack"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="0.5"/>
+
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="ApplicationViewStates">
+ <VisualState x:Name="FullScreenLandscape"/>
+ <VisualState x:Name="Filled"/>
+ <VisualState x:Name="FullScreenPortrait">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Width">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="60"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Snapped">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Width">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="60"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal"/>
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemPointerOverBackgroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemPointerOverForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OutlineGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemPressedForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OutlineGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="FocusStates">
+ <VisualState x:Name="Focused">
+ <Storyboard>
+ <DoubleAnimation
+ Storyboard.TargetName="FocusVisualWhite"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ <DoubleAnimation
+ Storyboard.TargetName="FocusVisualBlack"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Unfocused" />
+ <VisualState x:Name="PointerFocused" />
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <!-- Standard App Bar buttons -->
+
+ <Style x:Key="SkipBackAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SkipBackAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Skip Back"/>
+ <Setter Property="Content" Value="&#xE100;"/>
+ </Style>
+ <Style x:Key="SkipAheadAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SkipAheadAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Skip Ahead"/>
+ <Setter Property="Content" Value="&#xE101;"/>
+ </Style>
+ <Style x:Key="PlayAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PlayAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Play"/>
+ <Setter Property="Content" Value="&#xE102;"/>
+ </Style>
+ <Style x:Key="PauseAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PauseAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Pause"/>
+ <Setter Property="Content" Value="&#xE103;"/>
+ </Style>
+ <Style x:Key="EditAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="EditAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Edit"/>
+ <Setter Property="Content" Value="&#xE104;"/>
+ </Style>
+ <Style x:Key="SaveAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SaveAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Save"/>
+ <Setter Property="Content" Value="&#xE105;"/>
+ </Style>
+ <Style x:Key="DeleteAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DeleteAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Delete"/>
+ <Setter Property="Content" Value="&#xE106;"/>
+ </Style>
+ <Style x:Key="DiscardAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DiscardAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Discard"/>
+ <Setter Property="Content" Value="&#xE107;"/>
+ </Style>
+ <Style x:Key="RemoveAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RemoveAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Remove"/>
+ <Setter Property="Content" Value="&#xE108;"/>
+ </Style>
+ <Style x:Key="AddAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="AddAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Add"/>
+ <Setter Property="Content" Value="&#xE109;"/>
+ </Style>
+ <Style x:Key="NoAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="NoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="No"/>
+ <Setter Property="Content" Value="&#xE10A;"/>
+ </Style>
+ <Style x:Key="YesAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="YesAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Yes"/>
+ <Setter Property="Content" Value="&#xE10B;"/>
+ </Style>
+ <Style x:Key="MoreAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MoreAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="More"/>
+ <Setter Property="Content" Value="&#xE10C;"/>
+ </Style>
+ <Style x:Key="RedoAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RedoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Redo"/>
+ <Setter Property="Content" Value="&#xE10D;"/>
+ </Style>
+ <Style x:Key="UndoAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="UndoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Undo"/>
+ <Setter Property="Content" Value="&#xE10E;"/>
+ </Style>
+ <Style x:Key="HomeAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="HomeAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Home"/>
+ <Setter Property="Content" Value="&#xE10F;"/>
+ </Style>
+ <Style x:Key="OutAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="OutAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Out"/>
+ <Setter Property="Content" Value="&#xE110;"/>
+ </Style>
+ <Style x:Key="NextAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="NextAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Next"/>
+ <Setter Property="Content" Value="&#xE111;"/>
+ </Style>
+ <Style x:Key="PreviousAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PreviousAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Previous"/>
+ <Setter Property="Content" Value="&#xE112;"/>
+ </Style>
+ <Style x:Key="FavoriteAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="FavoriteAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Favorite"/>
+ <Setter Property="Content" Value="&#xE113;"/>
+ </Style>
+ <Style x:Key="PhotoAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PhotoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Photo"/>
+ <Setter Property="Content" Value="&#xE114;"/>
+ </Style>
+ <Style x:Key="SettingsAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SettingsAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Settings"/>
+ <Setter Property="Content" Value="&#xE115;"/>
+ </Style>
+ <Style x:Key="VideoAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="VideoAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Video"/>
+ <Setter Property="Content" Value="&#xE116;"/>
+ </Style>
+ <Style x:Key="RefreshAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="RefreshAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Refresh"/>
+ <Setter Property="Content" Value="&#xE117;"/>
+ </Style>
+ <Style x:Key="DownloadAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="DownloadAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Download"/>
+ <Setter Property="Content" Value="&#xE118;"/>
+ </Style>
+ <Style x:Key="MailAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="MailAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Mail"/>
+ <Setter Property="Content" Value="&#xE119;"/>
+ </Style>
+ <Style x:Key="SearchAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="SearchAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Search"/>
+ <Setter Property="Content" Value="&#xE11A;"/>
+ </Style>
+ <Style x:Key="HelpAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="HelpAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Help"/>
+ <Setter Property="Content" Value="&#xE11B;"/>
+ </Style>
+ <Style x:Key="UploadAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="UploadAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Upload"/>
+ <Setter Property="Content" Value="&#xE11C;"/>
+ </Style>
+ <Style x:Key="PinAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="PinAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Pin"/>
+ <Setter Property="Content" Value="&#xE141;"/>
+ </Style>
+ <Style x:Key="UnpinAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="UnpinAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Unpin"/>
+ <Setter Property="Content" Value="&#xE196;"/>
+ </Style>
+
+ <!-- Title area styles -->
+
+ <Style x:Key="PageHeaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource HeaderTextStyle}">
+ <Setter Property="TextWrapping" Value="NoWrap"/>
+ <Setter Property="VerticalAlignment" Value="Bottom"/>
+ <Setter Property="Margin" Value="0,0,30,40"/>
+ </Style>
+
+ <Style x:Key="PageSubheaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource SubheaderTextStyle}">
+ <Setter Property="TextWrapping" Value="NoWrap"/>
+ <Setter Property="VerticalAlignment" Value="Bottom"/>
+ <Setter Property="Margin" Value="0,0,0,40"/>
+ </Style>
+
+ <Style x:Key="SnappedPageHeaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource PageSubheaderTextStyle}">
+ <Setter Property="Margin" Value="0,0,18,40"/>
+ </Style>
+
+ <!--
+ BackButtonStyle is used to style a Button for use in the title area of a page. Margins appropriate for
+ the conventional page layout are included as part of the style.
+ -->
+ <Style x:Key="BackButtonStyle" TargetType="Button">
+ <Setter Property="MinWidth" Value="0"/>
+ <Setter Property="Width" Value="48"/>
+ <Setter Property="Height" Value="48"/>
+ <Setter Property="Margin" Value="36,0,36,36"/>
+ <Setter Property="VerticalAlignment" Value="Bottom"/>
+ <Setter Property="FontFamily" Value="Segoe UI Symbol"/>
+ <Setter Property="FontWeight" Value="Normal"/>
+ <Setter Property="FontSize" Value="56"/>
+ <Setter Property="AutomationProperties.AutomationId" Value="BackButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Back"/>
+ <Setter Property="AutomationProperties.ItemType" Value="Navigation Button"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="Button">
+ <Grid x:Name="RootGrid">
+ <Grid Margin="-1,-16,0,0">
+ <TextBlock x:Name="BackgroundGlyph" Text="&#xE0A8;" Foreground="{StaticResource BackButtonBackgroundThemeBrush}"/>
+ <TextBlock x:Name="NormalGlyph" Text="{StaticResource BackButtonGlyph}" Foreground="{StaticResource BackButtonForegroundThemeBrush}"/>
+ <TextBlock x:Name="ArrowGlyph" Text="&#xE0A6;" Foreground="{StaticResource BackButtonPressedForegroundThemeBrush}" Opacity="0"/>
+ </Grid>
+ <Rectangle
+ x:Name="FocusVisualWhite"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="1.5"/>
+ <Rectangle
+ x:Name="FocusVisualBlack"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="0.5"/>
+
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal" />
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverBackgroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimation
+ Storyboard.TargetName="ArrowGlyph"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ <DoubleAnimation
+ Storyboard.TargetName="NormalGlyph"
+ Storyboard.TargetProperty="Opacity"
+ To="0"
+ Duration="0"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Visibility">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="FocusStates">
+ <VisualState x:Name="Focused">
+ <Storyboard>
+ <DoubleAnimation
+ Storyboard.TargetName="FocusVisualWhite"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ <DoubleAnimation
+ Storyboard.TargetName="FocusVisualBlack"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Unfocused" />
+ <VisualState x:Name="PointerFocused" />
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <!--
+ PortraitBackButtonStyle is used to style a Button for use in the title area of a portrait page. Margins appropriate
+ for the conventional page layout are included as part of the style.
+ -->
+ <Style x:Key="PortraitBackButtonStyle" TargetType="Button" BasedOn="{StaticResource BackButtonStyle}">
+ <Setter Property="Margin" Value="26,0,26,36"/>
+ </Style>
+
+ <!--
+ SnappedBackButtonStyle is used to style a Button for use in the title area of a snapped page. Margins appropriate
+ for the conventional page layout are included as part of the style.
+
+ The obvious duplication here is necessary as the glyphs used in snapped are not merely smaller versions of the same
+ glyph but are actually distinct.
+ -->
+ <Style x:Key="SnappedBackButtonStyle" TargetType="Button">
+ <Setter Property="MinWidth" Value="0"/>
+ <Setter Property="Margin" Value="20,0,0,0"/>
+ <Setter Property="VerticalAlignment" Value="Bottom"/>
+ <Setter Property="FontFamily" Value="Segoe UI Symbol"/>
+ <Setter Property="FontWeight" Value="Normal"/>
+ <Setter Property="FontSize" Value="26.66667"/>
+ <Setter Property="AutomationProperties.AutomationId" Value="BackButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Back"/>
+ <Setter Property="AutomationProperties.ItemType" Value="Navigation Button"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="Button">
+ <Grid x:Name="RootGrid" Width="36" Height="36" Margin="-3,0,7,33">
+ <Grid Margin="-1,-1,0,0">
+ <TextBlock x:Name="BackgroundGlyph" Text="&#xE0D4;" Foreground="{StaticResource BackButtonBackgroundThemeBrush}"/>
+ <TextBlock x:Name="NormalGlyph" Text="{StaticResource BackButtonSnappedGlyph}" Foreground="{StaticResource BackButtonForegroundThemeBrush}"/>
+ <TextBlock x:Name="ArrowGlyph" Text="&#xE0C4;" Foreground="{StaticResource BackButtonPressedForegroundThemeBrush}" Opacity="0"/>
+ </Grid>
+ <Rectangle
+ x:Name="FocusVisualWhite"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="1.5"/>
+ <Rectangle
+ x:Name="FocusVisualBlack"
+ IsHitTestVisible="False"
+ Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
+ StrokeEndLineCap="Square"
+ StrokeDashArray="1,1"
+ Opacity="0"
+ StrokeDashOffset="0.5"/>
+
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal" />
+ <VisualState x:Name="PointerOver">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverBackgroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonForegroundThemeBrush}"/>
+ </ObjectAnimationUsingKeyFrames>
+ <DoubleAnimation
+ Storyboard.TargetName="ArrowGlyph"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ <DoubleAnimation
+ Storyboard.TargetName="NormalGlyph"
+ Storyboard.TargetProperty="Opacity"
+ To="0"
+ Duration="0"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Disabled">
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Visibility">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="FocusStates">
+ <VisualState x:Name="Focused">
+ <Storyboard>
+ <DoubleAnimation
+ Storyboard.TargetName="FocusVisualWhite"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ <DoubleAnimation
+ Storyboard.TargetName="FocusVisualBlack"
+ Storyboard.TargetProperty="Opacity"
+ To="1"
+ Duration="0"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Unfocused" />
+ <VisualState x:Name="PointerFocused" />
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <!-- Item templates -->
+
+ <!-- Grid-appropriate 250 pixel square item template as seen in the GroupedItemsPage and ItemsPage -->
+ <DataTemplate x:Key="Standard250x250ItemTemplate">
+ <Grid HorizontalAlignment="Left" Width="250" Height="250">
+ <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
+ <Image Source="{Binding Image}" Stretch="UniformToFill"/>
+ </Border>
+ <StackPanel VerticalAlignment="Bottom" Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}">
+ <TextBlock Text="{Binding Title}" Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}" Style="{StaticResource TitleTextStyle}" Height="60" Margin="15,0,15,0"/>
+ <TextBlock Text="{Binding Subtitle}" Foreground="{StaticResource ListViewItemOverlaySecondaryForegroundThemeBrush}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" Margin="15,0,15,10"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <!-- Grid-appropriate 500 by 130 pixel item template as seen in the GroupDetailPage -->
+ <DataTemplate x:Key="Standard500x130ItemTemplate">
+ <Grid Height="110" Width="480" Margin="10">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="110" Height="110">
+ <Image Source="{Binding Image}" Stretch="UniformToFill"/>
+ </Border>
+ <StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,0,0,0">
+ <TextBlock Text="{Binding Title}" Style="{StaticResource TitleTextStyle}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Subtitle}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextStyle}" MaxHeight="60"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <!-- List-appropriate 130 pixel high item template as seen in the SplitPage -->
+ <DataTemplate x:Key="Standard130ItemTemplate">
+ <Grid Height="110" Margin="6">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="110" Height="110">
+ <Image Source="{Binding Image}" Stretch="UniformToFill"/>
+ </Border>
+ <StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,0,0,0">
+ <TextBlock Text="{Binding Title}" Style="{StaticResource TitleTextStyle}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Subtitle}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextStyle}" MaxHeight="60"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <!--
+ List-appropriate 80 pixel high item template as seen in the SplitPage when Filled, and
+ the following pages when snapped: GroupedItemsPage, GroupDetailPage, and ItemsPage
+ -->
+ <DataTemplate x:Key="Standard80ItemTemplate">
+ <Grid Margin="6">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="60" Height="60">
+ <Image Source="{Binding Image}" Stretch="UniformToFill"/>
+ </Border>
+ <StackPanel Grid.Column="1" Margin="10,0,0,0">
+ <TextBlock Text="{Binding Title}" Style="{StaticResource ItemTextStyle}" MaxHeight="40"/>
+ <TextBlock Text="{Binding Subtitle}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <!-- Grid-appropriate 300 by 70 pixel item template as seen in the SearchResultsPage -->
+ <DataTemplate x:Key="StandardSmallIcon300x70ItemTemplate">
+ <Grid Width="294" Margin="6">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Margin="0,0,0,10" Width="40" Height="40">
+ <Image Source="{Binding Image}" Stretch="UniformToFill"/>
+ </Border>
+ <StackPanel Grid.Column="1" Margin="10,-10,0,0">
+ <TextBlock Text="{Binding Title}" Style="{StaticResource BodyTextStyle}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Subtitle}" Style="{StaticResource BodyTextStyle}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextStyle}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" TextWrapping="NoWrap"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <!-- List-appropriate 70 pixel high item template as seen in the SearchResultsPage when Snapped -->
+ <DataTemplate x:Key="StandardSmallIcon70ItemTemplate">
+ <Grid Margin="6">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Margin="0,0,0,10" Width="40" Height="40">
+ <Image Source="{Binding Image}" Stretch="UniformToFill"/>
+ </Border>
+ <StackPanel Grid.Column="1" Margin="10,-10,0,0">
+ <TextBlock Text="{Binding Title}" Style="{StaticResource BodyTextStyle}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Subtitle}" Style="{StaticResource BodyTextStyle}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" TextWrapping="NoWrap"/>
+ <TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextStyle}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" TextWrapping="NoWrap"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <!--
+ 190x130 pixel item template for displaying file previews as seen in the FileOpenPickerPage
+ Includes an elaborate tooltip to display title and description text
+ -->
+ <DataTemplate x:Key="StandardFileWithTooltip190x130ItemTemplate">
+ <Grid>
+ <Grid Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
+ <Image
+ Source="{Binding Image}"
+ Width="190"
+ Height="130"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Stretch="Uniform"/>
+ </Grid>
+ <ToolTipService.Placement>Mouse</ToolTipService.Placement>
+ <ToolTipService.ToolTip>
+ <ToolTip>
+ <ToolTip.Style>
+ <Style TargetType="ToolTip">
+ <Setter Property="BorderBrush" Value="{StaticResource ToolTipBackgroundThemeBrush}" />
+ <Setter Property="Padding" Value="0" />
+ </Style>
+ </ToolTip.Style>
+
+ <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+
+ <Grid Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Margin="20">
+ <Image
+ Source="{Binding Image}"
+ Width="160"
+ Height="160"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Stretch="Uniform"/>
+ </Grid>
+ <StackPanel Width="200" Grid.Column="1" Margin="0,20,20,20">
+ <TextBlock Text="{Binding Title}" TextWrapping="NoWrap" Style="{StaticResource BodyTextStyle}"/>
+ <TextBlock Text="{Binding Description}" MaxHeight="140" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" Style="{StaticResource BodyTextStyle}"/>
+ </StackPanel>
+ </Grid>
+ </ToolTip>
+ </ToolTipService.ToolTip>
+ </Grid>
+ </DataTemplate>
+
+ <!-- ScrollViewer styles -->
+
+ <Style x:Key="HorizontalScrollViewerStyle" TargetType="ScrollViewer">
+ <Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
+ <Setter Property="VerticalScrollBarVisibility" Value="Disabled"/>
+ <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled" />
+ <Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" />
+ <Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
+ </Style>
+
+ <Style x:Key="VerticalScrollViewerStyle" TargetType="ScrollViewer">
+ <Setter Property="HorizontalScrollBarVisibility" Value="Disabled"/>
+ <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
+ <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
+ <Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled" />
+ <Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
+ </Style>
+
+ <!-- Page layout roots typically use entrance animations and a theme-appropriate background color -->
+
+ <Style x:Key="LayoutRootStyle" TargetType="Panel">
+ <Setter Property="Background" Value="{StaticResource ApplicationPageBackgroundThemeBrush}"/>
+ <Setter Property="ChildrenTransitions">
+ <Setter.Value>
+ <TransitionCollection>
+ <EntranceThemeTransition/>
+ </TransitionCollection>
+ </Setter.Value>
+ </Setter>
+ </Style>
+</ResourceDictionary>
View
158 samples/doto/C#/Common/Styles.xaml
@@ -0,0 +1,158 @@
+<ResourceDictionary
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:doto="using:Doto">
+
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="StandardStyles.xaml"/>
+ </ResourceDictionary.MergedDictionaries>
+
+ <doto:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" VisibleValue="True" />
+
+ <SolidColorBrush x:Key="PanelBackground" Color="#B000" />
+ <SolidColorBrush x:Key="ItemBackground" Color="#0EEEEEEE" />
+
+ <Style x:Key="OtherUserAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
+ <Setter Property="AutomationProperties.AutomationId" Value="OtherUserAppBarButton"/>
+ <Setter Property="AutomationProperties.Name" Value="Other User"/>
+ <Setter Property="Content" Value="&#xE1A6;"/>
+ </Style>
+
+ <Style x:Key="LargeText" TargetType="TextBlock" >
+ <Setter Property="FontSize" Value="60" />
+ <Setter Property="FontFamily" Value="Segoe UI Light" />
+ <Setter Property="FontWeight" Value="Thin" />
+ </Style>
+
+ <Style x:Key="MediumText" TargetType="TextBlock" >
+ <Setter Property="TextWrapping" Value="Wrap" />
+ <Setter Property="FontSize" Value="30" />
+ <Setter Property="FontFamily" Value="Segoe UI Light" />
+ <Setter Property="FontWeight" Value="Thin" />
+ </Style>
+
+ <Style x:Key="SmallText" TargetType="TextBlock" >
+ <Setter Property="TextWrapping" Value="Wrap" />
+ <Setter Property="FontSize" Value="20" />
+ <Setter Property="FontFamily" Value="Segoe UI Light" />
+ <Setter Property="FontWeight" Value="Thin" />
+ </Style>
+
+ <Style x:Key="TinyText" TargetType="TextBlock" >
+ <Setter Property="TextWrapping" Value="Wrap" />
+ <Setter Property="FontSize" Value="10" />
+ <Setter Property="FontFamily" Value="Segoe UI Light" />
+ <Setter Property="FontWeight" Value="Thin" />
+ </Style>
+
+ <Style x:Key="ItemsListViewStyle" TargetType="ListView">
+ <Setter Property="Margin" Value="30" />
+ <Setter Property="ItemContainerStyle">
+ <Setter.Value>
+ <Style TargetType="ListViewItem">
+ <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
+ </Style>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="MenuItemsControlStyle" TargetType="ItemsControl">
+ <Setter Property="BorderBrush">
+ <Setter.Value>
+ <SolidColorBrush Opacity="0"/>
+ </Setter.Value>
+ </Setter>
+ <Setter Property="ItemContainerStyle">
+ <Setter.Value>
+ <Style TargetType="ContentPresenter">
+ <Setter Property="Margin" Value="0, 10, 0, 10" />
+ </Style>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <DataTemplate x:Key="UserDataTemplate">
+ <StackPanel Orientation="Horizontal" Margin="10,5">
+ <Image Source="{Binding ImageUrl}" Width="30" Height="30" Margin="0,0,10,0" />
+ <TextBlock Style="{StaticResource MediumText}" Text="{Binding Name}" />
+ </StackPanel>
+ </DataTemplate>
+
+ <DataTemplate x:Key="ListsDataTemplate">
+ <StackPanel Orientation="Horizontal" Margin="20, 0, 20, 0">
+ <TextBlock Style="{StaticResource MediumText}" Text="{Binding Name}" />
+ </StackPanel>
+ </DataTemplate>
+
+ <Style x:Name="ProgressRingStyle" TargetType="ProgressRing">
+ <Setter Property="HorizontalAlignment" Value="Center" />
+ <Setter Property="VerticalAlignment" Value="Center" />
+ <Setter Property="Foreground" Value="#EEE" />
+ <Setter Property="Width" Value="100" />
+ <Setter Property="Height" Value="100" />
+ </Style>
+
+ <DataTemplate x:Key="RegistrationTemplate">
+ <Grid Background="#6000">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="400" />
+ <ColumnDefinition />
+ </Grid.ColumnDefinitions>
+ <Grid Background="Black" Grid.Column="0">
+ <StackPanel Margin="10">
+ <TextBlock FontSize="40" Text="Register" Margin="10" />
+ <TextBlock FontSize="15" Margin="10,20,10,20" TextWrapping="Wrap">
+Welcome to doto. It's all about sharing, so please register some
+details so it will be easier for your friends to find you.
+ </TextBlock>
+ <TextBlock Text="Full Name" Margin="10,10,10,0" FontSize="15" />
+ <TextBox Margin="10,5,10,10" Text="{Binding User.Name, Mode=TwoWay}" />
+ <TextBlock Text="City" Margin="10,10,10,0" FontSize="15" />
+ <TextBox Margin="10,5,10,10" Text="{Binding User.City, Mode=TwoWay}" />
+ <TextBlock Text="State / County" Margin="10,10,10,0" FontSize="15" />
+ <TextBox Margin="10,5,10,10" Text="{Binding User.State, Mode=TwoWay}" />
+ <Button HorizontalAlignment="Right" Content="register" Margin="10" Command="{Binding RegisterCommand}" />
+ </StackPanel>
+ </Grid>
+ </Grid>
+ </DataTemplate>
+
+
+ <DataTemplate x:Name="AddItemTemplate">
+ <Grid Background="{StaticResource PanelBackground}">
+ <StackPanel Margin="10">
+ <TextBlock Text="add item" Style="{StaticResource MediumText}" Margin="10,5,10,10" />
+ <TextBox x:Name="textNewItem" Text="{Binding NewItemText, Mode=TwoWay}" Width="300" Margin="10,5,10,10"/>
+ <Button Content="save" Command="{Binding AddItemCommand}" Margin="10,5,10,10" HorizontalAlignment="Right" />
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <DataTemplate x:Name="NewListTemplate">
+ <Grid Background="{StaticResource PanelBackground}">
+ <StackPanel Margin="10">
+ <TextBlock Text="create list" Style="{StaticResource MediumText}" Margin="10,5,10,10" />
+ <TextBox x:Name="textNewListName" Text="{Binding NewListName, Mode=TwoWay}" Width="300" Margin="10,5,10,10"/>
+ <Button Content="save" Command="{Binding NewListCommand}" Margin="10,5,10,10" HorizontalAlignment="Right"/>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+
+ <DataTemplate x:Name="ChooseListTemplate">
+ <StackPanel Background="{StaticResource PanelBackground}">
+ <ItemsControl x:Name="listsList" ItemsSource="{Binding Lists}">
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Button BorderThickness="0"
+ HorizontalAlignment="Stretch"
+ Command="{Binding ElementName=listsList, Path=DataContext.SelectListCommand}"
+ CommandParameter="{Binding}" HorizontalContentAlignment="Left">
+ <TextBlock Text="{Binding Name}" TextAlignment="Left" Style="{StaticResource MediumText}" HorizontalAlignment="Left"/>
+ </Button>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </StackPanel>
+ </DataTemplate>
+
+</ResourceDictionary>
View
52 samples/doto/C#/Common/ViewModel.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Doto
+{
+ /// <summary>
+ /// A base class for Doto's various view models
+ /// </summary>
+ public class ViewModel : INotifyPropertyChanged
+ {
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void OnPropertyChanged(string propertyName)
+ {
+ PropertyChangedEventHandler pceh = PropertyChanged;
+ if (pceh != null)
+ {
+ pceh(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+
+ /// <summary>
+ /// Set's the value of the target parameter (replacing the reference) if the value has changed. Also fires
+ /// a PropertyChanged event if the value has changed.
+ /// </summary>
+ /// <typeparam name="T">The type of the property</typeparam>
+ /// <param name="target">The target to be swapped out, if different to the value parameter</param>
+ /// <param name="value">The new value</param>
+ /// <param name="changedProperties">A list of properties whose value may have been impacted by this change and whose PropertyChanged event should be raised</param>
+ /// <returns>True if the value is changed, False otherwise</returns>
+ protected virtual bool SetValue<T>(ref T target, T value, params string[] changedProperties)
+ {
+ if (Object.Equals(target, value))
+ {
+ return false;
+ }
+
+ target = value;
+
+ foreach (string property in changedProperties)
+ {
+ OnPropertyChanged(property);
+ }
+
+ return true;
+ }
+ }
+}
View
15 samples/doto/C#/Controls/FadingImage.xaml
@@ -0,0 +1,15 @@
+<UserControl
+ x:Class="Doto.Controls.FadingImage"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:Doto.Controls"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d"
+ d:DesignHeight="300"
+ d:DesignWidth="400">
+ <Grid>
+ <Image x:Name="ImageA" Stretch="UniformToFill" />
+ <Image x:Name="ImageB" Stretch="UniformToFill" />
+ </Grid>
+</UserControl>
View
62 samples/doto/C#/Controls/FadingImage.xaml.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Media.Animation;
+using Windows.UI.Xaml.Navigation;
+
+namespace Doto.Controls
+{
+ /// <summary>
+ /// Simple user control to allow a data bound image to fade between images when changed
+ /// </summary>
+ public sealed partial class FadingImage : UserControl
+ {
+ public FadingImage()
+ {
+ this.InitializeComponent();
+ }
+
+ public ImageSource Source
+ {
+ get { return (ImageSource)GetValue(SourceProperty); }
+ set { SetValue(SourceProperty, value); }
+ }
+
+ public static readonly DependencyProperty SourceProperty =
+ DependencyProperty.Register("Source", typeof(ImageSource), typeof(FadingImage), new PropertyMetadata(default(ImageSource), SourceChanged));
+
+ private static void SourceChanged(DependencyObject source, DependencyPropertyChangedEventArgs args)
+ {
+ FadingImage instance = (FadingImage)source;
+ instance.ImageA.Source = (ImageSource)args.OldValue;
+ instance.ImageB.Source = (ImageSource)args.NewValue;
+ DoubleAnimation da = new DoubleAnimation();
+ da.From = 0;
+ da.To = 1;
+ da.Duration = new Duration(TimeSpan.FromMilliseconds(instance.TransitionMilliseconds));
+ Storyboard sb = new Storyboard();
+ Storyboard.SetTarget(da, instance.ImageB);
+ Storyboard.SetTargetProperty(da, "Opacity");
+ sb.Children.Add(da);
+ sb.Begin();
+ }
+
+ public int TransitionMilliseconds
+ {
+ get { return (int)GetValue(TransitionMillisecondsProperty); }
+ set { SetValue(TransitionMillisecondsProperty, value); }
+ }
+
+ public static readonly DependencyProperty TransitionMillisecondsProperty =
+ DependencyProperty.Register("TransitionMilliseconds", typeof(int), typeof(FadingImage), new PropertyMetadata(2000));
+ }
+}
View
63 samples/doto/C#/Controls/InviteUser.xaml
@@ -0,0 +1,63 @@
+<UserControl
+ x:Class="Doto.Controls.InviteUser"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:Doto.Controls"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d"
+ d:DesignHeight="300"
+ d:DesignWidth="400">
+
+ <Grid Background="{StaticResource PanelBackground}" MinHeight="700">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+ <StackPanel Margin="30,30,30,10">
+ <TextBlock Text="invite user" Style="{StaticResource MediumText}" Margin="10"/>
+ <TextBlock Style="{StaticResource SmallText}" Margin="10,20,10,20" TextWrapping="Wrap">
+You can invite other users to share this list with you. Once shared, the other user
+will have full permissions over the list, including the ability to share with others.
+ </TextBlock>
+ <TextBlock Text="search by name" Margin="10,10,10,0" Style="{StaticResource SmallText}" />
+ <Grid Margin="10,5,10,10">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+ <TextBox Text="{Binding SearchText, Mode=TwoWay}" Margin="0,0,10,0" />
+ <Button Grid.Column="1" Content="search" HorizontalAlignment="Right" Command="{Binding SearchCommand}" />
+ </Grid>
+ <Grid Margin="10,5,10,0" Visibility="{Binding ShowPageControls, Converter={StaticResource BoolToVisibilityConverter}}">
+ <Button HorizontalAlignment="Left" Command="{Binding PrevCommand}">prev</Button>
+ <Button HorizontalAlignment="Right" Command="{Binding NextCommand}">next</Button>
+ </Grid>
+ </StackPanel>
+ <ScrollViewer Grid.Row="1" Margin="30,0,30,30" VerticalScrollBarVisibility="Auto">
+ <StackPanel>
+
+ <ListView x:Name="UsersList" ItemsSource="{Binding Users}"
+ SelectionMode="None" Tapped="UsersList_Tapped" >
+ <ListView.ItemTemplate>
+ <DataTemplate>
+ <Grid>
+ <StackPanel Orientation="Horizontal" Margin="2">
+ <Border Width="50" Height="50" Background="#1777" Margin="3">
+ <Image Source="{Binding ImageUrl}" />
+ </Border>
+ <StackPanel Orientation="Vertical" Margin="5,0,0,0">
+ <TextBlock Margin="3" Style="{StaticResource MediumText}" Text="{Binding Name}" />
+ <TextBlock Style="{StaticResource SmallText}">
+ <Run Text="{Binding City}" /><Run Text=", " /><Run Text="{Binding State}" />
+ </TextBlock>
+ </StackPanel>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+ </ListView.ItemTemplate>
+ </ListView>
+ </StackPanel>
+ </ScrollViewer>
+ </Grid>
+</UserControl>
View
37 samples/doto/C#/Controls/InviteUser.xaml.cs
@@ -0,0 +1,37 @@
+using Doto.Model;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+namespace Doto.Controls
+{
+ public sealed partial class InviteUser : UserControl
+ {
+ public InviteUser()
+ {
+ this.InitializeComponent();
+ }
+
+ private void UsersList_Tapped(object sender, TappedRoutedEventArgs e)
+ {
+ var source = e.OriginalSource as FrameworkElement;
+ Profile user = source.DataContext as Profile;
+ if (user == null)
+ {
+ // didn't tap an item
+ return;
+ }
+ ((InviteUserViewModel)DataContext).InviteUser(user);
+ }
+ }
+}
View
45 samples/doto/C#/Controls/ViewInvites.xaml
@@ -0,0 +1,45 @@
+<UserControl
+ x:Class="Doto.Controls.ViewInvites"
+ xmlns="h