private void ShowView()
        {
            OptionWindow option = new OptionWindow();

            option.DataContext = this;
            option.ShowDialog();
        }
Exemple #2
0
        private void MenuItemOption_Click(object sender, RoutedEventArgs e)
        {
            OptionWindow opWindow = new OptionWindow(grid.ColumnDefinitions[0].Width.Value, grid.RowDefinitions[0].Height.Value, elementBehaviour, wireBehaviour, isGrid);
            bool?        result   = opWindow.ShowDialog();

            if (opWindow.isPressedOk == true)
            {
                cgc.ResetColumn();
                cgc.ResetRow();

                cgc.AddColumn(opWindow.slider.Value, 12 * 8);
                cgc.AddRow(opWindow.slider_Copy.Value, 7 * 5);

                hgc.UpdateIndicatorSize();
                hgc.UpdateHighlightorSize();

                elementBehaviour = opWindow.GetElementBehaviour();
                wireBehaviour    = opWindow.GetWireBehaviour();

                isGrid = opWindow.GetIsShowGrid();

                if (!isGrid)
                {
                    cgc.RemoveGridLines();
                }
                else
                {
                    cgc.CreateGridLines();
                }
            }
        }
        public static void ShowOptionWindow()
        {
            var option = new OptionWindow();

            option.Owner = Application.Current.MainWindow;
            option.ShowDialog();
        }
Exemple #4
0
        private void OpenOptionWindow(object parameter)
        {
            OptionWindow optionWindow = new OptionWindow(this)
            {
                Owner = mainWindow
            };

            optionWindow.ShowDialog();
        }
        private void btnOptions_Click(object sender, RoutedEventArgs e)
        {
            Button       advancedButton = (Button)sender;
            OptionWindow optionWindow   = new OptionWindow("", (ServerSchema)advancedButton.DataContext);
            //optionWindow.DataContext = advancedButton.DataContext;
            bool?result = optionWindow.ShowDialog();

            e.Handled = true;
            //optionWindow = null;
        }
        public override void ExecuteCoreAsync(object parameter)
        {
            var option    = new OptionWindow();
            var viewmodel = new OptionWindowViewModel();

            viewmodel.OnClose += () => option.Close();
            viewmodel.OnClose += () => viewmodel.Dispose();
            option.DataContext = viewmodel;
            option.ShowDialog();

            _vm.Config = Config.GetConfig();
        }
 private void UserControl_Drop(object sender, DragEventArgs e)
 {
     try
     {
         if (e.Data.GetDataPresent(DataFormats.FileDrop))
         {
             string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
             foreach (string file in files)
             {
                 string fileExtension = System.IO.Path.GetExtension(file);
                 if (fileExtension.Contains("bcfzip"))
                 {
                     if (viewModel.BCFFiles.Count > 0 && !string.IsNullOrEmpty(viewModel.DatabaseFile))
                     {
                         //add bcf to db
                         bool         createNewDB  = false;
                         OptionWindow optionWindow = new OptionWindow();
                         if ((bool)optionWindow.ShowDialog())
                         {
                             createNewDB = optionWindow.CreateNewDB;
                             if (createNewDB)
                             {
                                 viewModel.SaveDatabase(file);
                             }
                             else
                             {
                                 viewModel.AddBCF(file);
                             }
                         }
                     }
                     else
                     {
                         //new bcf DB
                         viewModel.SaveDatabase(file);
                     }
                     break;
                 }
                 else if (fileExtension.Contains("sqlite"))
                 {
                     viewModel.OpenDatabase(file);
                     break;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Failed to drop files.\n" + ex.Message, "File Drop", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }
Exemple #8
0
        private void ShowOption()
        {
            var option    = new OptionWindow();
            var viewModel = new OptionWindowViewModel();

            viewModel.OnClose += () => option.Close();
            option.DataContext = viewModel;
            option.ShowDialog();

            if (this.speechClient != null)
            {
                this.speechClient.Dispose();
            }
            this.speechClient = ASpeechClient.CreateInstance();
            this.ConnectSpeakApplication();
            base.OnPropertyChanged("FontSize");
            base.OnPropertyChanged("TopMost");
        }