diff --git a/.gitignore b/.gitignore index fb14950..227cf34 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,17 @@ java/build java/captures java/.externalNativeBuild java/.cxx + + +# C# / UWP Files / VS Specifiq files +.vs/ +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates +*UpgradeLog*.htm +AppPackages + +[Oo]bj/ +[Bb]in/ diff --git a/.gitlab-ci-files/job-windows.yml b/.gitlab-ci-files/job-windows.yml new file mode 100644 index 0000000..ee61bea --- /dev/null +++ b/.gitlab-ci-files/job-windows.yml @@ -0,0 +1,13 @@ +job-windows: + + stage: build + tags: [ "windows" ] + script: + # Build VS project + #Remove MinGW of MSYS from PATH and add MINGW_TYPE for MSYS2 + - echo %PATH% + - cd uwp\cs + - | + "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" -t:restore -verbosity:minimal + - | + "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" TutorialsCS.sln /m /property:Configuration=Release /property:Platform=x64 -verbosity:quiet diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 73d7ee9..43291ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,7 @@ include: - '.gitlab-ci-files/job-android.yml' + - '.gitlab-ci-files/job-windows.yml' stages: - build diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..8ab5af7 --- /dev/null +++ b/Readme.md @@ -0,0 +1,43 @@ +Linphone SDK tutorials +==================== + +This repository holds tutorials explaining how to set up [Linphone-SDK](https://gitlab.linphone.org/BC/public/linphone-sdk/) +in a Android / iOS / desktop projects and use it to implement some simple features. + +## License + +Copyright © Belledonne Communications + +Tutorials are published under [GNU/GPLv3 license](https://www.gnu.org/licenses/gpl-3.0.en.html), for free (open source). +Please make sure that you understand and agree with the terms of this license before using it (see LICENSE.txt file for details). + +## Android + +Even though Linphone's APIs are available in Java, Android tutorials have been created in Kotlin as it is the current standard for Android apps. + +Linphone-SDK will be downloaded automatically by gradle from our [Maven repository](https://linphone.org/maven_repository/org/linphone/linphone-sdk-android/). + +## iOS + +In the same way, iOS tutorials are written in Swift but the same can be achieved through Objective-C. + +Linphone-SDK binaries are fetched from our [Cocoapods repository](https://gitlab.linphone.org/BC/public/podspec.git) for iOS. + +## Desktop + +Desktop tutorials are in C#, leveraging on our Nuget packaging. + +## Additional resources + +All tutorials require a SIP account to function, and if you don't have one you can create as many as you want and for free using our [free SIP service](https://subscribe.linphone.org/). + +You can check our [website](https://linphone.org/) for news, supported RFCs, licensing services, etc... + +Full API documentation is available for all of our supported languages: +* [C++](http://linphone.org/snapshots/docs/liblinphone/latest/c++) +* [C#](http://linphone.org/snapshots/docs/liblinphone/latest/cs) +* [Java](http://linphone.org/snapshots/docs/liblinphone/latest/java) +* [Swift](http://linphone.org/snapshots/docs/liblinphone/latest/swift) +* [C](http://linphone.org/snapshots/docs/liblinphone/latest/c) + +Finally we also have a [wiki](https://wiki.linphone.org/xwiki/wiki/public/view/Main/) with articles on various subjects. \ No newline at end of file diff --git a/uwp/cs/00_HelloWorld/00_HelloWorld.csproj b/uwp/cs/00_HelloWorld/00_HelloWorld.csproj new file mode 100644 index 0000000..0327b75 --- /dev/null +++ b/uwp/cs/00_HelloWorld/00_HelloWorld.csproj @@ -0,0 +1,174 @@ + + + + + Debug + x86 + {4EDDB112-127A-42C3-81BE-5BA16151E67F} + AppContainerExe + Properties + _00_HelloWorld + 00_HelloWorld + en-US + UAP + 10.0.17763.0 + 10.0.17763.0 + 14 + 512 + {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + true + false + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x86 + false + prompt + true + + + bin\x86\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x86 + false + prompt + true + true + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + ARM + false + prompt + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + ARM + false + prompt + true + true + + + true + bin\ARM64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + ARM64 + false + prompt + true + true + + + bin\ARM64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + ARM64 + false + prompt + true + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x64 + false + prompt + true + + + bin\x64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x64 + false + prompt + true + true + + + PackageReference + + + + App.xaml + + + MainPage.xaml + + + + + + Designer + + + + + + + + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + 5.1.0-alpha.56 + + + 6.2.11 + + + + + + + 14.0 + + + + \ No newline at end of file diff --git a/uwp/cs/00_HelloWorld/App.xaml b/uwp/cs/00_HelloWorld/App.xaml new file mode 100644 index 0000000..83734b6 --- /dev/null +++ b/uwp/cs/00_HelloWorld/App.xaml @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/uwp/cs/00_HelloWorld/App.xaml.cs b/uwp/cs/00_HelloWorld/App.xaml.cs new file mode 100644 index 0000000..3382a8d --- /dev/null +++ b/uwp/cs/00_HelloWorld/App.xaml.cs @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2010-2020 Belledonne Communications SARL. + * + * This file is part of Linphone TutorialCS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using System; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Navigation; + +namespace _00_HelloWorld +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + sealed partial class App : Application + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + this.Suspending += OnSuspending; + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// + /// Details about the launch request and process. + protected override void OnLaunched(LaunchActivatedEventArgs e) + { + Frame rootFrame = Window.Current.Content as Frame; + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (rootFrame == null) + { + // Create a Frame to act as the navigation context and navigate to the first page + rootFrame = new Frame(); + + rootFrame.NavigationFailed += OnNavigationFailed; + + if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) + { + //TODO: Load state from previously suspended application + } + + // Place the frame in the current Window + Window.Current.Content = rootFrame; + } + + if (e.PrelaunchActivated == false) + { + if (rootFrame.Content == null) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame.Navigate(typeof(MainPage), e.Arguments); + } + // Ensure the current window is active + Window.Current.Activate(); + } + } + + /// + /// Invoked when Navigation to a certain page fails + /// + /// The Frame which failed navigation + /// Details about the navigation failure + private void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new Exception("Failed to load Page " + e.SourcePageType.FullName); + } + + /// + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// + /// The source of the suspend request. + /// Details about the suspend request. + private void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + //TODO: Save application state and stop any background activity + deferral.Complete(); + } + } +} \ No newline at end of file diff --git a/uwp/cs/00_HelloWorld/Assets/LockScreenLogo.scale-200.png b/uwp/cs/00_HelloWorld/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000..735f57a Binary files /dev/null and b/uwp/cs/00_HelloWorld/Assets/LockScreenLogo.scale-200.png differ diff --git a/uwp/cs/00_HelloWorld/Assets/SplashScreen.scale-200.png b/uwp/cs/00_HelloWorld/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000..023e7f1 Binary files /dev/null and b/uwp/cs/00_HelloWorld/Assets/SplashScreen.scale-200.png differ diff --git a/uwp/cs/00_HelloWorld/Assets/Square150x150Logo.scale-200.png b/uwp/cs/00_HelloWorld/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000..af49fec Binary files /dev/null and b/uwp/cs/00_HelloWorld/Assets/Square150x150Logo.scale-200.png differ diff --git a/uwp/cs/00_HelloWorld/Assets/Square44x44Logo.scale-200.png b/uwp/cs/00_HelloWorld/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000..ce342a2 Binary files /dev/null and b/uwp/cs/00_HelloWorld/Assets/Square44x44Logo.scale-200.png differ diff --git a/uwp/cs/00_HelloWorld/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/uwp/cs/00_HelloWorld/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000..f6c02ce Binary files /dev/null and b/uwp/cs/00_HelloWorld/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/uwp/cs/00_HelloWorld/Assets/StoreLogo.png b/uwp/cs/00_HelloWorld/Assets/StoreLogo.png new file mode 100644 index 0000000..7385b56 Binary files /dev/null and b/uwp/cs/00_HelloWorld/Assets/StoreLogo.png differ diff --git a/uwp/cs/00_HelloWorld/Assets/Wide310x150Logo.scale-200.png b/uwp/cs/00_HelloWorld/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000..288995b Binary files /dev/null and b/uwp/cs/00_HelloWorld/Assets/Wide310x150Logo.scale-200.png differ diff --git a/uwp/cs/00_HelloWorld/MainPage.xaml b/uwp/cs/00_HelloWorld/MainPage.xaml new file mode 100644 index 0000000..2165b3f --- /dev/null +++ b/uwp/cs/00_HelloWorld/MainPage.xaml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/uwp/cs/00_HelloWorld/MainPage.xaml.cs b/uwp/cs/00_HelloWorld/MainPage.xaml.cs new file mode 100644 index 0000000..434dc16 --- /dev/null +++ b/uwp/cs/00_HelloWorld/MainPage.xaml.cs @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2010-2020 Belledonne Communications SARL. + * + * This file is part of Linphone TutorialCS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using Linphone; +using System; +using System.Diagnostics; +using System.IO; +using System.Text; +using Windows.UI.Xaml.Controls; + +namespace _00_HelloWorld +{ + /// + /// A really simple page to do a "HelloWorld" with LinphoneSDK x UWP + /// + public sealed partial class MainPage : Page + { + private Core StoredCore { get; set; } + + private LoggingService LoggingService { get; set; } + + public string HelloText { get; set; } = "Hello world, Linphone core version is "; + + public MainPage() + { + this.InitializeComponent(); + + // Core is the main object of the SDK. You can't do much without it + + // Some configuration can be done before the Core is created, for example enable debug logs. + LoggingService = LoggingService.Instance; + LoggingService.LogLevel = LogLevel.Debug; + // And here you set the implementation of the delegate method called every time the Linphone SDK log something, see OnLog. + LoggingService.Listener.OnLogMessageWritten = OnLog; + + // To create a Core, we need the instance of the Factory. + Factory factory = Factory.Instance; + + // Some configuration can be done on the factory before the Core is created, for example enable setting resources Path. This + // one is mandatory + string assetsPath = Path.Combine(Windows.ApplicationModel.Package.Current.InstalledLocation.Path, "share"); + factory.TopResourcesDir = assetsPath; + factory.DataResourcesDir = assetsPath; + factory.SoundResourcesDir = Path.Combine(assetsPath, "sounds", "linphone"); + factory.RingResourcesDir = Path.Combine(factory.SoundResourcesDir, "rings"); + factory.ImageResourcesDir = Path.Combine(assetsPath, "images"); + factory.MspluginsDir = "."; + + // Your Core can use up to 2 configuration files, but that isn't mandatory. + // The third parameter is the application context, he isn't mandatory when working + // with UWP, he is mandatory in an Android context for example. + // You can now create your Core object : + Core core = factory.CreateCore("", "", IntPtr.Zero); + + // Once you got your core you can start to do a lot of things. + HelloText += Core.Version; + + // You should store the Core to keep a reference on it at all times while your app is alive. + // A good solution for that is either subclass the Application object or create a Service. + StoredCore = core; + } + + /// + /// Simple function to console log everything the Linphone SDK logs. + /// You should modify this method to match your logging habits. + /// + private void OnLog(LoggingService logService, string domain, LogLevel lev, string message) + { + StringBuilder builder = new StringBuilder(); + _ = builder.Append("Linphone-[").Append(lev.ToString()).Append("](").Append(domain).Append(")").Append(message); + Debug.WriteLine(builder.ToString()); + } + } +} \ No newline at end of file diff --git a/uwp/cs/00_HelloWorld/Package.appxmanifest b/uwp/cs/00_HelloWorld/Package.appxmanifest new file mode 100644 index 0000000..aefe7f0 --- /dev/null +++ b/uwp/cs/00_HelloWorld/Package.appxmanifest @@ -0,0 +1,54 @@ + + + + + + + + + + 00_HelloWorld + Anthony + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + UTF-8 + + + + + + + + \ No newline at end of file diff --git a/uwp/cs/00_HelloWorld/Properties/AssemblyInfo.cs b/uwp/cs/00_HelloWorld/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..73711ce --- /dev/null +++ b/uwp/cs/00_HelloWorld/Properties/AssemblyInfo.cs @@ -0,0 +1,28 @@ +using System.Reflection; +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("00_HelloWorld")] +[assembly: AssemblyDescription("Hello world C# tutorial with LinphoneSDK")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Belledonne Communications")] +[assembly: AssemblyProduct("Linphone")] +[assembly: AssemblyCopyright("Copyright © 2020 Belledonne Communications")] +[assembly: AssemblyTrademark("Linphone")] +[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)] \ No newline at end of file diff --git a/uwp/cs/00_HelloWorld/Properties/Default.rd.xml b/uwp/cs/00_HelloWorld/Properties/Default.rd.xml new file mode 100644 index 0000000..76edee8 --- /dev/null +++ b/uwp/cs/00_HelloWorld/Properties/Default.rd.xml @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/uwp/cs/00_HelloWorld/Readme.md b/uwp/cs/00_HelloWorld/Readme.md new file mode 100644 index 0000000..4ff2ab0 --- /dev/null +++ b/uwp/cs/00_HelloWorld/Readme.md @@ -0,0 +1,21 @@ +Linphone X UWP tutorial 00_HelloWorld +====================================== + +The first tutorial is just here to display a hello world app with the current Linphone's version number. + +Don't forget to install those NuGet packages : + - LinphoneSDK (can be found here : https://www.linphone.org/snapshots/windows/sdk/) + - Microsoft.NETCore.UniversalWindowsPlatform (version 6.2.12 recommended) + +Main files : +``` +00_HelloWorld +│ README.md : you are here +│ App.xaml(.cs) : Default Windows Application file, nothing special here +│ MainPage.xaml(.cs) : This is were the magic happen, +│ jump into this file to learn about Linphone core creation and how to display a hello world. +│ +└───Assets : default UWP app assets + │ LockScreenLogo.scale-200.png + │ ... +``` \ No newline at end of file diff --git a/uwp/cs/01_AccountLogin/01_AccountLogin.csproj b/uwp/cs/01_AccountLogin/01_AccountLogin.csproj new file mode 100644 index 0000000..b558eef --- /dev/null +++ b/uwp/cs/01_AccountLogin/01_AccountLogin.csproj @@ -0,0 +1,174 @@ + + + + + Debug + x86 + {E275B25F-D5C2-495C-9B6E-9B90C3617E98} + AppContainerExe + Properties + _01_AccountLogin + 01_AccountLogin + en-US + UAP + 10.0.17763.0 + 10.0.17763.0 + 14 + 512 + {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + true + false + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x86 + false + prompt + true + + + bin\x86\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x86 + false + prompt + true + true + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + ARM + false + prompt + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + ARM + false + prompt + true + true + + + true + bin\ARM64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + ARM64 + false + prompt + true + true + + + bin\ARM64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + ARM64 + false + prompt + true + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x64 + false + prompt + true + + + bin\x64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x64 + false + prompt + true + true + + + PackageReference + + + + App.xaml + + + MainPage.xaml + + + + + + Designer + + + + + + + + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + 5.1.0-alpha.56 + + + 6.2.11 + + + + + + + 14.0 + + + + \ No newline at end of file diff --git a/uwp/cs/01_AccountLogin/App.xaml b/uwp/cs/01_AccountLogin/App.xaml new file mode 100644 index 0000000..3783e3b --- /dev/null +++ b/uwp/cs/01_AccountLogin/App.xaml @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/uwp/cs/01_AccountLogin/App.xaml.cs b/uwp/cs/01_AccountLogin/App.xaml.cs new file mode 100644 index 0000000..456f646 --- /dev/null +++ b/uwp/cs/01_AccountLogin/App.xaml.cs @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2010-2020 Belledonne Communications SARL. + * + * This file is part of Linphone TutorialCS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using System; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Navigation; + +namespace _01_AccountLogin +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + sealed partial class App : Application + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + this.Suspending += OnSuspending; + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// + /// Details about the launch request and process. + protected override void OnLaunched(LaunchActivatedEventArgs e) + { + Frame rootFrame = Window.Current.Content as Frame; + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (rootFrame == null) + { + // Create a Frame to act as the navigation context and navigate to the first page + rootFrame = new Frame(); + + rootFrame.NavigationFailed += OnNavigationFailed; + + if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) + { + //TODO: Load state from previously suspended application + } + + // Place the frame in the current Window + Window.Current.Content = rootFrame; + } + + if (e.PrelaunchActivated == false) + { + if (rootFrame.Content == null) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame.Navigate(typeof(MainPage), e.Arguments); + } + // Ensure the current window is active + Window.Current.Activate(); + } + } + + /// + /// Invoked when Navigation to a certain page fails + /// + /// The Frame which failed navigation + /// Details about the navigation failure + private void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new Exception("Failed to load Page " + e.SourcePageType.FullName); + } + + /// + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// + /// The source of the suspend request. + /// Details about the suspend request. + private void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + //TODO: Save application state and stop any background activity + deferral.Complete(); + } + } +} \ No newline at end of file diff --git a/uwp/cs/01_AccountLogin/Assets/LockScreenLogo.scale-200.png b/uwp/cs/01_AccountLogin/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000..735f57a Binary files /dev/null and b/uwp/cs/01_AccountLogin/Assets/LockScreenLogo.scale-200.png differ diff --git a/uwp/cs/01_AccountLogin/Assets/SplashScreen.scale-200.png b/uwp/cs/01_AccountLogin/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000..023e7f1 Binary files /dev/null and b/uwp/cs/01_AccountLogin/Assets/SplashScreen.scale-200.png differ diff --git a/uwp/cs/01_AccountLogin/Assets/Square150x150Logo.scale-200.png b/uwp/cs/01_AccountLogin/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000..af49fec Binary files /dev/null and b/uwp/cs/01_AccountLogin/Assets/Square150x150Logo.scale-200.png differ diff --git a/uwp/cs/01_AccountLogin/Assets/Square44x44Logo.scale-200.png b/uwp/cs/01_AccountLogin/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000..ce342a2 Binary files /dev/null and b/uwp/cs/01_AccountLogin/Assets/Square44x44Logo.scale-200.png differ diff --git a/uwp/cs/01_AccountLogin/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/uwp/cs/01_AccountLogin/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000..f6c02ce Binary files /dev/null and b/uwp/cs/01_AccountLogin/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/uwp/cs/01_AccountLogin/Assets/StoreLogo.png b/uwp/cs/01_AccountLogin/Assets/StoreLogo.png new file mode 100644 index 0000000..7385b56 Binary files /dev/null and b/uwp/cs/01_AccountLogin/Assets/StoreLogo.png differ diff --git a/uwp/cs/01_AccountLogin/Assets/Wide310x150Logo.scale-200.png b/uwp/cs/01_AccountLogin/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000..288995b Binary files /dev/null and b/uwp/cs/01_AccountLogin/Assets/Wide310x150Logo.scale-200.png differ diff --git a/uwp/cs/01_AccountLogin/MainPage.xaml b/uwp/cs/01_AccountLogin/MainPage.xaml new file mode 100644 index 0000000..8d98246 --- /dev/null +++ b/uwp/cs/01_AccountLogin/MainPage.xaml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + +