Пример #1
0
 private void OnClosed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     if (Window.Current.Content is RootPage root)
     {
         root.PopupClosed();
     }
 }
Пример #2
0
 private static void ActiveDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     if (!DialogAwaiter.Task.IsCompleted)
     {
         DialogAwaiter.TrySetResult(true);
     }
 }
Пример #3
0
 void DevicePickerDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     if (SelectedDevice == null)
     {
         _owner.OnDevicePickerDismissed();
     }
 }
Пример #4
0
 private async void ShowZoneCustomizedDialog(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     addDeviceDialog.Closed -= ShowZoneCustomizedDialog;
     ZoneCustomizedDialog zoneCustomizedDialog =
         new ZoneCustomizedDialog(MyDevice);
     var result = await zoneCustomizedDialog.ShowAsync();
 }
Пример #5
0
 private async void C_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     if (args.Result == ContentDialogResult.Secondary)
     {
         //BooksGridView.ItemsSource = await APIServices.GetBooksAsync();
     }
 }
Пример #6
0
 private async static void FeedbackDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     if (args.Result == ContentDialogResult.Primary)
     {
         await Launcher.LaunchUriAsync(new Uri("mailto:[email protected]?subject=Year%20Progress%20Feedback&body=<Write%20your%20feedback%20here>"));
     }
 }
Пример #7
0
 void DevicePickerDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     if (SelectedDevice == null)
     {
         _owner.OnDevicePickerDismissed();
     }
 }
Пример #8
0
 /// <summary>
 /// Recover navigation view selected item after settings dialog closed.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SettingsDialogClosed(ContentDialog sender, ContentDialogClosedEventArgs e)
 {
     if (lastSelectedItem != null)
     {
         NavigationViewControl.SelectedItem = lastSelectedItem;
     }
 }
Пример #9
0
        private void Dialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
        {
            var procedureResult = (sender as BleDeviceSelectorDialog).Result;

            GyroscopeRfcommServiceConnection = new GyroscopeRfcommServiceConnectionWrapper(procedureResult[GyroscopeRfcommServiceConnectionWrapper.RfcommServiceId].RfcommConnection);
            GyroscopeRfcommServiceConnection.OnReadingUpdated += GyroscopeRfcommServiceConnection_OnReadingUpdated;
        }
Пример #10
0
 private void OnLoginDialogClosed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     if (Result == null)
     {
         Result = LoginDialogResult.Cancel;
     }
 }
        void dialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
        {
            KnjigaDetaljiViewModel model2 = (KnjigaDetaljiViewModel)defaultViewModel["detalji"];

            HttpResponseMessage response = knjigaDetaljiService.GetResponse(model2.KnjigaID + "/" + Global.prijavljeniKorisnik.Id);

            if (response.IsSuccessStatusCode)
            {
                KnjigaDetaljiViewModel model = response.Content.ReadAsAsync <KnjigaDetaljiViewModel>().Result;
                defaultViewModel["detalji"] = model;

                if (model.IsInPolica)
                {
                    dodajBtn.Visibility  = Visibility.Collapsed;
                    ukloniBtn.Visibility = Visibility.Visible;
                }
                else
                {
                    dodajBtn.Visibility  = Visibility.Visible;
                    ukloniBtn.Visibility = Visibility.Collapsed;
                }

                HttpResponseMessage r = reklamaService.GetResponse();

                if (r.IsSuccessStatusCode)
                {
                    Reklama reklama = r.Content.ReadAsAsync <Reklama>().Result;
                    reklamaS.Source = new BitmapImage(new Uri(reklama.URL, UriKind.Absolute));
                }
            }
        }
        private void OnDialogClosed(ContentDialog sender, ContentDialogClosedEventArgs args)
        {
            this.LoginWebView.LoadCompleted      -= OnWebViewLoadCompleted;
            this.LoginWebView.NavigationStarting -= OnWebViewNavigationStarting;

            this.ViewModel.Dispose();
            this.DataContext = null;
        }
Пример #13
0
 private static void Dlg_Closed( ContentDialog sender, ContentDialogClosedEventArgs args )
 {
     sender.Closed -= Dlg_Closed;
     if( sender is IDisposable )
     {
         ( sender as IDisposable ).Dispose();
     }
 }
Пример #14
0
 private async void OnDialogClosed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     sender.Closed -= OnDialogClosed;
     isDialogOpened = false;
     if (dialogQueue != null && dialogQueue.Count > 0)
     {
         await DisplayContentDialog(dialogQueue.Dequeue());
     }
 }
        private void Dialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
        {
            Window.Current.CoreWindow.SizeChanged -= this.CoreWindow_SizeChanged;

            foreach (var overlay in this.overlays)
            {
                overlay.Visibility = Visibility.Collapsed;
            }
        }
Пример #16
0
 private void OnClosed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     currentViewItem     = null;
     Title               = "Create New";
     configLabel.Content = "Config Name: ";
     authorNameTxt.Text  = "";
     websiteNameTxt.Text = "";
     configNameTxt.Text  = "";
     successKeysTxt.Text = "";
 }
Пример #17
0
 private void PropertiesDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     AppSettings.ThemeModeChanged -= AppSettings_ThemeModeChanged;
     sender.Closed -= PropertiesDialog_Closed;
     if (tokenSource != null && !tokenSource.IsCancellationRequested)
     {
         tokenSource.Cancel();
         tokenSource = null;
     }
     propertiesDialog.Hide();
 }
Пример #18
0
        private static async void DialogOnClosedAsync(ContentDialog sender, ContentDialogClosedEventArgs args)
        {
            if (_dialogQueue.Count == 0)
            {
                _dialogLock = false;
                return;
            }

            var next = _dialogQueue.Dequeue();
            await next.ShowAsync();
        }
 private void ContentDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     if (args.Result == ContentDialogResult.Primary)
     {
         ViewModel.AcceptCommand.Execute(null);
     }
     else
     {
         ViewModel.CancelCommand.Execute(null);
     }
 }
        private void ContentDialogOnClosed(ContentDialog sender, ContentDialogClosedEventArgs args)
        {
            sender.Closed -= ContentDialogOnClosed;
            var signInDialog = sender.Content as SignInDialog;

            if (signInDialog != null)
            {
                signInDialog.Cancel(); // be sure the SignInDialog is deactivated when pressing back button
                sender.Content = null;
            }
        }
Пример #21
0
 private static void ActiveDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     try
     {
         _dialogAwaiter.SetResult(true);
     }
     catch (Exception)
     {
         // Ignore
     }
 }
Пример #22
0
 //Since process is async if a user signs in and then exits the dialog, a post may still be created
 //So this is just a warning explaining that
 private async void ContentDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     if (shareCancelled)
     {
         var dialog = new WarningDialog();
         dialog.Title             = "Share";
         dialog.Text              = "Share Cancelled. If you signed into your social media account, a post may have still been created";
         dialog.PrimaryButtonText = "";
         await dialog.ShowAsync();
     }
 }
Пример #23
0
 private void PropertiesDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     AppSettings.ThemeModeChanged -= AppSettings_ThemeModeChanged;
     sender.Closed -= PropertiesDialog_Closed;
     this.FindDescendants().Where(x => x is SettingsBlockControl).Cast <SettingsBlockControl>().Select(x => (x.ExpandableContent as Frame).Content as PropertiesTab).Where(x => x != null).ForEach(tab => tab.Dispose());
     if (tokenSource != null && !tokenSource.IsCancellationRequested)
     {
         tokenSource.Cancel();
         tokenSource = null;
     }
     propertiesDialog.Hide();
 }
Пример #24
0
 private static async void ReviewDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     if (args.Result == ContentDialogResult.Primary)
     {
         RemovePromptsForever();
         await Launcher.LaunchUriAsync(new Uri("ms-windows-store://review/?ProductId=9PDQ5MLJFVSX"));
     }
     else
     {
         await ShowFeedbackDialog();
     }
 }
        private void BleDeviceSelectorDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
        {
            BluetoothManager.LEScanner.Added   -= LEScanner_Added;
            BluetoothManager.LEScanner.Removed -= LEScanner_Removed;
            BluetoothManager.LEScanner.EnumerationCompleted -= LEScanner_EnumerationCompleted;
            BluetoothManager.LEScanner.Stopped -= LEScanner_Stopped;

            if (BluetoothManager.LEScanner.Status == BluetoothLEScannerState.Started || BluetoothManager.LEScanner.Status == BluetoothLEScannerState.EnumerationCompleted)
            {
                BluetoothManager.LEScanner.Stop();
            }
        }
Пример #26
0
        /// <summary>
        /// Whenever the dialog as close continu with operation
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private async void BackupDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
        {
            if (args.Result == ContentDialogResult.Primary)
            {
                //Make a field book bakcup
                await BackupFieldBook();

                DeleteFieldBook();
            }
            else
            {
                DeleteFieldBook();
            }
        }
Пример #27
0
 private void ContentDialogNotification_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     this.isopen                          = false;
     this.Title                           = null;
     this.Content                         = null;
     this.PrimaryButtonText               = "";
     this.PrimaryButtonCommand            = null;
     this.PrimaryButtonCommandParameter   = null;
     this.SecondaryButtonText             = "";
     this.SecondaryButtonCommand          = null;
     this.SecondaryButtonCommandParameter = null;
     this.CloseButtonText                 = "";
     this.DefaultButton                   = ContentDialogButton.None;
 }
        void dialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
        {
            #region lame

            HttpResponseMessage response = hubService.GetResponse(Global.prijavljeniKorisnik.Id.ToString());
            HubPageViewModel    model    = new HubPageViewModel();

            if (response.IsSuccessStatusCode)
            {
                model = new HubPageViewModel(response.Content.ReadAsAsync <HubPageViewModel>().Result);
                defaultViewModel["BookShelves"] = model.BookShelves;
            }

            #endregion
        }
Пример #29
0
        async void EditBulbDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
        {
            LifxLabelMessage llm = await StorageHelper.SelectedBulbs[0].SetLabelCommand(((sender.Content as StackPanel).Children[1] as TextBox).Text);

            StorageHelper.SelectedBulbs[0].Label = llm.BulbLabel;
            StorageHelper.SaveToStorage();

            await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                if (StorageHelper.SelectedType == SelectionType.IndividualBulb)
                {
                    MainPivot.Title = APP_HEADING_TEXT + llm.BulbLabel;
                }
            });
        }
Пример #30
0
        // Event handler for when ContentDialog is closed.
        private static async void Dialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs e)
        {
            // Remove the ContentDialog that has just closed from the queue.
            App.DialogueQueue.RemoveAll(x => x.ContentDialog == sender);

            // Check if there's more ContentDialogs in queue.
            if (App.DialogueQueue.Count > 0)
            {
                var callback = App.DialogueQueue[0].Callback;

                var result = await App.DialogueQueue[0].ContentDialog.ShowAsync();

                // Check if there's any callbacks, and execute if so.
                callback?.DynamicInvoke(result);
            }
        }
Пример #31
0
        /// <summary>
        /// Handles the dialog closed event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void ErrorDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
        {
            //If the user´s search for mail returned null
            if (!MailHandler.isMailSearchSuccess && sender.Title.Equals("Mail error"))
            {
                errorDialog.Closed -= ErrorDialog_Closed;
                errorDialog         = null;
                return;
            }

            //If no mail exists on server, navigate to SettingsPage so that the user can check settings
            if (sender.Title.Equals("Mail error"))
            {
                errorDialog.Closed -= ErrorDialog_Closed;
                errorDialog         = null;
                Frame.Navigate(typeof(SettingsPage));
            }
        }
Пример #32
0
 private void ContentDialogOnClosed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     sender.Closed -= ContentDialogOnClosed;
     var signInDialog = sender.Content as SignInDialog;
     if (signInDialog != null)
     {
         signInDialog.Cancel(); // be sure the SignInDialog is deactivated when pressing back button
         sender.Content = null;
     }
 }
Пример #33
0
 private async void TagsDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     await MainViewModel.Current.SaveTagsAsync();
     await ReloadQuestions();
 }
 private void ContentDialog_Closed (ContentDialog sender, ContentDialogClosedEventArgs args) {
   cancellationTokenSource.Cancel();
 }
Пример #35
0
 private void OnClosed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     this.ViewModel.ContactInvited -= OnContactInvited;
     this.ViewModel.Canceled       -= OnCanceled;
     this.ViewModel.EmailError     -= OnEmailError;
 }
Пример #36
0
 private void AccordDialog_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     if (clickedButton != null)
     {
         clickedButton.Focus(FocusState.Pointer);
     }
 }