Skip to content

Commit 2aaad66

Browse files
authored
UWP and iOS sample changes added
1 parent d4182a9 commit 2aaad66

File tree

60 files changed

+820
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+820
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Application
2+
x:Class="SfListViewSample.UWP.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:local="using:SfListViewSample.UWP"
6+
RequestedTheme="Light">
7+
8+
</Application>
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Runtime.InteropServices.WindowsRuntime;
6+
using Windows.ApplicationModel;
7+
using Windows.ApplicationModel.Activation;
8+
using Windows.Foundation;
9+
using Windows.Foundation.Collections;
10+
using Windows.UI.Xaml;
11+
using Windows.UI.Xaml.Controls;
12+
using Windows.UI.Xaml.Controls.Primitives;
13+
using Windows.UI.Xaml.Data;
14+
using Windows.UI.Xaml.Input;
15+
using Windows.UI.Xaml.Media;
16+
using Windows.UI.Xaml.Navigation;
17+
18+
namespace SfListViewSample.UWP
19+
{
20+
/// <summary>
21+
/// Provides application-specific behavior to supplement the default Application class.
22+
/// </summary>
23+
sealed partial class App : Application
24+
{
25+
/// <summary>
26+
/// Initializes the singleton application object. This is the first line of authored code
27+
/// executed, and as such is the logical equivalent of main() or WinMain().
28+
/// </summary>
29+
public App()
30+
{
31+
this.InitializeComponent();
32+
this.Suspending += OnSuspending;
33+
}
34+
35+
/// <summary>
36+
/// Invoked when the application is launched normally by the end user. Other entry points
37+
/// will be used such as when the application is launched to open a specific file.
38+
/// </summary>
39+
/// <param name="e">Details about the launch request and process.</param>
40+
protected override void OnLaunched(LaunchActivatedEventArgs e)
41+
{
42+
43+
44+
Frame rootFrame = Window.Current.Content as Frame;
45+
46+
// Do not repeat app initialization when the Window already has content,
47+
// just ensure that the window is active
48+
if (rootFrame == null)
49+
{
50+
// Create a Frame to act as the navigation context and navigate to the first page
51+
rootFrame = new Frame();
52+
53+
rootFrame.NavigationFailed += OnNavigationFailed;
54+
55+
Xamarin.Forms.Forms.Init(e);
56+
57+
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
58+
{
59+
//TODO: Load state from previously suspended application
60+
}
61+
62+
// Place the frame in the current Window
63+
Window.Current.Content = rootFrame;
64+
}
65+
66+
if (rootFrame.Content == null)
67+
{
68+
// When the navigation stack isn't restored navigate to the first page,
69+
// configuring the new page by passing required information as a navigation
70+
// parameter
71+
rootFrame.Navigate(typeof(MainPage), e.Arguments);
72+
}
73+
// Ensure the current window is active
74+
Window.Current.Activate();
75+
}
76+
77+
/// <summary>
78+
/// Invoked when Navigation to a certain page fails
79+
/// </summary>
80+
/// <param name="sender">The Frame which failed navigation</param>
81+
/// <param name="e">Details about the navigation failure</param>
82+
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
83+
{
84+
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
85+
}
86+
87+
/// <summary>
88+
/// Invoked when application execution is being suspended. Application state is saved
89+
/// without knowing whether the application will be terminated or resumed with the contents
90+
/// of memory still intact.
91+
/// </summary>
92+
/// <param name="sender">The source of the suspend request.</param>
93+
/// <param name="e">Details about the suspend request.</param>
94+
private void OnSuspending(object sender, SuspendingEventArgs e)
95+
{
96+
var deferral = e.SuspendingOperation.GetDeferral();
97+
//TODO: Save application state and stop any background activity
98+
deferral.Complete();
99+
}
100+
}
101+
}
6 KB
Loading
13.6 KB
Loading
30.8 KB
Loading
1.19 KB
Loading
2.48 KB
Loading
5.44 KB
Loading
6.4 KB
Loading
14.9 KB
Loading

0 commit comments

Comments
 (0)