private void RegisterForAppEvents() { appSuspendEventHandler = new SuspendingEventHandler(DeviceEventHandler.Current.OnAppSuspension); appResumeEventHandler = new EventHandler <Object>(DeviceEventHandler.Current.OnAppResume); App.Current.Suspending += appSuspendEventHandler; App.Current.Resuming += appResumeEventHandler; }
protected override void OnNavigatedTo(NavigationEventArgs e) { _viewModel = new DatasetEventsViewModel(e.Parameter as Dataset); _appSuspendHandler = new SuspendingEventHandler(App_Suspending); Application.Current.Suspending += _appSuspendHandler; base.OnNavigatedTo(e); }
private void UnregisterFromAppEvents() { App.Current.Suspending -= appSuspendEventHandler; appSuspendEventHandler = null; App.Current.Resuming -= appResumeEventHandler; appResumeEventHandler = null; }
private void UnregisterFromAppEvents() { // This event is raised when the app is exited and when the app is suspended Application.Current.Suspending -= appSuspendEventHandler; appSuspendEventHandler = null; Application.Current.Resuming -= appResumeEventHandler; appResumeEventHandler = null; }
private void StartHandlingAppEvents() { appSuspendEventHandler = new SuspendingEventHandler(this.OnAppSuspension); appResumeEventHandler = new EventHandler <Object>(this.OnAppResume); App.Current.Suspending += appSuspendEventHandler; App.Current.Resuming += appResumeEventHandler; }
private void StartHandlingAppEvents() { appSuspendEventHandler = new SuspendingEventHandler(OnAppSuspension); appResumeEventHandler = new EventHandler <object>(OnAppResume); // This event is raised when the app is exited and when the app is suspended Application.Current.Suspending += appSuspendEventHandler; Application.Current.Resuming += appResumeEventHandler; }
private void UnregisterFromAppEvents() { // This event is raised when the app is exited and when the app is suspended CallerApp.Suspending -= appSuspendEventHandler; appSuspendEventHandler = null; CallerApp.Resuming -= appResumeEventHandler; appResumeEventHandler = null; }
/// <summary> /// Register for app suspension/resume events /// </summary> private void RegisterForAppEvents() { _appSuspendEventHandler = new SuspendingEventHandler(this.OnAppSuspension); _appResumeEventHandler = new EventHandler <Object>(this.OnAppResume); // This event is raised when the app is exited and when the app is suspended App.Current.Suspending += _appSuspendEventHandler; App.Current.Resuming += _appResumeEventHandler; }
/// <summary> /// Register for app suspension/resume events. See the comments /// for the event handlers for more information on the exact device operation performed. /// /// We will also register for when the app exists so that we may close the device handle. /// </summary> private void RegisterForAppEvents() { appSuspendEventHandler = new SuspendingEventHandler(EventHandlerForDevice.Current.OnAppSuspension); appResumeEventHandler = new EventHandler <Object>(EventHandlerForDevice.Current.OnAppResume); // This event is raised when the app is exited and when the app is suspended //App.Current.Suspending += appSuspendEventHandler; //App.Current.Resuming += appResumeEventHandler; }
//Registro y desregistro para los eventos de la app (Suspending y Resuming) private void RegisterForAppEvents() { //Inicializa los eventos para la suspencion y reanudación de la app appSuspendEventHandler = new SuspendingEventHandler(Current.OnAppSuspension); appResumeEventHandler = new EventHandler <object>(Current.OnAppResumen); //Los eventos son lanzados cuando se cierra la app o se supende App.Current.Suspending += appSuspendEventHandler; App.Current.Resuming += appResumeEventHandler; }
/// <summary> /// Register for app suspension/resume events. See the comments /// for the event handlers for more information on what is being done to the device. /// /// We will also register for when the app exists so that we may close the device handle. /// </summary> private void RegisterForAppEvents() { appSuspendEventHandler = new SuspendingEventHandler(Current.OnAppSuspension); appResumeEventHandler = new EventHandler <object>(Current.OnAppResume); // This event is raised when the app is exited and when the app is suspended CallerApp.Suspending += appSuspendEventHandler; CallerApp.Resuming += appResumeEventHandler; }
private void StartHandlingAppEvents() { _appSuspendEventHandler = OnAppSuspension; _appResumeEventHandler = OnAppResume; // This event is raised when the app is exited and when the app is suspended Application.Current.Suspending += _appSuspendEventHandler; Application.Current.Resuming += _appResumeEventHandler; }
/// <summary> /// Closes the device, stops the device watcher, stops listening for app events, and resets object state to before a device /// was ever connected. /// </summary> public void CloseDevice() { if (IsDeviceConnected) { CloseCurrentlyConnectedDevice(); } if (deviceWatcher != null) { if (watcherStarted) { StopDeviceWatcher(); UnregisterFromDeviceWatcherEvents(); } deviceWatcher = null; } if (deviceAccessInformation != null) { UnregisterFromDeviceAccessStatusChange(); deviceAccessInformation = null; } if (appSuspendEventHandler != null || appResumeEventHandler != null) { UnregisterFromAppEvents(); } deviceInformation = null; deviceSelector = null; deviceConnectedCallback = null; deviceCloseCallback = null; appSuspendCallback = null; isEnabledAutoReconnect = true; }
private void UnregisterFromAppEvents() { // This event is raised when the app is exited and when the app is suspended App.Current.Suspending -= appSuspendEventHandler; appSuspendEventHandler = null; App.Current.Resuming -= appResumeEventHandler; appResumeEventHandler = null; }
/// <summary> /// Register for app suspension/resume events. See the comments /// for the event handlers for more information on what is being done to the device. /// /// We will also register for when the app exists so that we may close the device handle. /// </summary> private void RegisterForAppEvents() { appSuspendEventHandler = new SuspendingEventHandler(EventHandlerForDevice.Current.OnAppSuspension); appResumeEventHandler = new EventHandler<Object>(EventHandlerForDevice.Current.OnAppResume); // This event is raised when the app is exited and when the app is suspended App.Current.Suspending += appSuspendEventHandler; App.Current.Resuming += appResumeEventHandler; }
private void StartHandlingAppEvents() { appSuspendEventHandler = new SuspendingEventHandler(this.OnAppSuspension); appResumeEventHandler = new EventHandler<Object>(this.OnAppResume); // This event is raised when the app is exited and when the app is suspended App.Current.Suspending += appSuspendEventHandler; App.Current.Resuming += appResumeEventHandler; }