src/K4W.KinectVOD.Client.WinStore/App.xaml.cs
/// <summary>
/// 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.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
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.
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 .
protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;
            if (rootFrame == null)
            {
                rootFrame = new Frame();
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
                rootFrame.NavigationFailed += OnNavigationFailed;
                Window.Current.Content = rootFrame;
            }
            if (string.IsNullOrEmpty(e.Arguments))
            {
                await RegisterPushNotifications("kinect-VOD-tutorial",
                                                "Endpoint=sb://kinect-demo.servicebus.windows.net/;SharedAccessKeyName=ListenPolicy;SharedAccessKey=KWaGKpa38A7ymRLDk/7qpTpZmla3nfmWN1AWto2R3zY=",
                                                "new-video-template",
                                                string.Format("$({0})", "RecordingData"),
                                                "New recorded video",
                                                string.Format("$({0})", "Caption"),
                                                "http://www.kinectingforwindows.com/images/notification_logo.png");
                rootFrame.Navigate(typeof(MainPage));
            }
            else
            {
                RecordingData data = e.Arguments.DeserializeFromJson<RecordingData>();
                if (_recordingHistory == null)
                    _recordingHistory = await LocalStorageHelper.LoadFileContentAsync<ObservableCollection<RecordingData>>(RecordingFileName) ??
                                        new ObservableCollection<RecordingData>();
                _recordingHistory.Add(data);
                await LocalStorageHelper.SaveFileContentAsync(RecordingFileName, _recordingHistory);
                rootFrame.Navigate(typeof(VideoPage), data);
            }
            Window.Current.Activate();
        }
protected override async void OnLaunched ( LaunchActivatedEventArgs e ) { Frame rootFrame = Window . Current . Content as Frame ; if ( rootFrame == null ) { rootFrame = new Frame ( ) ; rootFrame . Language = Windows . Globalization . ApplicationLanguages . Languages [ 0 ] ; rootFrame . NavigationFailed += OnNavigationFailed ; Window . Current . Content = rootFrame ; } if ( string . IsNullOrEmpty ( e . Arguments ) ) { await RegisterPushNotifications ( " " , " " , " " , string . Format ( " " , " " ) , " " , string . Format ( " " , " " ) , " " ) ; rootFrame . Navigate ( typeof ( MainPage ) ) ; } else { RecordingData data = e . Arguments . DeserializeFromJson < RecordingData > ( ) ; if ( _recordingHistory == null ) _recordingHistory = await LocalStorageHelper . LoadFileContentAsync < ObservableCollection < RecordingData > > ( RecordingFileName ) ?? new ObservableCollection < RecordingData > ( ) ; _recordingHistory . Add ( data ) ; await LocalStorageHelper . SaveFileContentAsync ( RecordingFileName , _recordingHistory ) ; rootFrame . Navigate ( typeof ( VideoPage ) , data ) ; } Window . Current . Activate ( ) ; }
Invoked when the application is launched normally by the end user.
Invoked when the application is launched normally by the end user .
// Do not repeat app initialization when the Window already has content, // just ensure that the window is active // Create a Frame to act as the navigation context and navigate to the first page // Set the default language // Place the frame in the current Window // Switching decision between pages // Register for notifications // Navigate to the overview page // Deserialize to RD // Load recording history on first run // Add to the list // Save the new list locally // Navigate to the video page // Ensure the current window is active
e
LaunchActivatedEventArgs
Details about the launch request and process.
Details about the launch request and process .