This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Application | |
x:Class="Sample.App" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:Sample" | |
RequestedTheme="Light" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | |
<Package IgnorableNamespaces="uap mp uap3 build" 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" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:wincap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/windowscapabilities" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build"> | |
<Identity Name="Microsoft.Windows.Photos" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="17.313.10010.0" ProcessorArchitecture="x64" /> | |
<mp:PhoneIdentity PhoneProductId="fca55e1b-b9a4-4289-882f-084ef4145005" PhonePublisherId="95d94207-0c7c-47ed-82db-d75c81153c35" /> | |
<Properties> | |
<DisplayName>ms-resource: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Runtime.Serialization.Json; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Windows.Storage; | |
using Windows.Web.Http; | |
public static class Extensions | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. | |
//See LICENSE in the project root for license information. | |
using System; | |
using System.Diagnostics; | |
using System.Net.Http.Headers; | |
using System.Net.Http; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Windows.Security.Authentication.Web; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ObservableDictionary<K, V> : INotifyCollectionChanged, IEnumerable<KeyValuePair<K, V>> | |
{ | |
private Dictionary<K, V> _dictionary = new Dictionary<K, V>(); | |
private void RaiseChanged(NotifyCollectionChangedAction action, params K[] keys) | |
{ | |
CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(action, keys)); | |
DictionaryChanged?.Invoke(this, new NotifyDictionaryChangedEventArgs(action, keys)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine(new DateTimeOffset(DateTime.Now)); | |
foreach (var item in Enumerable.Range(1, 10)) | |
{ | |
var date = new DateTime(2018, 8, 16); | |
var offset = TimeSpan.FromHours(-item); | |
var now = new DateTimeOffset(date, offset); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class HolidayHelper | |
{ | |
public static DateTime NewYears => new DateTime(DateTime.Now.Year, 1, 1).Date; | |
public static DateTime Christmas => new DateTime(DateTime.Now.Year, 12, 25).Date; | |
public static DateTime GoodFriday => GetEaster(DateTime.Now.Year).AddDays(-2); | |
public static DateTime Easter => GetEaster(DateTime.Now.Year); | |
public static class Canada | |
{ | |
public static DateTime LabourDay => new DateTime(DateTime.Now.Year, 5, 1).Date; | |
public static DateTime Independence => new DateTime(DateTime.Now.Year, 7, 1).Date; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ContentProperty(Name = nameof(LiteralContent))] | |
public sealed class AppBarLiteral : AppBarSeparator | |
{ | |
public AppBarLiteral() | |
{ | |
DefaultStyleKey = typeof(AppBarLiteral); | |
} | |
public object LiteralContent | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static async Task<string> ScaleImageAsync(string path, uint height = 32, uint width = 32, StorageFile output_file = null) | |
{ | |
// open file from path | |
var input_file = default(StorageFile); | |
try | |
{ | |
input_file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(path)); | |
} | |
catch (FileNotFoundException) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed partial class App : Application | |
{ | |
public App() | |
{ | |
InitializeComponent(); | |
Suspending += (s, e) => Helpers.ShowToast("Suspending"); | |
Resuming += (s, e) => Helpers.ShowToast("Resuming"); | |
Helpers.SetupExSession( | |
allowed: () => Helpers.ShowToast("Allowed"), | |
denied: () => Helpers.ShowToast("Denied"), |