UWP Contacts Sample
|
@ -0,0 +1,40 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contacts", "Contacts\Contacts.csproj", "{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|ARM = Release|ARM
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Debug|x64.Build.0 = Debug|x64
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Debug|x86.Build.0 = Debug|x86
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Debug|x86.Deploy.0 = Debug|x86
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Release|ARM.Build.0 = Release|ARM
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Release|x64.ActiveCfg = Release|x64
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Release|x64.Build.0 = Release|x64
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Release|x64.Deploy.0 = Release|x64
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Release|x86.ActiveCfg = Release|x86
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Release|x86.Build.0 = Release|x86
|
||||
{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}.Release|x86.Deploy.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,23 @@
|
|||
<Application
|
||||
x:Class="Contacts.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:base="using:Contacts.ViewModels.Base"
|
||||
RequestedTheme="Light">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/Themes/Colors.xaml" />
|
||||
<ResourceDictionary Source="/Themes/Contacts.xaml" />
|
||||
<ResourceDictionary Source="/Themes/Converters.xaml" />
|
||||
<ResourceDictionary Source="/Themes/Fonts.xaml" />
|
||||
<ResourceDictionary Source="/Themes/Shell.xaml" />
|
||||
<ResourceDictionary Source="/Themes/ToggleButton.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!-- ViewModelLocator -->
|
||||
<base:ViewModelLocator x:Key="Locator" />
|
||||
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,99 @@
|
|||
using System;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using Contacts.Views;
|
||||
|
||||
namespace Contacts
|
||||
{
|
||||
/// <summary>
|
||||
/// Proporciona un comportamiento específico de la aplicación para complementar la clase Application predeterminada.
|
||||
/// </summary>
|
||||
sealed partial class App : Application
|
||||
{
|
||||
/// <summary>
|
||||
/// Inicializa el objeto de aplicación Singleton. Esta es la primera línea de código creado
|
||||
/// ejecutado y, como tal, es el equivalente lógico de main() o WinMain().
|
||||
/// </summary>
|
||||
public App()
|
||||
{
|
||||
Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
|
||||
Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
|
||||
Microsoft.ApplicationInsights.WindowsCollectors.Session);
|
||||
InitializeComponent();
|
||||
Suspending += OnSuspending;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Se invoca cuando el usuario final inicia la aplicación normalmente. Se usarán otros puntos
|
||||
/// de entrada cuando la aplicación se inicie para abrir un archivo específico, por ejemplo.
|
||||
/// </summary>
|
||||
/// <param name="e">Información detallada acerca de la solicitud y el proceso de inicio.</param>
|
||||
protected override void OnLaunched(LaunchActivatedEventArgs e)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
DebugSettings.EnableFrameRateCounter = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
Frame rootFrame = Window.Current.Content as Frame;
|
||||
|
||||
// No repetir la inicialización de la aplicación si la ventana tiene contenido todavía,
|
||||
// solo asegurarse de que la ventana está activa.
|
||||
if (rootFrame == null)
|
||||
{
|
||||
// Crear un marco para que actúe como contexto de navegación y navegar a la primera página.
|
||||
rootFrame = new Frame();
|
||||
|
||||
rootFrame.NavigationFailed += OnNavigationFailed;
|
||||
|
||||
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
|
||||
{
|
||||
//TODO: Cargar el estado de la aplicación suspendida previamente
|
||||
}
|
||||
|
||||
// Poner el marco en la ventana actual.
|
||||
Window.Current.Content = rootFrame;
|
||||
}
|
||||
|
||||
if (rootFrame.Content == null)
|
||||
{
|
||||
// Cuando no se restaura la pila de navegación, navegar a la primera página,
|
||||
// configurando la nueva página pasándole la información requerida como
|
||||
//parámetro de navegación
|
||||
rootFrame.Navigate(typeof(ShellView), e.Arguments);
|
||||
}
|
||||
// Asegurarse de que la ventana actual está activa.
|
||||
Window.Current.Activate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Se invoca cuando la aplicación la inicia normalmente el usuario final. Se usarán otros puntos
|
||||
/// </summary>
|
||||
/// <param name="sender">Marco que produjo el error de navegación</param>
|
||||
/// <param name="e">Detalles sobre el error de navegación</param>
|
||||
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
|
||||
{
|
||||
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Se invoca al suspender la ejecución de la aplicación. El estado de la aplicación se guarda
|
||||
/// sin saber si la aplicación se terminará o se reanudará con el contenido
|
||||
/// de la memoria aún intacto.
|
||||
/// </summary>
|
||||
/// <param name="sender">Origen de la solicitud de suspensión.</param>
|
||||
/// <param name="e">Detalles sobre la solicitud de suspensión.</param>
|
||||
private void OnSuspending(object sender, SuspendingEventArgs e)
|
||||
{
|
||||
var deferral = e.SuspendingOperation.GetDeferral();
|
||||
//TODO: Guardar el estado de la aplicación y detener toda actividad en segundo plano
|
||||
deferral.Complete();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ApplicationInsights xmlns = "http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
|
||||
</ApplicationInsights>
|
После Ширина: | Высота: | Размер: 1.4 KiB |
После Ширина: | Высота: | Размер: 7.5 KiB |
После Ширина: | Высота: | Размер: 2.9 KiB |
После Ширина: | Высота: | Размер: 1.6 KiB |
Двоичные данные
Contacts/Contacts/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
Normal file
После Ширина: | Высота: | Размер: 1.2 KiB |
После Ширина: | Высота: | Размер: 1.4 KiB |
После Ширина: | Высота: | Размер: 3.1 KiB |
|
@ -0,0 +1,40 @@
|
|||
namespace Contacts.Behaviors
|
||||
{
|
||||
using System.Windows.Input;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
public static class ItemClickCommandBehavior
|
||||
{
|
||||
public static readonly DependencyProperty CommandProperty =
|
||||
DependencyProperty.RegisterAttached("Command", typeof(ICommand),
|
||||
typeof(ItemClickCommandBehavior), new PropertyMetadata(null, OnCommandPropertyChanged));
|
||||
|
||||
public static void SetCommand(DependencyObject d, ICommand value)
|
||||
{
|
||||
d.SetValue(CommandProperty, value);
|
||||
}
|
||||
|
||||
public static ICommand GetCommand(DependencyObject d)
|
||||
{
|
||||
return (ICommand)d.GetValue(CommandProperty);
|
||||
}
|
||||
|
||||
private static void OnCommandPropertyChanged(DependencyObject d,
|
||||
DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var control = d as ListViewBase;
|
||||
if (control != null)
|
||||
control.ItemClick += OnItemClick;
|
||||
}
|
||||
|
||||
private static void OnItemClick(object sender, ItemClickEventArgs e)
|
||||
{
|
||||
var control = sender as ListViewBase;
|
||||
var command = GetCommand(control);
|
||||
|
||||
if (command != null && command.CanExecute(e.ClickedItem))
|
||||
command.Execute(e.ClickedItem);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,219 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProjectGuid>{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}</ProjectGuid>
|
||||
<OutputType>AppContainerExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Contacts</RootNamespace>
|
||||
<AssemblyName>Contacts</AssemblyName>
|
||||
<DefaultLanguage>es-ES</DefaultLanguage>
|
||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||
<TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
|
||||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<PackageCertificateKeyFile>Contacts_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\ARM\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
|
||||
<OutputPath>bin\ARM\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
|
||||
<Content Include="ApplicationInsights.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="project.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Behaviors\ItemClickCommandBehavior.cs" />
|
||||
<Compile Include="Converters\ToUpperCaseConverter.cs" />
|
||||
<Compile Include="Extensions\VisualTreeHelperExtensions.cs" />
|
||||
<Compile Include="Helpers\JumpListHelper.cs" />
|
||||
<Compile Include="Models\JumpListGroup.cs" />
|
||||
<Compile Include="Models\MenuItem.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\Contacts\ContactService.cs" />
|
||||
<Compile Include="Services\Contacts\IContactService.cs" />
|
||||
<Compile Include="ViewModels\AddContactViewModel.cs" />
|
||||
<Compile Include="ViewModels\Base\DelegateCommand.cs" />
|
||||
<Compile Include="ViewModels\Base\DelegateCommandAsync.cs" />
|
||||
<Compile Include="ViewModels\Base\ViewModelBase.cs" />
|
||||
<Compile Include="ViewModels\Base\ViewModelLocator.cs" />
|
||||
<Compile Include="ViewModels\ContactChangesViewModel.cs" />
|
||||
<Compile Include="ViewModels\ContactsViewModel.cs" />
|
||||
<Compile Include="ViewModels\PickViewModel.cs" />
|
||||
<Compile Include="ViewModels\ShellViewModel.cs" />
|
||||
<Compile Include="Views\AddContact.xaml.cs">
|
||||
<DependentUpon>AddContact.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Base\PageBase.cs" />
|
||||
<Compile Include="Views\ContactChangesView.xaml.cs">
|
||||
<DependentUpon>ContactChangesView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ContactsView.xaml.cs">
|
||||
<DependentUpon>ContactsView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\PickView.xaml.cs">
|
||||
<DependentUpon>PickView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ShellView.xaml.cs">
|
||||
<DependentUpon>ShellView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
<None Include="Contacts_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Properties\Default.rd.xml" />
|
||||
<Content Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Content Include="Assets\StoreLogo.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="Themes\Colors.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="Themes\Contacts.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="Themes\Converters.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Themes\Fonts.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Themes\Shell.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Themes\ToggleButton.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\AddContact.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ContactChangesView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ContactsView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\PickView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ShellView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -0,0 +1,18 @@
|
|||
namespace Contacts.Converters
|
||||
{
|
||||
using System;
|
||||
using Windows.UI.Xaml.Data;
|
||||
|
||||
public class ToUpperCaseConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
return string.Format("{0}", value).ToUpper();
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,370 @@
|
|||
namespace Contacts.Extensions
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for DependencyObjects
|
||||
/// used for walking the visual tree with
|
||||
/// LINQ expressions.
|
||||
/// These simplify using VisualTreeHelper to one line calls.
|
||||
/// </summary>
|
||||
public static class VisualTreeHelperExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the first descendant that is of the given type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns null if not found.
|
||||
/// </remarks>
|
||||
/// <typeparam name="T">Type of descendant to look for.</typeparam>
|
||||
/// <param name="start">The start object.</param>
|
||||
/// <returns></returns>
|
||||
public static T GetFirstDescendantOfType<T>(this DependencyObject start) where T : DependencyObject
|
||||
{
|
||||
return start.GetDescendantsOfType<T>().FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the descendants of the given type.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of descendants to return.</typeparam>
|
||||
/// <param name="start">The start.</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<T> GetDescendantsOfType<T>(this DependencyObject start) where T : DependencyObject
|
||||
{
|
||||
return start.GetDescendants().OfType<T>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the descendants.
|
||||
/// </summary>
|
||||
/// <param name="start">The start.</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<DependencyObject> GetDescendants(this DependencyObject start)
|
||||
{
|
||||
if (start == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
var queue = new Queue<DependencyObject>();
|
||||
|
||||
var popup = start as Popup;
|
||||
|
||||
if (popup != null)
|
||||
{
|
||||
if (popup.Child != null)
|
||||
{
|
||||
queue.Enqueue(popup.Child);
|
||||
yield return popup.Child;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var count = VisualTreeHelper.GetChildrenCount(start);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var child = VisualTreeHelper.GetChild(start, i);
|
||||
queue.Enqueue(child);
|
||||
yield return child;
|
||||
}
|
||||
}
|
||||
|
||||
while (queue.Count > 0)
|
||||
{
|
||||
var parent = queue.Dequeue();
|
||||
|
||||
popup = parent as Popup;
|
||||
|
||||
if (popup != null)
|
||||
{
|
||||
if (popup.Child != null)
|
||||
{
|
||||
queue.Enqueue(popup.Child);
|
||||
yield return popup.Child;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var count = VisualTreeHelper.GetChildrenCount(parent);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var child = VisualTreeHelper.GetChild(parent, i);
|
||||
yield return child;
|
||||
queue.Enqueue(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the child elements.
|
||||
/// </summary>
|
||||
/// <param name="parent">The parent element.</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<DependencyObject> GetChildren(this DependencyObject parent)
|
||||
{
|
||||
var popup = parent as Popup;
|
||||
|
||||
if (popup != null)
|
||||
{
|
||||
if (popup.Child != null)
|
||||
{
|
||||
yield return popup.Child;
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
var count = VisualTreeHelper.GetChildrenCount(parent);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var child = VisualTreeHelper.GetChild(parent, i);
|
||||
yield return child;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the child elements sorted in render order (by ZIndex first, declaration order second).
|
||||
/// </summary>
|
||||
/// <param name="parent">The parent element.</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<DependencyObject> GetChildrenByZIndex(
|
||||
this DependencyObject parent)
|
||||
{
|
||||
int i = 0;
|
||||
var indexedChildren =
|
||||
parent.GetChildren().Cast<FrameworkElement>().Select(
|
||||
child => new { Index = i++, ZIndex = Canvas.GetZIndex(child), Child = child });
|
||||
|
||||
return
|
||||
from indexedChild in indexedChildren
|
||||
orderby indexedChild.ZIndex, indexedChild.Index
|
||||
select indexedChild.Child;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the first ancestor that is of the given type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns null if not found.
|
||||
/// </remarks>
|
||||
/// <typeparam name="T">Type of ancestor to look for.</typeparam>
|
||||
/// <param name="start">The start.</param>
|
||||
/// <returns></returns>
|
||||
public static T GetFirstAncestorOfType<T>(this DependencyObject start) where T : DependencyObject
|
||||
{
|
||||
return start.GetAncestorsOfType<T>().FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ancestors of a given type, starting with parent and going towards the visual tree root.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of ancestor to look for.</typeparam>
|
||||
/// <param name="start">The start.</param>
|
||||
/// <returns>The ancestors of a given type, starting with parent and going towards the visual tree root.</returns>
|
||||
public static IEnumerable<T> GetAncestorsOfType<T>(this DependencyObject start) where T : DependencyObject
|
||||
{
|
||||
return start.GetAncestors().OfType<T>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ancestors, starting with parent and going towards the visual tree root.
|
||||
/// </summary>
|
||||
/// <param name="start">The starting element.</param>
|
||||
/// <returns>The ancestor elements, starting with parent and going towards the visual tree root.</returns>
|
||||
public static IEnumerable<DependencyObject> GetAncestors(this DependencyObject start)
|
||||
{
|
||||
var parent = VisualTreeHelper.GetParent(start);
|
||||
|
||||
while (parent != null)
|
||||
{
|
||||
yield return parent;
|
||||
parent = VisualTreeHelper.GetParent(parent);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the siblings, including the start element.
|
||||
/// </summary>
|
||||
/// <param name="start">The start element.</param>
|
||||
/// <returns>The siblings, including the start element.</returns>
|
||||
public static IEnumerable<DependencyObject> GetSiblings(this DependencyObject start)
|
||||
{
|
||||
var parent = VisualTreeHelper.GetParent(start);
|
||||
|
||||
if (parent == null)
|
||||
{
|
||||
yield return start;
|
||||
}
|
||||
else
|
||||
{
|
||||
var count = VisualTreeHelper.GetChildrenCount(parent);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var child = VisualTreeHelper.GetChild(parent, i);
|
||||
yield return child;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified DependencyObject is in visual tree.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Note that this might not work as expected if the object is in a popup.
|
||||
/// </remarks>
|
||||
/// <param name="dob">The DependencyObject.</param>
|
||||
/// <returns>
|
||||
/// <c>true</c> if the specified dob is in visual tree ; otherwise, <c>false</c>.
|
||||
/// </returns>
|
||||
public static bool IsInVisualTree(this DependencyObject dob)
|
||||
{
|
||||
if (DesignMode.DesignModeEnabled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//TODO: consider making it work with Popups too.
|
||||
if (Window.Current == null)
|
||||
{
|
||||
// This may happen when a picker or CameraCaptureUI etc. is open.
|
||||
return false;
|
||||
}
|
||||
|
||||
return Window.Current.Content != null && dob.GetAncestors().Contains(Window.Current.Content);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the position of the element.
|
||||
/// </summary>
|
||||
/// <param name="dob">The element.</param>
|
||||
/// <param name="origin">The relative (0..1,0..1 range) position of a point within the element to evaluate. Defaults to 0,0 for top-left corner.</param>
|
||||
/// <param name="relativeTo">The element of reference. Defaults to visual tree root.</param>
|
||||
/// <returns>The position of origin point relative to specified element.</returns>
|
||||
public static Point GetPosition(this FrameworkElement dob, Point origin = new Point(), FrameworkElement relativeTo = null)
|
||||
{
|
||||
if (DesignMode.DesignModeEnabled)
|
||||
{
|
||||
return new Point();
|
||||
}
|
||||
|
||||
if (relativeTo == null)
|
||||
{
|
||||
relativeTo = Window.Current.Content as FrameworkElement;
|
||||
}
|
||||
|
||||
if (relativeTo == null)
|
||||
{
|
||||
throw new InvalidOperationException("Element not in visual tree.");
|
||||
}
|
||||
|
||||
var absoluteOrigin = new Point(relativeTo.ActualWidth * origin.X, relativeTo.ActualHeight * origin.X);
|
||||
|
||||
if (dob == relativeTo)
|
||||
{
|
||||
return absoluteOrigin;
|
||||
}
|
||||
|
||||
var ancestors = dob.GetAncestors().ToArray();
|
||||
|
||||
if (!ancestors.Contains(relativeTo))
|
||||
{
|
||||
throw new InvalidOperationException("Element not in visual tree.");
|
||||
}
|
||||
|
||||
return
|
||||
dob
|
||||
.TransformToVisual(relativeTo)
|
||||
.TransformPoint(absoluteOrigin);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the bounding rectangle of a given element
|
||||
/// relative to a given other element or visual root
|
||||
/// if relativeTo is null or not specified.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Note that the bounding box is calculated based on the corners of the element relative to itself,
|
||||
/// so e.g. a bounding box of a rotated ellipse will be larger than necessary and in general
|
||||
/// bounding boxes of elements with transforms applied to them will often be calculated incorrectly.
|
||||
/// </remarks>
|
||||
/// <param name="dob">The starting element.</param>
|
||||
/// <param name="relativeTo">The relative to element.</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="System.InvalidOperationException">Element not in visual tree.</exception>
|
||||
public static Rect GetBoundingRect(this FrameworkElement dob, FrameworkElement relativeTo = null)
|
||||
{
|
||||
if (DesignMode.DesignModeEnabled)
|
||||
{
|
||||
return Rect.Empty;
|
||||
}
|
||||
|
||||
if (relativeTo == null)
|
||||
{
|
||||
relativeTo = Window.Current.Content as FrameworkElement;
|
||||
}
|
||||
|
||||
if (relativeTo == null)
|
||||
{
|
||||
throw new InvalidOperationException("Element not in visual tree.");
|
||||
}
|
||||
|
||||
if (dob == relativeTo)
|
||||
{
|
||||
return new Rect(0, 0, relativeTo.ActualWidth, relativeTo.ActualHeight);
|
||||
}
|
||||
|
||||
var ancestors = dob.GetAncestors().ToArray();
|
||||
|
||||
if (!ancestors.Contains(relativeTo))
|
||||
{
|
||||
throw new InvalidOperationException("Element not in visual tree.");
|
||||
}
|
||||
|
||||
var topLeft =
|
||||
dob
|
||||
.TransformToVisual(relativeTo)
|
||||
.TransformPoint(new Point());
|
||||
var topRight =
|
||||
dob
|
||||
.TransformToVisual(relativeTo)
|
||||
.TransformPoint(
|
||||
new Point(
|
||||
dob.ActualWidth,
|
||||
0));
|
||||
var bottomLeft =
|
||||
dob
|
||||
.TransformToVisual(relativeTo)
|
||||
.TransformPoint(
|
||||
new Point(
|
||||
0,
|
||||
dob.ActualHeight));
|
||||
var bottomRight =
|
||||
dob
|
||||
.TransformToVisual(relativeTo)
|
||||
.TransformPoint(
|
||||
new Point(
|
||||
dob.ActualWidth,
|
||||
dob.ActualHeight));
|
||||
|
||||
var minX = new[] { topLeft.X, topRight.X, bottomLeft.X, bottomRight.X }.Min();
|
||||
var maxX = new[] { topLeft.X, topRight.X, bottomLeft.X, bottomRight.X }.Max();
|
||||
var minY = new[] { topLeft.Y, topRight.Y, bottomLeft.Y, bottomRight.Y }.Min();
|
||||
var maxY = new[] { topLeft.Y, topRight.Y, bottomLeft.Y, bottomRight.Y }.Max();
|
||||
|
||||
return new Rect(minX, minY, maxX - minX, maxY - minY);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Windows.Globalization.Collation;
|
||||
using Contacts.Models;
|
||||
|
||||
namespace Contacts.Helpers
|
||||
{
|
||||
public static class JumpListHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Groups and sorts into a list of group lists based on a selector.
|
||||
/// </summary>
|
||||
/// <typeparam name="TSource">Type of the items in the list.</typeparam>
|
||||
/// <typeparam name="TSort">Type of value returned by sortSelector.</typeparam>
|
||||
/// <typeparam name="TGroup">Type of value returned by groupSelector.</typeparam>
|
||||
/// <param name="source">List to be grouped and sorted</param>
|
||||
/// <param name="sortSelector">A selector that provides the value that items will be sorted by.</param>
|
||||
/// <param name="groupSelector">A selector that provides the value that items will be grouped by.</param>
|
||||
/// <param name="isSortDescending">Value indicating to sort groups in reverse. Items in group will still sort ascending.</param>
|
||||
/// <returns>A list of JumpListGroups.</returns>
|
||||
public static List<JumpListGroup<TSource>> ToGroups<TSource, TSort, TGroup>(
|
||||
this IEnumerable<TSource> source, Func<TSource, TSort> sortSelector,
|
||||
Func<TSource, TGroup> groupSelector, bool isSortDescending = false)
|
||||
{
|
||||
var groups = new List<JumpListGroup<TSource>>();
|
||||
|
||||
// Group and sort items based on values returned from the selectors
|
||||
var query = from item in source
|
||||
orderby groupSelector(item), sortSelector(item)
|
||||
group item by groupSelector(item) into g
|
||||
select new { GroupName = g.Key, Items = g };
|
||||
|
||||
// For each group generated from the query, create a JumpListGroup
|
||||
// and fill it with its items
|
||||
foreach (var g in query)
|
||||
{
|
||||
JumpListGroup<TSource> group = new JumpListGroup<TSource>();
|
||||
group.Key = g.GroupName;
|
||||
@group.AddRange(g.Items.Select(item => (object)item));
|
||||
|
||||
if (isSortDescending)
|
||||
groups.Insert(0, group);
|
||||
else
|
||||
groups.Add(group);
|
||||
}
|
||||
|
||||
return groups;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Groups and sorts into a list of alpha groups based on a string selector.
|
||||
/// </summary>
|
||||
/// <typeparam name="TSource">Type of the items in the list.</typeparam>
|
||||
/// <param name="source">List to be grouped and sorted.</param>
|
||||
/// <param name="selector">A selector that will provide a value that items to be sorted and grouped by.</param>
|
||||
/// <returns>A list of JumpListGroups.</returns>
|
||||
public static List<JumpListGroup<TSource>> ToAlphaGroups<TSource>(
|
||||
this IEnumerable<TSource> source, Func<TSource, string> selector)
|
||||
{
|
||||
// Get the letters representing each group for current language using CharacterGroupings class
|
||||
var characterGroupings = new CharacterGroupings();
|
||||
|
||||
// Create dictionary for the letters and replace '...' with proper globe icon
|
||||
var keys = characterGroupings.Where(x => x.Label.Any())
|
||||
.Select(x => x.Label)
|
||||
.ToDictionary(x => x);
|
||||
keys["..."] = "\uD83C\uDF10";
|
||||
|
||||
// Create groups for each letters
|
||||
var groupDictionary = keys.Select(x => new JumpListGroup<TSource>() { Key = x.Value })
|
||||
.ToDictionary(x => (string)x.Key);
|
||||
|
||||
// Sort and group items into the groups based on the value returned by the selector
|
||||
var query = from item in source
|
||||
orderby selector(item)
|
||||
select item;
|
||||
|
||||
foreach (var item in query)
|
||||
{
|
||||
var sortValue = selector(item);
|
||||
groupDictionary[keys[characterGroupings.Lookup(sortValue)]].Add(item);
|
||||
}
|
||||
|
||||
return groupDictionary.Select(x => x.Value).ToList();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Contacts.Models
|
||||
{
|
||||
public class JumpListGroup<T> : List<object>
|
||||
{
|
||||
/// <summary>
|
||||
/// Key that represents the group of objects and used as group header.
|
||||
/// </summary>
|
||||
public object Key { get; set; }
|
||||
|
||||
public new IEnumerator<object> GetEnumerator()
|
||||
{
|
||||
return base.GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
namespace Contacts.Models
|
||||
{
|
||||
using System;
|
||||
|
||||
public class MenuItem
|
||||
{
|
||||
public string Icon { get; set; }
|
||||
public string Title { get; set; }
|
||||
public Type View { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
IgnorableNamespaces="uap mp">
|
||||
|
||||
<Identity
|
||||
Name="2dc66bc2-a821-449f-a711-932f4b081444"
|
||||
Publisher="CN=javie"
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="2dc66bc2-a821-449f-a711-932f4b081444" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Properties>
|
||||
<DisplayName>Contacts</DisplayName>
|
||||
<PublisherDisplayName>javie</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App"
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="Contacts.App">
|
||||
<uap:VisualElements
|
||||
DisplayName="Contacts"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png"
|
||||
Description="Contacts"
|
||||
BackgroundColor="transparent">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
<uap:Capability Name="contacts"/>
|
||||
</Capabilities>
|
||||
</Package>
|
|
@ -0,0 +1,29 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Contacts")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Contacts")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: ComVisible(false)]
|
|
@ -0,0 +1,30 @@
|
|||
<!--
|
||||
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
|
||||
developers. However, you can modify these parameters to modify the behavior of the .NET Native
|
||||
optimizer.
|
||||
|
||||
Runtime Directives are documented at http://go.microsoft.com/fwlink/?LinkID=391919
|
||||
|
||||
To fully enable reflection for App1.MyClass and all of its public/private members
|
||||
<Type Name="App1.MyClass" Dynamic="Required All"/>
|
||||
|
||||
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
|
||||
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
|
||||
|
||||
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
|
||||
<Namespace Name="DataClasses.ViewModels" Seralize="All" />
|
||||
-->
|
||||
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
|
||||
<Application>
|
||||
<!--
|
||||
An Assembly element with Name="*Application*" applies to all assemblies in
|
||||
the application package. The asterisks are not wildcards.
|
||||
-->
|
||||
<Assembly Name="*Application*" Dynamic="Required All"/>
|
||||
|
||||
|
||||
<!-- Add your application specific runtime directives here. -->
|
||||
|
||||
|
||||
</Application>
|
||||
</Directives>
|
|
@ -0,0 +1,151 @@
|
|||
namespace Contacts.Services.Contacts
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.ApplicationModel.Contacts;
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.ViewManagement;
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
public class ContactService : IContactService
|
||||
{
|
||||
public async Task<List<Contact>> GetContactCollection()
|
||||
{
|
||||
ContactStore allAccessStore = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AllContactsReadOnly);
|
||||
|
||||
// All available contacts
|
||||
var contacts = await allAccessStore.FindContactsAsync();
|
||||
|
||||
return contacts.ToList();
|
||||
}
|
||||
|
||||
public async Task<Contact> PickContactPhone()
|
||||
{
|
||||
ContactPicker contactPicker = new ContactPicker();
|
||||
contactPicker.DesiredFieldsWithContactFieldType.Add(ContactFieldType.PhoneNumber);
|
||||
|
||||
var contact = await contactPicker.PickContactAsync();
|
||||
|
||||
return contact;
|
||||
}
|
||||
|
||||
public async Task<Contact> PickContactEmail()
|
||||
{
|
||||
ContactPicker contactPicker = new ContactPicker();
|
||||
contactPicker.DesiredFieldsWithContactFieldType.Add(ContactFieldType.Email);
|
||||
|
||||
var contact = await contactPicker.PickContactAsync();
|
||||
|
||||
return contact;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Contact>> PickContactsEmail()
|
||||
{
|
||||
ContactPicker contactPicker = new ContactPicker();
|
||||
contactPicker.DesiredFieldsWithContactFieldType.Add(ContactFieldType.Email);
|
||||
|
||||
var contacts = await contactPicker.PickContactsAsync();
|
||||
|
||||
return contacts;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Contact>> PickContactsPhone()
|
||||
{
|
||||
ContactPicker contactPicker = new ContactPicker();
|
||||
contactPicker.DesiredFieldsWithContactFieldType.Add(ContactFieldType.PhoneNumber);
|
||||
|
||||
var contacts = await contactPicker.PickContactsAsync();
|
||||
|
||||
return contacts;
|
||||
}
|
||||
|
||||
public void ShowContactCardMini(Contact contact, FrameworkElement element)
|
||||
{
|
||||
if (contact != null)
|
||||
{
|
||||
Rect rect = GetElementRect(element);
|
||||
|
||||
// Show with default placement.
|
||||
ContactManager.ShowContactCard(contact, rect);
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowContactCardFull(Contact contact)
|
||||
{
|
||||
if (contact != null)
|
||||
{
|
||||
// Try to share the screen half/half with the full contact card.
|
||||
FullContactCardOptions options = new FullContactCardOptions
|
||||
{
|
||||
DesiredRemainingView = ViewSizePreference.UseHalf
|
||||
};
|
||||
|
||||
// Show the full contact card.
|
||||
ContactManager.ShowFullContactCard(contact, options);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task InserNewContact(string firstName, string lastName, string phone, string email)
|
||||
{
|
||||
var contactInfo = new Contact
|
||||
{
|
||||
FirstName = firstName,
|
||||
LastName = lastName
|
||||
};
|
||||
|
||||
contactInfo.Phones.Add(new ContactPhone() { Number = phone });
|
||||
contactInfo.Emails.Add(new ContactEmail() { Address = email });
|
||||
|
||||
ContactStore allAccessStore = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AllContactsReadOnly);
|
||||
var contactLists = await allAccessStore.FindContactListsAsync();
|
||||
|
||||
string contactListId = string.Empty;
|
||||
|
||||
if (contactLists.Count != 0)
|
||||
{
|
||||
contactListId = contactLists.FirstOrDefault().Id;
|
||||
return;
|
||||
}
|
||||
|
||||
var contactList = await allAccessStore.GetContactListAsync(contactListId);
|
||||
|
||||
await contactList.SaveContactAsync(contactInfo);
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteContact(Contact contact)
|
||||
{
|
||||
try
|
||||
{
|
||||
ContactStore allAccessStore =
|
||||
await ContactManager.RequestStoreAsync(ContactStoreAccessType.AllContactsReadOnly);
|
||||
var contactLists = await allAccessStore.FindContactListsAsync();
|
||||
|
||||
string contactListId = string.Empty;
|
||||
if (contactLists.Count != 0)
|
||||
{
|
||||
contactListId = contactLists.FirstOrDefault().Id;
|
||||
return false;
|
||||
}
|
||||
|
||||
var contactList = await allAccessStore.GetContactListAsync(contactListId);
|
||||
await contactList.DeleteContactAsync(contact);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public Rect GetElementRect(FrameworkElement element)
|
||||
{
|
||||
Windows.UI.Xaml.Media.GeneralTransform buttonTransform = element.TransformToVisual(null);
|
||||
Point point = buttonTransform.TransformPoint(new Point());
|
||||
return new Rect(point, new Size(element.ActualWidth, element.ActualHeight));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
namespace Contacts.Services.Contacts
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.ApplicationModel.Contacts;
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
public interface IContactService
|
||||
{
|
||||
Task<List<Contact>> GetContactCollection();
|
||||
Task<Contact> PickContactPhone();
|
||||
Task<Contact> PickContactEmail();
|
||||
Task<IEnumerable<Contact>> PickContactsEmail();
|
||||
Task<IEnumerable<Contact>> PickContactsPhone();
|
||||
void ShowContactCardMini(Contact contact, FrameworkElement element);
|
||||
void ShowContactCardFull(Contact contact);
|
||||
Task InserNewContact(string firstName, string lastName, string phone, string email);
|
||||
Task<bool> DeleteContact(Contact contact);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Color x:Key="WhiteColor">#FFF</Color>
|
||||
<SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource WhiteColor}"/>
|
||||
|
||||
<Color x:Key="BlackColor">#000</Color>
|
||||
<SolidColorBrush x:Key="BlackBrush" Color="{StaticResource BlackColor}"/>
|
||||
|
||||
<Color x:Key="BackgroundColor">#F7F7F7</Color>
|
||||
<SolidColorBrush x:Key="BackgroundBrush" Color="{StaticResource BackgroundColor}"/>
|
||||
|
||||
<Color x:Key="MenuBackgroundColor">#34323F</Color>
|
||||
<SolidColorBrush x:Key="MenuBackgroundBrush" Color="{StaticResource MenuBackgroundColor}"/>
|
||||
|
||||
<Color x:Key="SelectedColor">#3F3F46</Color>
|
||||
<SolidColorBrush x:Key="SelectedBrush" Color="{StaticResource SelectedColor}"/>
|
||||
|
||||
</ResourceDictionary>
|
|
@ -0,0 +1,167 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<DataTemplate x:Key="ContactTemplate">
|
||||
<Grid>
|
||||
<TextBlock
|
||||
Text="{Binding FullName}"
|
||||
FontSize="{StaticResource FontSizeMedium}"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0, 12, 0, 0"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<JumpListItemBackgroundConverter x:Key="JumpListItemBackgroundConverter" />
|
||||
<JumpListItemForegroundConverter x:Key="JumpListItemForegroundConverter" />
|
||||
|
||||
<Thickness x:Key="JumpListItemBorderThickness">0</Thickness>
|
||||
<Thickness x:Key="AlphaJumpListGroupTextMargin">5.5,0,0,9.5</Thickness>
|
||||
<Thickness x:Key="JumpListItemTextMargin">9.5,0,0,9.5</Thickness>
|
||||
|
||||
<SolidColorBrush x:Key="JumpListItemBackgroundBrush"
|
||||
Color="{ThemeResource SystemColorControlAccentColor}" />
|
||||
<SolidColorBrush x:Key="JumpListItemTextForegroundBrush"
|
||||
Color="White" />
|
||||
|
||||
<Style x:Key="AlphaJumpListStyle"
|
||||
TargetType="SemanticZoom">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="SemanticZoom">
|
||||
<Grid>
|
||||
<Border BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Background="{TemplateBinding Background}">
|
||||
<Grid Margin="{TemplateBinding Padding}">
|
||||
<ContentPresenter x:Name="ZoomedInPresenter"
|
||||
Content="{TemplateBinding ZoomedInView}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
<Popup x:Name="Popup">
|
||||
<Popup.ChildTransitions>
|
||||
<TransitionCollection>
|
||||
<PopupThemeTransition />
|
||||
</TransitionCollection>
|
||||
</Popup.ChildTransitions>
|
||||
<Grid>
|
||||
<Rectangle Fill="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Opacity=".67" />
|
||||
<Border x:Name="PopupBorder">
|
||||
<Viewbox Stretch="Uniform"
|
||||
VerticalAlignment="Top">
|
||||
<ContentPresenter x:Name="ZoomedOutPresenter"
|
||||
Height="625"
|
||||
Width="364"
|
||||
Content="{TemplateBinding ZoomedOutView}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Margin="19,15,0,-57.5" />
|
||||
</Viewbox>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<DataTemplate x:Key="AlphaGroupHeaderTemplate">
|
||||
<Border Background="{ThemeResource JumpListItemBackgroundBrush}"
|
||||
BorderBrush="{ThemeResource JumpListItemBackgroundBrush}"
|
||||
BorderThickness="{ThemeResource JumpListItemBorderThickness}"
|
||||
Width="49.5"
|
||||
Height="49.5"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,0,0,9.5">
|
||||
<TextBlock Text="{Binding Key}"
|
||||
Foreground="{ThemeResource JumpListItemTextForegroundBrush}"
|
||||
FontSize="39"
|
||||
TextLineBounds="Tight"
|
||||
OpticalMarginAlignment="TrimSideBearings"
|
||||
IsColorFontEnabled="False"
|
||||
IsTextScaleFactorEnabled="False"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Bottom"
|
||||
Margin="{ThemeResource AlphaJumpListGroupTextMargin}" />
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
<Style x:Key="JumpListListHeaderContainerStyle"
|
||||
TargetType="ListViewHeaderItem">
|
||||
<Setter Property="HorizontalContentAlignment"
|
||||
Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment"
|
||||
Value="Stretch" />
|
||||
</Style>
|
||||
|
||||
<DataTemplate x:Key="AlphaJumpListPickerItemTemplate">
|
||||
<Border Background="{Binding Converter={StaticResource JumpListItemBackgroundConverter}}"
|
||||
BorderBrush="{Binding Converter={StaticResource JumpListItemForegroundConverter}}"
|
||||
BorderThickness="{ThemeResource JumpListItemBorderThickness}"
|
||||
Height="59"
|
||||
Width="59"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,0,9.5,9.5">
|
||||
<TextBlock Text="{Binding Group.Key}"
|
||||
Foreground="{Binding Converter={StaticResource JumpListItemForegroundConverter}}"
|
||||
FontSize="32"
|
||||
FontWeight="SemiBold"
|
||||
TextLineBounds="Tight"
|
||||
OpticalMarginAlignment="TrimSideBearings"
|
||||
IsColorFontEnabled="False"
|
||||
IsTextScaleFactorEnabled="False"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Bottom"
|
||||
Margin="{ThemeResource JumpListItemTextMargin}" />
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
<Style x:Key="AlphaJumpListPickerStyle"
|
||||
TargetType="GridView">
|
||||
<Setter Property="ItemTemplate"
|
||||
Value="{StaticResource AlphaJumpListPickerItemTemplate}" />
|
||||
<Setter Property="ItemContainerStyle">
|
||||
<Setter.Value>
|
||||
<Style TargetType="GridViewItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="GridViewItem">
|
||||
<Border x:Name="TiltContainer">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<PointerDownThemeAnimation Storyboard.TargetName="TiltContainer" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualStateGroup.Transitions>
|
||||
<VisualTransition From="Pressed"
|
||||
To="Normal">
|
||||
<Storyboard>
|
||||
<PointerUpThemeAnimation Storyboard.TargetName="TiltContainer" />
|
||||
</Storyboard>
|
||||
</VisualTransition>
|
||||
</VisualStateGroup.Transitions>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ContentPresenter ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Content="{TemplateBinding Content}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Margin="{TemplateBinding Padding}" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
|
@ -0,0 +1,9 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="using:Contacts.Converters">
|
||||
|
||||
<!-- Converters -->
|
||||
<converters:ToUpperCaseConverter x:Key="ToUpperCaseConverter" />
|
||||
|
||||
</ResourceDictionary>
|
|
@ -0,0 +1,14 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<!-- Font Sizes -->
|
||||
<x:Double x:Key="FontSizeExtraSmall">12</x:Double>
|
||||
<x:Double x:Key="FontSizeMoreSmall">16</x:Double>
|
||||
<x:Double x:Key="FontSizeSmall">20</x:Double>
|
||||
<x:Double x:Key="FontSizeMedium">24</x:Double>
|
||||
<x:Double x:Key="FontSizeLarge">30</x:Double>
|
||||
<x:Double x:Key="FontSizeMoreLarge">36</x:Double>
|
||||
<x:Double x:Key="FontSizeExtraLarge">40</x:Double>
|
||||
|
||||
</ResourceDictionary>
|
|
@ -0,0 +1,58 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<DataTemplate x:Key="MenuItemDataTemplate">
|
||||
<Grid
|
||||
Width="250">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
Background="Transparent"
|
||||
Width="40"
|
||||
Height="40">
|
||||
<FontIcon
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Foreground="{StaticResource WhiteBrush}"
|
||||
Glyph="{Binding Icon}" />
|
||||
</Border>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Text="{Binding Title, Converter={StaticResource ToUpperCaseConverter}}"
|
||||
Foreground="{StaticResource WhiteBrush}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="10, 0" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<Style x:Key="BigUserStyle" TargetType="Ellipse">
|
||||
<Setter Property="Height" Value="125" />
|
||||
<Setter Property="Width" Value="125" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SmallUserStyle" TargetType="Ellipse">
|
||||
<Setter Property="Height" Value="40" />
|
||||
<Setter Property="Width" Value="40" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="Margin" Value="10, 12, 10, 0" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="UserNameStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontWeight" Value="SemiBold" />
|
||||
<Setter Property="FontSize" Value="{StaticResource FontSizeMedium}" />
|
||||
<Setter Property="Foreground" Value="{StaticResource WhiteBrush}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CloseSessionStyle" TargetType="HyperlinkButton">
|
||||
<Setter Property="FontWeight" Value="SemiLight" />
|
||||
<Setter Property="FontSize" Value="{StaticResource FontSizeExtraSmall}" />
|
||||
<Setter Property="Foreground" Value="{StaticResource WhiteBrush}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
|
@ -0,0 +1,107 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Style x:Key="SymbolButton" TargetType="ToggleButton">
|
||||
<Setter Property="Background" Value="{ThemeResource ToggleButtonBackgroundThemeBrush}"/>
|
||||
<Setter Property="Foreground" Value="{ThemeResource ToggleButtonForegroundThemeBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource ToggleButtonBorderThemeBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="{ThemeResource ToggleButtonBorderThemeThickness}"/>
|
||||
<Setter Property="Padding" Value="12,4,12,5"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal"/>
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SelectedBrush}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonDisabledForegroundThemeBrush}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Checked">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SelectedBrush}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="CheckedPointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SelectedBrush}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="CheckedPressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SelectedBrush}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="CheckedDisabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonCheckedDisabledForegroundThemeBrush}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Indeterminate"/>
|
||||
<VisualState x:Name="IndeterminatePointerOver">
|
||||
</VisualState>
|
||||
<VisualState x:Name="IndeterminatePressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonPressedForegroundThemeBrush}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="IndeterminateDisabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonDisabledForegroundThemeBrush}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualWhite"/>
|
||||
<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualBlack"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused"/>
|
||||
<VisualState x:Name="PointerFocused"/>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
<Rectangle x:Name="FocusVisualWhite" IsHitTestVisible="False" Opacity="0" StrokeDashOffset="1.5" StrokeEndLineCap="Square" Stroke="{ThemeResource FocusVisualWhiteStrokeThemeBrush}" StrokeDashArray="1,1"/>
|
||||
<Rectangle x:Name="FocusVisualBlack" IsHitTestVisible="False" Opacity="0" StrokeDashOffset="0.5" StrokeEndLineCap="Square" Stroke="{ThemeResource FocusVisualBlackStrokeThemeBrush}" StrokeDashArray="1,1"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
|
@ -0,0 +1,19 @@
|
|||
namespace Contacts.ViewModels
|
||||
{
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using Base;
|
||||
|
||||
public class AddContactViewModel : ViewModelBase
|
||||
{
|
||||
public override Task OnNavigatedFrom(NavigationEventArgs args)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override Task OnNavigatedTo(NavigationEventArgs args)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,131 @@
|
|||
namespace Contacts.ViewModels.Base
|
||||
{
|
||||
using System;
|
||||
using System.Windows.Input;
|
||||
|
||||
/// <summary>
|
||||
/// This class allows us to delegate command execution to viewmodels.
|
||||
/// </summary>
|
||||
public class DelegateCommand : ICommand
|
||||
{
|
||||
private readonly Action _execute;
|
||||
private readonly Func<bool> _canExecute;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor not using canExecute.
|
||||
/// </summary>
|
||||
/// <param name="execute"></param>
|
||||
public DelegateCommand(Action execute) : this(execute, null) { }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor using both execute and canExecute.
|
||||
/// </summary>
|
||||
/// <param name="execute"></param>
|
||||
/// <param name="canExecute"></param>
|
||||
public DelegateCommand(Action execute, Func<bool> canExecute)
|
||||
{
|
||||
_execute = execute;
|
||||
_canExecute = canExecute;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is called from XAML to evaluate if the command can be executed.
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns></returns>
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
if (_canExecute != null)
|
||||
return _canExecute();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is called from XAML to execute the command.
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
_execute();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method allow us to force the execution of CanExecute method to reevaluate execution.
|
||||
/// </summary>
|
||||
public void RaiseCanExecuteChanged()
|
||||
{
|
||||
var tmpHandle = CanExecuteChanged;
|
||||
if (tmpHandle != null)
|
||||
tmpHandle(this, new EventArgs());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This event notify XAML controls using the command to reevaluate the CanExecute of it.
|
||||
/// </summary>
|
||||
public event EventHandler CanExecuteChanged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class allows us to delegate command execution to viewmodels using a T type as parameter.
|
||||
/// </summary>
|
||||
public class DelegateCommand<T> : ICommand
|
||||
{
|
||||
private readonly Action<T> _execute;
|
||||
private readonly Func<T, bool> _canExecute;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor not using canExecute.
|
||||
/// </summary>
|
||||
/// <param name="execute"></param>
|
||||
public DelegateCommand(Action<T> execute) : this(execute, null) { }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor using both execute and canExecute.
|
||||
/// </summary>
|
||||
/// <param name="execute"></param>
|
||||
/// <param name="canExecute"></param>
|
||||
public DelegateCommand(Action<T> execute, Func<T, bool> canExecute)
|
||||
{
|
||||
_execute = execute;
|
||||
_canExecute = canExecute;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is called from XAML to evaluate if the command can be executed.
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns></returns>
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
if (_canExecute != null)
|
||||
return _canExecute((T)parameter);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is called from XAML to execute the command.
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
_execute((T)parameter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method allow us to force the execution of CanExecute method to reevaluate execution.
|
||||
/// </summary>
|
||||
public void RaiseCanExecuteChanged()
|
||||
{
|
||||
var tmpHandle = CanExecuteChanged;
|
||||
if (tmpHandle != null)
|
||||
tmpHandle(this, new EventArgs());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This event notify XAML controls using the command to reevaluate the CanExecute of it.
|
||||
/// </summary>
|
||||
public event EventHandler CanExecuteChanged;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
namespace Contacts.ViewModels.Base
|
||||
{
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
/// <summary>
|
||||
/// This class allows us to delegate command execution to viewmodels.
|
||||
/// This version of the command allow to use async/await.
|
||||
/// </summary>
|
||||
public class DelegateCommandAsync : ICommand
|
||||
{
|
||||
private readonly Func<Task<bool>> _canExecute;
|
||||
private readonly Func<Task> _execute;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor not using canExecute.
|
||||
/// </summary>
|
||||
/// <param name="execute"></param>
|
||||
public DelegateCommandAsync(Func<Task> execute) : this(execute, null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor using both execute and canExecute.
|
||||
/// </summary>
|
||||
/// <param name="execute"></param>
|
||||
/// <param name="canExecute"></param>
|
||||
public DelegateCommandAsync(Func<Task> execute, Func<Task<bool>> canExecute)
|
||||
{
|
||||
_execute = execute;
|
||||
_canExecute = canExecute;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is called from XAML to evaluate if the command can be executed.
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns></returns>
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
if (_canExecute != null)
|
||||
return _canExecute().Result;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is called from XAML to execute the command.
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
_execute();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This event notify XAML controls using the command to reevaluate the CanExecute of it.
|
||||
/// </summary>
|
||||
public event EventHandler CanExecuteChanged;
|
||||
|
||||
/// <summary>
|
||||
/// This method allow us to force the execution of CanExecute method to reevaluate execution.
|
||||
/// </summary>
|
||||
public void RaiseCanExecuteChanged()
|
||||
{
|
||||
EventHandler tmpHandle = CanExecuteChanged;
|
||||
if (tmpHandle != null)
|
||||
tmpHandle(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class allows us to delegate command execution to viewmodels using a T type as parameter.
|
||||
/// </summary>
|
||||
public class DelegateCommandAsync<T> : ICommand
|
||||
{
|
||||
private readonly Func<T, Task<bool>> _canExecute;
|
||||
private readonly Func<T, Task> _execute;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor not using canExecute.
|
||||
/// </summary>
|
||||
/// <param name="execute"></param>
|
||||
public DelegateCommandAsync(Func<T, Task> execute) : this(execute, null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor using both execute and canExecute.
|
||||
/// </summary>
|
||||
/// <param name="execute"></param>
|
||||
/// <param name="canExecute"></param>
|
||||
public DelegateCommandAsync(Func<T, Task> execute, Func<T, Task<bool>> canExecute)
|
||||
{
|
||||
_execute = execute;
|
||||
_canExecute = canExecute;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is called from XAML to evaluate if the command can be executed.
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns></returns>
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
if (_canExecute != null)
|
||||
return _canExecute((T) parameter).Result;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is called from XAML to execute the command.
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
_execute((T) parameter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This event notify XAML controls using the command to reevaluate the CanExecute of it.
|
||||
/// </summary>
|
||||
public event EventHandler CanExecuteChanged;
|
||||
|
||||
/// <summary>
|
||||
/// This method allow us to force the execution of CanExecute method to reevaluate execution.
|
||||
/// </summary>
|
||||
public void RaiseCanExecuteChanged()
|
||||
{
|
||||
EventHandler tmpHandle = CanExecuteChanged;
|
||||
if (tmpHandle != null)
|
||||
tmpHandle(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
namespace Contacts.ViewModels.Base
|
||||
{
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
public abstract class ViewModelBase : INotifyPropertyChanged
|
||||
{
|
||||
private Frame _appFrame;
|
||||
private Frame _splitViewFrame;
|
||||
private bool _isBusy;
|
||||
|
||||
public Frame AppFrame => _appFrame;
|
||||
|
||||
public Frame SplitViewFrame => _splitViewFrame;
|
||||
|
||||
public bool IsBusy
|
||||
{
|
||||
get { return _isBusy; }
|
||||
set
|
||||
{
|
||||
_isBusy = value;
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public abstract Task OnNavigatedFrom(NavigationEventArgs args);
|
||||
|
||||
public abstract Task OnNavigatedTo(NavigationEventArgs args);
|
||||
|
||||
public void RaisePropertyChanged([CallerMemberName]string propertyName = "")
|
||||
{
|
||||
var handler = PropertyChanged;
|
||||
handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
internal void SetAppFrame(Frame viewFrame)
|
||||
{
|
||||
_appFrame = viewFrame;
|
||||
}
|
||||
|
||||
internal void SetSplitFrame(Frame viewFrame)
|
||||
{
|
||||
_splitViewFrame = viewFrame;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
namespace Contacts.ViewModels.Base
|
||||
{
|
||||
using Microsoft.Practices.Unity;
|
||||
using Services.Contacts;
|
||||
|
||||
public class ViewModelLocator
|
||||
{
|
||||
readonly IUnityContainer _container;
|
||||
|
||||
public ViewModelLocator()
|
||||
{
|
||||
_container = new UnityContainer();
|
||||
|
||||
// ViewModels
|
||||
_container.RegisterType<AddContactViewModel>();
|
||||
_container.RegisterType<ContactChangesViewModel>();
|
||||
_container.RegisterType<ContactsViewModel>();
|
||||
_container.RegisterType<PickViewModel>();
|
||||
_container.RegisterType<ShellViewModel>();
|
||||
|
||||
// Services
|
||||
_container.RegisterType<IContactService, ContactService>(new ContainerControlledLifetimeManager());
|
||||
}
|
||||
|
||||
public AddContactViewModel AddContactViewModel => _container.Resolve<AddContactViewModel>();
|
||||
public ContactsViewModel ContactsViewModel => _container.Resolve<ContactsViewModel>();
|
||||
public ContactChangesViewModel ContactChangesViewModel => _container.Resolve<ContactChangesViewModel>();
|
||||
public PickViewModel PickViewModel => _container.Resolve<PickViewModel>();
|
||||
public ShellViewModel ShellViewModel => _container.Resolve<ShellViewModel>();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
namespace Contacts.ViewModels
|
||||
{
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using Base;
|
||||
|
||||
public class ContactChangesViewModel : ViewModelBase
|
||||
{
|
||||
public override Task OnNavigatedFrom(NavigationEventArgs args)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override Task OnNavigatedTo(NavigationEventArgs args)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
namespace Contacts.ViewModels
|
||||
{
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using Services.Contacts;
|
||||
using Helpers;
|
||||
using Base;
|
||||
|
||||
public class ContactsViewModel : ViewModelBase
|
||||
{
|
||||
private CollectionViewSource _contacts;
|
||||
|
||||
private readonly IContactService _contactService;
|
||||
|
||||
public ContactsViewModel(IContactService contactService)
|
||||
{
|
||||
_contactService = contactService;
|
||||
}
|
||||
|
||||
|
||||
public CollectionViewSource Contacts
|
||||
{
|
||||
get { return _contacts; }
|
||||
set
|
||||
{
|
||||
_contacts = value;
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public override Task OnNavigatedFrom(NavigationEventArgs args)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override async Task OnNavigatedTo(NavigationEventArgs args)
|
||||
{
|
||||
await LoadContacts();
|
||||
}
|
||||
|
||||
private async Task LoadContacts()
|
||||
{
|
||||
var contacts = await _contactService.GetContactCollection();
|
||||
|
||||
Contacts = new CollectionViewSource
|
||||
{
|
||||
Source = contacts.Where(c => !string.IsNullOrEmpty(c.FullName)).ToAlphaGroups(c => c.FullName),
|
||||
IsSourceGrouped = true
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
namespace Contacts.ViewModels
|
||||
{
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using Base;
|
||||
|
||||
public class PickViewModel : ViewModelBase
|
||||
{
|
||||
public override Task OnNavigatedFrom(NavigationEventArgs args)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override Task OnNavigatedTo(NavigationEventArgs args)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
namespace Contacts.ViewModels
|
||||
{
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Input;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using Models;
|
||||
using Views;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using Base;
|
||||
|
||||
public class ShellViewModel : ViewModelBase
|
||||
{
|
||||
// Variables
|
||||
private bool _isPaneOpen;
|
||||
private ObservableCollection<MenuItem> _menuItems;
|
||||
private MenuItem _selectedMenuItem;
|
||||
|
||||
// Commands
|
||||
private ICommand _hamburgerCommand;
|
||||
private ICommand _navigateCommand;
|
||||
|
||||
public bool IsPaneOpen
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isPaneOpen;
|
||||
}
|
||||
set
|
||||
{
|
||||
_isPaneOpen = value;
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<MenuItem> MenuItems
|
||||
{
|
||||
get { return _menuItems; }
|
||||
set
|
||||
{
|
||||
_menuItems = value;
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public MenuItem SelectedMenuItem
|
||||
{
|
||||
get { return _selectedMenuItem; }
|
||||
set
|
||||
{
|
||||
_selectedMenuItem = value;
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand HamburgerCommand
|
||||
{
|
||||
get { return _hamburgerCommand = _hamburgerCommand ?? new DelegateCommand(HamburgerCommandExecute); }
|
||||
}
|
||||
|
||||
public ICommand NavigateCommand
|
||||
{
|
||||
get { return _navigateCommand = _navigateCommand ?? new DelegateCommand<MenuItem>(NavigateCommandExecute); }
|
||||
}
|
||||
|
||||
public override Task OnNavigatedFrom(NavigationEventArgs args)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override Task OnNavigatedTo(NavigationEventArgs args)
|
||||
{
|
||||
LoadMenu();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void LoadMenu()
|
||||
{
|
||||
MenuItems = new ObservableCollection<MenuItem>
|
||||
{
|
||||
new MenuItem
|
||||
{
|
||||
Title = "Contacts",
|
||||
View = typeof(ContactsView)
|
||||
},
|
||||
new MenuItem
|
||||
{
|
||||
Title = "Pick",
|
||||
View = typeof(PickView)
|
||||
}
|
||||
};
|
||||
|
||||
SelectedMenuItem = MenuItems.First();
|
||||
Navigate(SelectedMenuItem.View);
|
||||
}
|
||||
|
||||
private void HamburgerCommandExecute()
|
||||
{
|
||||
IsPaneOpen = (IsPaneOpen != true);
|
||||
}
|
||||
|
||||
private void NavigateCommandExecute(MenuItem menuItem)
|
||||
{
|
||||
Navigate(menuItem.View);
|
||||
}
|
||||
|
||||
private void Navigate(Type view)
|
||||
{
|
||||
if (view == null)
|
||||
return;
|
||||
|
||||
SplitViewFrame.Navigate(view);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<base:PageBase
|
||||
x:Class="Contacts.Views.AddContact"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:base="using:Contacts.Views.Base"
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding AddContactViewModel, Source={StaticResource Locator}}">
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
</Grid>
|
||||
</base:PageBase>
|
|
@ -0,0 +1,12 @@
|
|||
namespace Contacts.Views
|
||||
{
|
||||
using Base;
|
||||
|
||||
public sealed partial class AddContact : PageBase
|
||||
{
|
||||
public AddContact()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
namespace Contacts.Views.Base
|
||||
{
|
||||
using ViewModels.Base;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using Extensions;
|
||||
|
||||
public class PageBase : Page
|
||||
{
|
||||
private ViewModelBase _vm;
|
||||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
_vm = (ViewModelBase)this.DataContext;
|
||||
_vm.SetAppFrame(this.Frame);
|
||||
|
||||
var splitView = this.GetFirstDescendantOfType<SplitView>();
|
||||
var frame = splitView?.Content as Frame;
|
||||
|
||||
if (frame != null)
|
||||
_vm.SetSplitFrame(frame);
|
||||
|
||||
_vm.OnNavigatedTo(e);
|
||||
}
|
||||
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedFrom(e);
|
||||
_vm.OnNavigatedFrom(e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<base:PageBase
|
||||
x:Class="Contacts.Views.ContactChangesView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:base="using:Contacts.Views.Base"
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding ContactChangesViewModel, Source={StaticResource Locator}}">
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
</Grid>
|
||||
</base:PageBase>
|
|
@ -0,0 +1,12 @@
|
|||
namespace Contacts.Views
|
||||
{
|
||||
using Base;
|
||||
|
||||
public sealed partial class ContactChangesView : PageBase
|
||||
{
|
||||
public ContactChangesView()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
<base:PageBase
|
||||
x:Name="Contacts"
|
||||
x:Class="Contacts.Views.ContactsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:base="using:Contacts.Views.Base"
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding ContactsViewModel, Source={StaticResource Locator}}">
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<SemanticZoom
|
||||
Style="{StaticResource AlphaJumpListStyle}"
|
||||
Margin="19,0,0,0">
|
||||
<SemanticZoom.ZoomedInView>
|
||||
<ListView ItemsSource="{Binding Contacts.View}"
|
||||
ItemTemplate="{StaticResource ContactTemplate}"
|
||||
Width="{Binding ElementName=Contacts, Path=ActualWidth}"
|
||||
SelectionMode="None"
|
||||
IsItemClickEnabled="True"
|
||||
IsSwipeEnabled="False">
|
||||
<ListView.GroupStyle>
|
||||
<GroupStyle
|
||||
HeaderTemplate="{StaticResource AlphaGroupHeaderTemplate}"
|
||||
HeaderContainerStyle="{StaticResource JumpListListHeaderContainerStyle}"
|
||||
HidesIfEmpty="True" />
|
||||
</ListView.GroupStyle>
|
||||
</ListView>
|
||||
</SemanticZoom.ZoomedInView>
|
||||
<SemanticZoom.ZoomedOutView>
|
||||
<GridView
|
||||
ItemsSource="{Binding Contacts.View.CollectionGroups}"
|
||||
Style="{StaticResource AlphaJumpListPickerStyle}">
|
||||
</GridView>
|
||||
</SemanticZoom.ZoomedOutView>
|
||||
</SemanticZoom>
|
||||
</Grid>
|
||||
</base:PageBase>
|
|
@ -0,0 +1,12 @@
|
|||
namespace Contacts.Views
|
||||
{
|
||||
using Base;
|
||||
|
||||
public sealed partial class ContactsView : PageBase
|
||||
{
|
||||
public ContactsView()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<base:PageBase
|
||||
x:Class="Contacts.Views.PickView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:base="using:Contacts.Views.Base"
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding PickViewModel, Source={StaticResource Locator}}">
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
</Grid>
|
||||
</base:PageBase>
|
|
@ -0,0 +1,12 @@
|
|||
namespace Contacts.Views
|
||||
{
|
||||
using Base;
|
||||
|
||||
public sealed partial class PickView : PageBase
|
||||
{
|
||||
public PickView()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
<base:PageBase
|
||||
x:Class="Contacts.Views.ShellView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:base="using:Contacts.Views.Base"
|
||||
xmlns:behaviors="using:Contacts.Behaviors"
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding ShellViewModel, Source={StaticResource Locator}}">
|
||||
<Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup>
|
||||
<VisualState x:Name="Big">
|
||||
<VisualState.StateTriggers>
|
||||
<AdaptiveTrigger MinWindowWidth="600" />
|
||||
</VisualState.StateTriggers>
|
||||
<VisualState.Setters>
|
||||
<Setter Target="Splitter.DisplayMode" Value="CompactInline"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Small">
|
||||
<VisualState.StateTriggers>
|
||||
<AdaptiveTrigger MinWindowWidth="0" />
|
||||
</VisualState.StateTriggers>
|
||||
<VisualState.Setters>
|
||||
<Setter Target="Splitter.DisplayMode" Value="Overlay"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<SplitView
|
||||
x:Name="Splitter"
|
||||
DisplayMode="CompactInline"
|
||||
Background="{StaticResource BackgroundBrush}"
|
||||
PaneBackground="{StaticResource MenuBackgroundBrush}"
|
||||
PanePlacement="Left"
|
||||
CompactPaneLength="60"
|
||||
OpenPaneLength="240"
|
||||
IsPaneOpen="{Binding IsPaneOpen}">
|
||||
<SplitView.Pane>
|
||||
<Grid
|
||||
Margin="0,50,0,0">
|
||||
<ListView
|
||||
ItemsSource="{Binding MenuItems}"
|
||||
SelectedItem="{Binding SelectedMenuItem, Mode=TwoWay}"
|
||||
ItemTemplate="{StaticResource MenuItemDataTemplate}"
|
||||
behaviors:ItemClickCommandBehavior.Command="{Binding NavigateCommand}"
|
||||
SelectionMode="Single"
|
||||
IsItemClickEnabled="True"
|
||||
Margin="0,50,0,0"/>
|
||||
</Grid>
|
||||
</SplitView.Pane>
|
||||
<Frame/>
|
||||
</SplitView>
|
||||
<ToggleButton
|
||||
x:Name="HamburguerButton"
|
||||
Style="{StaticResource SymbolButton}"
|
||||
Command="{Binding HamburgerCommand}"
|
||||
VerticalAlignment="Top"
|
||||
Foreground="{StaticResource WhiteBrush}"
|
||||
Margin="0,5,0,0">
|
||||
<ToggleButton.Content>
|
||||
<Border
|
||||
Background="Transparent"
|
||||
Width="40"
|
||||
Height="40">
|
||||
<FontIcon
|
||||
x:Name="Hamburger"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Glyph="" />
|
||||
</Border>
|
||||
</ToggleButton.Content>
|
||||
</ToggleButton>
|
||||
</Grid>
|
||||
</base:PageBase>
|
|
@ -0,0 +1,12 @@
|
|||
namespace Contacts.Views
|
||||
{
|
||||
using Base;
|
||||
|
||||
public sealed partial class ShellView : PageBase
|
||||
{
|
||||
public ShellView()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ApplicationInsights xmlns = "http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
|
||||
</ApplicationInsights>
|
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp build" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build">
|
||||
<!--
|
||||
ESTE ARCHIVO DE MANIFIESTO DEL PAQUETE SE GENERA MEDIANTE EL PROCESO DE COMPILACIÓN.
|
||||
|
||||
Los cambios realizados en el archivo se perderán al regenerarlo. Para corregir los errores de este archivo, edite el archivo de origen .appxmanifest.
|
||||
|
||||
Para obtener más información acerca de los archivos de manifiesto del paquete, vea http://go.microsoft.com/fwlink/?LinkID=241727
|
||||
-->
|
||||
<Identity Name="2dc66bc2-a821-449f-a711-932f4b081444" Publisher="CN=javie" Version="1.0.0.0" ProcessorArchitecture="x86" />
|
||||
<mp:PhoneIdentity PhoneProductId="2dc66bc2-a821-449f-a711-932f4b081444" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>Contacts</DisplayName>
|
||||
<PublisherDisplayName>javie</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10240.0" MaxVersionTested="10.0.10240.0" />
|
||||
<PackageDependency Name="Microsoft.NET.CoreRuntime.1.0" MinVersion="1.0.23302.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
|
||||
<PackageDependency Name="Microsoft.VCLibs.140.00.Debug" MinVersion="14.0.23019.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
|
||||
</Dependencies>
|
||||
<Resources>
|
||||
<Resource Language="ES-ES" />
|
||||
<Resource Language="EN" />
|
||||
<Resource Language="EN-US" />
|
||||
</Resources>
|
||||
<Applications>
|
||||
<Application Id="App" Executable="Contacts.exe" EntryPoint="Contacts.App">
|
||||
<uap:VisualElements DisplayName="Contacts" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Contacts" BackgroundColor="transparent">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" />
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
<uap:Capability Name="contacts" />
|
||||
</Capabilities>
|
||||
<build:Metadata>
|
||||
<build:Item Name="TargetFrameworkMoniker" Value=".NETCore,Version=v5.0" />
|
||||
<build:Item Name="VisualStudio" Version="14.0" />
|
||||
<build:Item Name="VisualStudioEdition" Value="Microsoft Visual Studio Enterprise 2015" />
|
||||
<build:Item Name="OperatingSystem" Version="10.0.10240.16384 (th1.150709-1700)" />
|
||||
<build:Item Name="Microsoft.Build.AppxPackage.dll" Version="14.0.23311.4" />
|
||||
<build:Item Name="ProjectGUID" Value="{2E09B68D-F4D1-47A6-A7E3-7FC6859CBF9B}" />
|
||||
<build:Item Name="OptimizingToolset" Value="None" />
|
||||
<build:Item Name="TargetRuntime" Value="Managed" />
|
||||
<build:Item Name="Microsoft.Windows.UI.Xaml.Build.Tasks.dll" Version="14.0.23309.0" />
|
||||
<build:Item Name="MakePri.exe" Version="10.0.10240.16384 (th1.150709-1700)" />
|
||||
</build:Metadata>
|
||||
</Package>
|
Двоичные данные
Contacts/Contacts/bin/x86/Debug/AppX/Assets/LockScreenLogo.scale-200.png
Normal file
После Ширина: | Высота: | Размер: 1.4 KiB |
После Ширина: | Высота: | Размер: 7.5 KiB |
Двоичные данные
Contacts/Contacts/bin/x86/Debug/AppX/Assets/Square150x150Logo.scale-200.png
Normal file
После Ширина: | Высота: | Размер: 2.9 KiB |
Двоичные данные
Contacts/Contacts/bin/x86/Debug/AppX/Assets/Square44x44Logo.scale-200.png
Normal file
После Ширина: | Высота: | Размер: 1.6 KiB |
Двоичные данные
Contacts/Contacts/bin/x86/Debug/AppX/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
Normal file
После Ширина: | Высота: | Размер: 1.2 KiB |
После Ширина: | Высота: | Размер: 1.4 KiB |
Двоичные данные
Contacts/Contacts/bin/x86/Debug/AppX/Assets/Wide310x150Logo.scale-200.png
Normal file
После Ширина: | Высота: | Размер: 3.1 KiB |
|
@ -0,0 +1,270 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Roots >
|
||||
<Roots.Interfaces>
|
||||
<RootInterface FullName="Windows.UI.Xaml.Data.IValueConverter" />
|
||||
</Roots.Interfaces>
|
||||
<Roots.PropertyPathNames>
|
||||
<RootPropertyPathName Name="Group" />
|
||||
<RootPropertyPathName Name="Key" />
|
||||
<RootPropertyPathName Name="FullName" />
|
||||
<RootPropertyPathName Name="Title" />
|
||||
<RootPropertyPathName Name="Icon" />
|
||||
<RootPropertyPathName Name="AddContactViewModel" />
|
||||
<RootPropertyPathName Name="ContactChangesViewModel" />
|
||||
<RootPropertyPathName Name="ContactsViewModel" />
|
||||
<RootPropertyPathName Name="Contacts" />
|
||||
<RootPropertyPathName Name="View" />
|
||||
<RootPropertyPathName Name="ActualWidth" />
|
||||
<RootPropertyPathName Name="CollectionGroups" />
|
||||
<RootPropertyPathName Name="PickViewModel" />
|
||||
<RootPropertyPathName Name="ShellViewModel" />
|
||||
<RootPropertyPathName Name="HamburgerCommand" />
|
||||
<RootPropertyPathName Name="IsPaneOpen" />
|
||||
<RootPropertyPathName Name="MenuItems" />
|
||||
<RootPropertyPathName Name="SelectedMenuItem" />
|
||||
<RootPropertyPathName Name="NavigateCommand" />
|
||||
</Roots.PropertyPathNames>
|
||||
<Roots.RootTypes>
|
||||
<RootType FullName="Windows.UI.Xaml.Application">
|
||||
<RootProperty Name="RequestedTheme" />
|
||||
<RootProperty Name="Resources" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.ResourceDictionary">
|
||||
<RootProperty Name="MergedDictionaries" />
|
||||
<RootProperty Name="Source" />
|
||||
</RootType>
|
||||
<RootType FullName="Contacts.ViewModels.Base.ViewModelLocator" />
|
||||
<RootType FullName="Windows.UI.Color" />
|
||||
<RootType FullName="Windows.UI.Xaml.Media.SolidColorBrush">
|
||||
<RootProperty Name="Color" />
|
||||
</RootType>
|
||||
<RootType FullName="Microsoft.Xaml.DirectUI.ProxyTypes.StaticResourceExtension" />
|
||||
<RootType FullName="Windows.UI.Xaml.DataTemplate">
|
||||
<RootProperty Name="Template" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.Primitives.JumpListItemBackgroundConverter" />
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.Primitives.JumpListItemForegroundConverter" />
|
||||
<RootType FullName="Windows.UI.Xaml.Thickness" />
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.SemanticZoom">
|
||||
<RootProperty Name="Style" />
|
||||
<RootProperty Name="Margin" />
|
||||
<RootProperty Name="ZoomedInView" />
|
||||
<RootProperty Name="ZoomedOutView" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.Control">
|
||||
<RootProperty Name="Template" />
|
||||
<RootProperty Name="HorizontalContentAlignment" />
|
||||
<RootProperty Name="VerticalContentAlignment" />
|
||||
<RootProperty Name="FontWeight" />
|
||||
<RootProperty Name="FontSize" />
|
||||
<RootProperty Name="Foreground" />
|
||||
<RootProperty Name="Background" />
|
||||
<RootProperty Name="BorderBrush" />
|
||||
<RootProperty Name="BorderThickness" />
|
||||
<RootProperty Name="Padding" />
|
||||
<RootProperty Name="FontFamily" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.ListViewHeaderItem" />
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.GridView">
|
||||
<RootProperty Name="ItemsSource" />
|
||||
<RootProperty Name="Style" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.ItemsControl">
|
||||
<RootProperty Name="ItemTemplate" />
|
||||
<RootProperty Name="ItemContainerStyle" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Setter">
|
||||
<RootProperty Name="Property" />
|
||||
<RootProperty Name="Value" />
|
||||
<RootProperty Name="Target" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.GridViewItem" />
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.ControlTemplate">
|
||||
<RootProperty Name="TargetType" />
|
||||
<RootProperty Name="Template" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.Border">
|
||||
<RootProperty Name="Child" />
|
||||
<RootProperty Name="Background" />
|
||||
<RootProperty Name="BorderBrush" />
|
||||
<RootProperty Name="BorderThickness" />
|
||||
<RootProperty Name="Height" />
|
||||
<RootProperty Name="Width" />
|
||||
<RootProperty Name="HorizontalAlignment" />
|
||||
<RootProperty Name="Margin" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.VisualStateManager">
|
||||
<RootMethod Name="GetVisualStateGroups" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.VisualStateGroup">
|
||||
<RootProperty Name="States" />
|
||||
<RootProperty Name="Transitions" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.VisualState">
|
||||
<RootProperty Name="Storyboard" />
|
||||
<RootProperty Name="StateTriggers" />
|
||||
<RootProperty Name="Setters" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Media.Animation.Storyboard">
|
||||
<RootProperty Name="Children" />
|
||||
<RootMethod Name="GetTargetName" />
|
||||
<RootMethod Name="SetTargetName" />
|
||||
<RootMethod Name="GetTargetProperty" />
|
||||
<RootMethod Name="SetTargetProperty" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Media.Animation.PointerDownThemeAnimation" />
|
||||
<RootType FullName="Windows.UI.Xaml.VisualTransition">
|
||||
<RootProperty Name="From" />
|
||||
<RootProperty Name="To" />
|
||||
<RootProperty Name="Storyboard" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Media.Animation.PointerUpThemeAnimation" />
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.ContentPresenter">
|
||||
<RootProperty Name="ContentTransitions" />
|
||||
<RootProperty Name="ContentTemplate" />
|
||||
<RootProperty Name="Content" />
|
||||
<RootProperty Name="HorizontalAlignment" />
|
||||
<RootProperty Name="VerticalAlignment" />
|
||||
<RootProperty Name="Margin" />
|
||||
<RootProperty Name="Height" />
|
||||
<RootProperty Name="Width" />
|
||||
</RootType>
|
||||
<RootType FullName="Microsoft.Xaml.DirectUI.ProxyTypes.TemplateBindingExtension" />
|
||||
<RootType FullName="Windows.UI.Xaml.Data.Binding">
|
||||
<RootProperty Name="Converter" />
|
||||
<RootProperty Name="Source" />
|
||||
<RootProperty Name="ElementName" />
|
||||
<RootProperty Name="Path" />
|
||||
<RootProperty Name="Mode" />
|
||||
</RootType>
|
||||
<RootType FullName="Microsoft.Xaml.DirectUI.ProxyTypes.ThemeResourceExtension" />
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.TextBlock">
|
||||
<RootProperty Name="Text" />
|
||||
<RootProperty Name="Foreground" />
|
||||
<RootProperty Name="FontSize" />
|
||||
<RootProperty Name="FontWeight" />
|
||||
<RootProperty Name="TextLineBounds" />
|
||||
<RootProperty Name="OpticalMarginAlignment" />
|
||||
<RootProperty Name="IsColorFontEnabled" />
|
||||
<RootProperty Name="IsTextScaleFactorEnabled" />
|
||||
<RootProperty Name="HorizontalAlignment" />
|
||||
<RootProperty Name="VerticalAlignment" />
|
||||
<RootProperty Name="Margin" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.Grid">
|
||||
<RootProperty Name="Children" />
|
||||
<RootProperty Name="Margin" />
|
||||
<RootProperty Name="Width" />
|
||||
<RootProperty Name="ColumnDefinitions" />
|
||||
<RootProperty Name="Background" />
|
||||
<RootMethod Name="GetColumn" />
|
||||
<RootMethod Name="SetColumn" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.Primitives.Popup">
|
||||
<RootProperty Name="ChildTransitions" />
|
||||
<RootProperty Name="Child" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Media.Animation.TransitionCollection" />
|
||||
<RootType FullName="Windows.UI.Xaml.Media.Animation.PopupThemeTransition" />
|
||||
<RootType FullName="Windows.UI.Xaml.Shapes.Rectangle">
|
||||
<RootProperty Name="Fill" />
|
||||
<RootProperty Name="Opacity" />
|
||||
<RootProperty Name="IsHitTestVisible" />
|
||||
<RootProperty Name="StrokeDashOffset" />
|
||||
<RootProperty Name="StrokeEndLineCap" />
|
||||
<RootProperty Name="Stroke" />
|
||||
<RootProperty Name="StrokeDashArray" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.Viewbox">
|
||||
<RootProperty Name="Stretch" />
|
||||
<RootProperty Name="VerticalAlignment" />
|
||||
<RootProperty Name="Child" />
|
||||
</RootType>
|
||||
<RootType FullName="Contacts.Converters.ToUpperCaseConverter" />
|
||||
<RootType FullName="System.Double" />
|
||||
<RootType FullName="Windows.UI.Xaml.Shapes.Ellipse" />
|
||||
<RootType FullName="Windows.UI.Xaml.FrameworkElement">
|
||||
<RootProperty Name="Height" />
|
||||
<RootProperty Name="Width" />
|
||||
<RootProperty Name="HorizontalAlignment" />
|
||||
<RootProperty Name="Margin" />
|
||||
<RootProperty Name="VerticalAlignment" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.HyperlinkButton" />
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.ColumnDefinition">
|
||||
<RootProperty Name="Width" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.FontIcon">
|
||||
<RootProperty Name="FontFamily" />
|
||||
<RootProperty Name="Foreground" />
|
||||
<RootProperty Name="Glyph" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.Primitives.ToggleButton">
|
||||
<RootProperty Name="Style" />
|
||||
<RootProperty Name="Command" />
|
||||
<RootProperty Name="VerticalAlignment" />
|
||||
<RootProperty Name="Foreground" />
|
||||
<RootProperty Name="Margin" />
|
||||
<RootProperty Name="Content" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Media.Animation.DoubleAnimation">
|
||||
<RootProperty Name="Duration" />
|
||||
<RootProperty Name="To" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Media.Animation.ObjectAnimationUsingKeyFrames">
|
||||
<RootProperty Name="KeyFrames" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Media.Animation.DiscreteObjectKeyFrame">
|
||||
<RootProperty Name="KeyTime" />
|
||||
<RootProperty Name="Value" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Automation.AutomationProperties">
|
||||
<RootMethod Name="GetAccessibilityView" />
|
||||
<RootMethod Name="SetAccessibilityView" />
|
||||
</RootType>
|
||||
<RootType FullName="Contacts.Views.Base.PageBase">
|
||||
<RootProperty Name="DataContext" />
|
||||
<RootProperty Name="Content" />
|
||||
</RootType>
|
||||
<RootType FullName="Contacts.Views.AddContact" />
|
||||
<RootType FullName="Contacts.Views.ContactChangesView" />
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.ListView">
|
||||
<RootProperty Name="ItemsSource" />
|
||||
<RootProperty Name="ItemTemplate" />
|
||||
<RootProperty Name="Width" />
|
||||
<RootProperty Name="SelectionMode" />
|
||||
<RootProperty Name="IsItemClickEnabled" />
|
||||
<RootProperty Name="IsSwipeEnabled" />
|
||||
<RootProperty Name="GroupStyle" />
|
||||
<RootProperty Name="SelectedItem" />
|
||||
<RootProperty Name="Margin" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.GroupStyle">
|
||||
<RootProperty Name="HeaderTemplate" />
|
||||
<RootProperty Name="HeaderContainerStyle" />
|
||||
<RootProperty Name="HidesIfEmpty" />
|
||||
</RootType>
|
||||
<RootType FullName="Contacts.Views.ContactsView" />
|
||||
<RootType FullName="Contacts.Views.PickView" />
|
||||
<RootType FullName="Windows.UI.Xaml.AdaptiveTrigger">
|
||||
<RootProperty Name="MinWindowWidth" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.SplitView">
|
||||
<RootProperty Name="DisplayMode" />
|
||||
<RootProperty Name="Background" />
|
||||
<RootProperty Name="PaneBackground" />
|
||||
<RootProperty Name="PanePlacement" />
|
||||
<RootProperty Name="CompactPaneLength" />
|
||||
<RootProperty Name="OpenPaneLength" />
|
||||
<RootProperty Name="IsPaneOpen" />
|
||||
<RootProperty Name="Pane" />
|
||||
<RootProperty Name="Content" />
|
||||
</RootType>
|
||||
<RootType FullName="Contacts.Behaviors.ItemClickCommandBehavior">
|
||||
<RootMethod Name="GetCommand" />
|
||||
<RootMethod Name="SetCommand" />
|
||||
</RootType>
|
||||
<RootType FullName="Windows.UI.Xaml.Controls.Frame" />
|
||||
<RootType FullName="Contacts.Views.ShellView" />
|
||||
</Roots.RootTypes>
|
||||
</Roots>
|
Двоичные данные
Contacts/Contacts/bin/x86/Debug/AppX/Microsoft.ApplicationInsights.Extensibility.Windows.dll
Normal file
Двоичные данные
Contacts/Contacts/bin/x86/Debug/AppX/Microsoft.ApplicationInsights.PersistenceChannel.dll
Normal file
Двоичные данные
Contacts/Contacts/bin/x86/Debug/AppX/Microsoft.Practices.ServiceLocation.dll
Normal file
Двоичные данные
Contacts/Contacts/bin/x86/Debug/AppX/Microsoft.Practices.Unity.RegistrationByConvention.dll
Normal file
|
@ -0,0 +1,30 @@
|
|||
<!--
|
||||
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
|
||||
developers. However, you can modify these parameters to modify the behavior of the .NET Native
|
||||
optimizer.
|
||||
|
||||
Runtime Directives are documented at http://go.microsoft.com/fwlink/?LinkID=391919
|
||||
|
||||
To fully enable reflection for App1.MyClass and all of its public/private members
|
||||
<Type Name="App1.MyClass" Dynamic="Required All"/>
|
||||
|
||||
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
|
||||
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
|
||||
|
||||
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
|
||||
<Namespace Name="DataClasses.ViewModels" Seralize="All" />
|
||||
-->
|
||||
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
|
||||
<Application>
|
||||
<!--
|
||||
An Assembly element with Name="*Application*" applies to all assemblies in
|
||||
the application package. The asterisks are not wildcards.
|
||||
-->
|
||||
<Assembly Name="*Application*" Dynamic="Required All"/>
|
||||
|
||||
|
||||
<!-- Add your application specific runtime directives here. -->
|
||||
|
||||
|
||||
</Application>
|
||||
</Directives>
|