Skip to content

Commit

Permalink
Added PushTriggerSample and ToDoPivot
Browse files Browse the repository at this point in the history
ToDoPivot has UI that works on both PC and Phone.
PushTriggerSample is unfinished
  • Loading branch information
AndyCW committed May 6, 2015
1 parent a6d9e8e commit 3800cf7
Show file tree
Hide file tree
Showing 122 changed files with 130,412 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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("PushTriggerBackgroundTask")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PushTriggerBackgroundTask")]
[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)]
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<?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)' == '' ">AnyCPU</Platform>
<ProjectGuid>{599FFC8A-DE98-40BF-980F-A77BE9DD1537}</ProjectGuid>
<OutputType>winmdobj</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PushTriggerBackgroundTask</RootNamespace>
<AssemblyName>PushTriggerBackgroundTask</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10069.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10069.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<AllowCrossPlatformRetargeting>false</AllowCrossPlatformRetargeting>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP</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'">
<PlatformTarget>ARM</PlatformTarget>
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP</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'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP</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'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Compile Include="RawTriggerTask.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Numerics.Vectors, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.0.0\lib\win8\System.Numerics.Vectors.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Numerics.Vectors.WindowsRuntime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.0.0\lib\win8\System.Numerics.Vectors.WindowsRuntime.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '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>
59 changes: 59 additions & 0 deletions PushTriggerSample/PushTriggerBackgroundTask/RawTriggerTask.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel.Background;
using Windows.Data.Xml.Dom;
using Windows.Networking.PushNotifications;
using Windows.Storage;
using Windows.UI.Notifications;

namespace PushTriggerBackgroundTask
{
public sealed class RawTriggerTask : IBackgroundTask
{
public void Run(IBackgroundTaskInstance taskInstance)
{
var _deferral = taskInstance.GetDeferral();

// Get the background task details
ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
string taskName = taskInstance.Task.Name;

Debug.WriteLine("Background " + taskName + " starting...");

// Store the content received from the notification so it can be retrieved from the UI.
RawNotification notification = (RawNotification)taskInstance.TriggerDetails;
settings.Values[taskName] = notification.Content;

// Pop up a toast to notify the user
DeliverToast("test", "testid");

Debug.WriteLine("Background " + taskName + " completed!");
}

private void DeliverToast(string todoTitle, string todoID)
{
// Send the Toast Notification informing the user of a new message
ToastTemplateType toastTemplate = ToastTemplateType.ToastImageAndText01;
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);

XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
toastTextElements[0].AppendChild(toastXml.CreateTextNode(todoTitle));

IXmlNode toastNode = toastXml.SelectSingleNode("/toast");

((XmlElement)toastNode).SetAttribute("launch", "{\"type\":\"toast\",\"param1\":\"" + todoID + "\",\"param2\":\"0\"}");

ToastNotification toast = new ToastNotification(toastXml);

// Tag the Toast with the data item ID
// Note that Toasts sent from servers set the Tag through an HTTP Header
toast.Tag = msgItem.ID;

ToastNotificationManager.CreateToastNotifier().Show(toast);
}
}
}
4 changes: 4 additions & 0 deletions PushTriggerSample/PushTriggerBackgroundTask/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Numerics.Vectors" version="4.0.0" targetFramework="win81" userInstalled="true" />
</packages>
62 changes: 62 additions & 0 deletions PushTriggerSample/PushTriggerSample.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22823.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PushTriggerSample", "PushTriggerSample\PushTriggerSample.csproj", "{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PushTriggerBackgroundTask", "PushTriggerBackgroundTask\PushTriggerBackgroundTask.csproj", "{599FFC8A-DE98-40BF-980F-A77BE9DD1537}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Debug|Any CPU.ActiveCfg = Debug|x86
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Debug|ARM.ActiveCfg = Debug|ARM
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Debug|ARM.Build.0 = Debug|ARM
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Debug|ARM.Deploy.0 = Debug|ARM
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Debug|x64.ActiveCfg = Debug|x64
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Debug|x64.Build.0 = Debug|x64
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Debug|x64.Deploy.0 = Debug|x64
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Debug|x86.ActiveCfg = Debug|x86
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Debug|x86.Build.0 = Debug|x86
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Debug|x86.Deploy.0 = Debug|x86
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Release|Any CPU.ActiveCfg = Release|x86
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Release|ARM.ActiveCfg = Release|ARM
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Release|ARM.Build.0 = Release|ARM
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Release|ARM.Deploy.0 = Release|ARM
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Release|x64.ActiveCfg = Release|x64
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Release|x64.Build.0 = Release|x64
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Release|x64.Deploy.0 = Release|x64
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Release|x86.ActiveCfg = Release|x86
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Release|x86.Build.0 = Release|x86
{8BE1FC83-8AC2-41F0-BEDF-D4F4F53A1450}.Release|x86.Deploy.0 = Release|x86
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Debug|Any CPU.Build.0 = Debug|Any CPU
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Debug|ARM.ActiveCfg = Debug|ARM
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Debug|ARM.Build.0 = Debug|ARM
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Debug|x64.ActiveCfg = Debug|x64
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Debug|x64.Build.0 = Debug|x64
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Debug|x86.ActiveCfg = Debug|x86
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Debug|x86.Build.0 = Debug|x86
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Release|Any CPU.ActiveCfg = Release|Any CPU
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Release|Any CPU.Build.0 = Release|Any CPU
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Release|ARM.ActiveCfg = Release|ARM
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Release|ARM.Build.0 = Release|ARM
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Release|x64.ActiveCfg = Release|x64
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Release|x64.Build.0 = Release|x64
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Release|x86.ActiveCfg = Release|x86
{599FFC8A-DE98-40BF-980F-A77BE9DD1537}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
37 changes: 37 additions & 0 deletions PushTriggerSample/PushTriggerSample/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<common:BootStrapper x:Class="PushTriggerSample.App" xmlns:common="using:PushTriggerSample.Common"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:c="using:PushTriggerSample.Converters"
xmlns:local="using:PushTriggerSample" RequestedTheme="Light">

<common:BootStrapper.Resources>

<c:DateTimeFormatConverter x:Name="DateTimeFormatConverter" />

<c:ValueWhenConverter x:Name="VisibleWhenZeroConverter">
<c:ValueWhenConverter.When>
<x:Int32>0</x:Int32>
</c:ValueWhenConverter.When>
<c:ValueWhenConverter.Value>
<Visibility>Visible</Visibility>
</c:ValueWhenConverter.Value>
<c:ValueWhenConverter.Otherwise>
<Visibility>Collapsed</Visibility>
</c:ValueWhenConverter.Otherwise>
</c:ValueWhenConverter>

<c:ValueWhenConverter x:Name="VisibleWhenTrueConverter">
<c:ValueWhenConverter.When>
<x:Boolean>true</x:Boolean>
</c:ValueWhenConverter.When>
<c:ValueWhenConverter.Value>
<Visibility>Visible</Visibility>
</c:ValueWhenConverter.Value>
<c:ValueWhenConverter.Otherwise>
<Visibility>Collapsed</Visibility>
</c:ValueWhenConverter.Otherwise>
</c:ValueWhenConverter>

</common:BootStrapper.Resources>

</common:BootStrapper>
24 changes: 24 additions & 0 deletions PushTriggerSample/PushTriggerSample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using PushTriggerSample.Helpers;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Windows.ApplicationModel.Activation;

namespace PushTriggerSample
{
sealed partial class App : Common.BootStrapper
{
public App() : base()
{
this.InitializeComponent();
}

public async override Task OnLaunchedAsync(ILaunchActivatedEventArgs e)
{
this.NavigationService.Navigate(typeof(Views.MainPage));

var channelURI = await PushHandlingHelper.RegisterForPushAsync();
Debug.WriteLine(channelURI);
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3800cf7

Please sign in to comment.