-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Azure] add Windows8 Azure sample code (for reference, with minor edits)
- Loading branch information
1 parent
090414e
commit c3d3ab2
Showing
16 changed files
with
1,624 additions
and
20 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
|
||
*.pidb | ||
*.userprefs | ||
*.swp | ||
*.DS_Store | ||
*.nib | ||
*.suo | ||
|
||
*/bin/* | ||
*/obj/* | ||
*/*/bin/* | ||
*/*/obj/* | ||
|
||
bin/* | ||
obj/* | ||
bin/* | ||
obj/* | ||
|
||
*/Resource.designer.cs | ||
*/*/Resource.designer.cs | ||
|
||
*.pidb | ||
*.userprefs | ||
*.swp | ||
*.DS_Store | ||
*.nib | ||
*.suo | ||
Thumbs.db | ||
|
||
*/bin/* | ||
*/obj/* | ||
*/*/bin/* | ||
*/*/obj/* | ||
|
||
bin/* | ||
obj/* | ||
bin/* | ||
obj/* | ||
|
||
*/Resource.designer.cs | ||
*/*/Resource.designer.cs | ||
*/*/*/Resource.designer.cs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Application | ||
x:Class="TaskyAzure.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:TaskyAzure" RequestedTheme="Light"> | ||
|
||
<Application.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
|
||
<!-- | ||
Styles that define common aspects of the platform look and feel | ||
Required by Visual Studio project and item templates | ||
--> | ||
<ResourceDictionary Source="Common/StandardStyles.xaml"/> | ||
</ResourceDictionary.MergedDictionaries> | ||
|
||
</ResourceDictionary> | ||
</Application.Resources> | ||
</Application> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using Microsoft.WindowsAzure.MobileServices; | ||
using Windows.ApplicationModel; | ||
using Windows.ApplicationModel.Activation; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
namespace TaskyAzure | ||
{ | ||
/// <summary> | ||
/// Provides application-specific behavior to supplement the default Application class. | ||
/// </summary> | ||
sealed partial class App : Application | ||
{ | ||
const string subdomain = "xxxxxx"; // your subdomain | ||
const string MobileServiceAppId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // your application id | ||
|
||
// This MobileServiceClient has been configured to communicate with your Mobile Service's url | ||
// and application key. You're all set to start working with your Mobile Service! | ||
public static MobileServiceClient MobileService = new MobileServiceClient( | ||
"https://" + subdomain + ".azure-mobile.net/", | ||
MobileServiceAppId | ||
); | ||
|
||
/// <summary> | ||
/// Initializes the singleton application object. This is the first line of authored code | ||
/// executed, and as such is the logical equivalent of main() or WinMain(). | ||
/// </summary> | ||
public App() | ||
{ | ||
this.InitializeComponent(); | ||
this.Suspending += OnSuspending; | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when the application is launched normally by the end user. Other entry points | ||
/// will be used when the application is launched to open a specific file, to display | ||
/// search results, and so forth. | ||
/// </summary> | ||
/// <param name="args">Details about the launch request and process.</param> | ||
protected override void OnLaunched(LaunchActivatedEventArgs args) | ||
{ | ||
// Do not repeat app initialization when already running, just ensure that | ||
// the window is active | ||
if (args.PreviousExecutionState == ApplicationExecutionState.Running) | ||
{ | ||
Window.Current.Activate(); | ||
return; | ||
} | ||
|
||
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) | ||
{ | ||
//TODO: Load state from previously suspended application | ||
} | ||
|
||
// Create a Frame to act navigation context and navigate to the first page | ||
var rootFrame = new Frame(); | ||
if (!rootFrame.Navigate(typeof(MainPage))) | ||
{ | ||
throw new Exception("Failed to create initial page"); | ||
} | ||
|
||
// Place the frame in the current Window and ensure that it is active | ||
Window.Current.Content = rootFrame; | ||
Window.Current.Activate(); | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when application execution is being suspended. Application state is saved | ||
/// without knowing whether the application will be terminated or resumed with the contents | ||
/// of memory still intact. | ||
/// </summary> | ||
/// <param name="sender">The source of the suspend request.</param> | ||
/// <param name="e">Details about the suspend request.</param> | ||
private void OnSuspending(object sender, SuspendingEventArgs e) | ||
{ | ||
var deferral = e.SuspendingOperation.GetDeferral(); | ||
//TODO: Save application state and stop any background activity | ||
deferral.Complete(); | ||
} | ||
} | ||
} |
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.
Oops, something went wrong.