Ejemplo n.º 1
0
        private async void ButtonAdd_OnClick(object sender, RoutedEventArgs e)
        {
            var addDialog = new AddDialog();
            var result    = await addDialog.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                var s = ScenarioControl?.SelectedItem as Scenario;
                if (s == null)
                {
                    return;
                }
                ScenarioFrame.Navigate(s.ClassType);
            }
        }
Ejemplo n.º 2
0
        internal async Task <TorrentManager> ShowAsync()
        {
            TorrentManager manager = null;

            await CoreApplication.GetCurrentView().Dispatcher.RunTaskAsync(
                async() =>
            {
                var addDialog = new AddDialog();
                if (await addDialog.ShowAsync() == ContentDialogResult.Primary)
                {
                    manager = addDialog.Manager;
                }
            });

            return(manager);
        }
Ejemplo n.º 3
0
        private async void AddItem_ClickAsync(object sender, RoutedEventArgs e)
        {
            await AddDialog.ShowAsync();

            //var CurrentView = ApplicationView.GetForCurrentView();
            //CoreApplicationView NewView = CoreApplication.CreateNewView();

            //await NewView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            //{
            //    var newWindow = Window.Current;
            //    var newAppView = ApplicationView.GetForCurrentView();
            //    Frame frame = new Frame();
            //    frame.Navigate(typeof(AddItem), null);
            //    Window.Current.Content = frame;
            //    Window.Current.Activate();
            //    await ApplicationViewSwitcher.TryShowAsStandaloneAsync(newAppView.Id, ViewSizePreference.Default, CurrentView.Id, ViewSizePreference.Default);

            //});
        }
        private async void ShowAddContentDialog()
        {
            var dialog = new AddDialog("Add command");
            ContentDialogResult result = await dialog.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                this.ViewModel.Commands.Add(new CustomCommand()
                {
                    Name         = dialog.result[0],
                    Example      = dialog.result[1],
                    ListenFor    = dialog.result[2],
                    Feedback     = dialog.result[3],
                    BatchCommand = dialog.result[4]
                });
            }
            else
            {
            }
        }
Ejemplo n.º 5
0
 private async void AddItem_ClickAsync(object sender, RoutedEventArgs e)
 {
     await AddDialog.ShowAsync();
 }
Ejemplo n.º 6
0
 private async void SaveBtn_Click(object sender, RoutedEventArgs e)
 {
     await AddDialog.ShowAsync();
 }