Пример #1
0
        public void Loaded(ViewLoadedParams p)
        {
            _thesaurusMenuItem = new MenuItem {
                Header = "Thesaurus"
            };
            var dynamoViewModel = p.DynamoWindow.DataContext as DynamoViewModel;

            #region Train Menu Item

            _thesaurusTrainMenuItem = new MenuItem {
                Header = "Train"
            };
            _thesaurusTrainMenuItem.ToolTip = new ToolTip {
                Content = "Whatever description we use..."
            };
            _thesaurusTrainMenuItem.Click += (sender, args) =>
            {
                var m         = new TrainModel();
                var viewModel = new TrainViewModel(m);
                var window    = new TrainView
                {
                    DataContext = viewModel,
                    Owner       = p.DynamoWindow
                };
                window.Left = window.Owner.Left + 400;
                window.Top  = window.Owner.Top + 200;
                window.Show();
            };
            _thesaurusMenuItem.Items.Add(_thesaurusTrainMenuItem);

            #endregion

            #region Show/Hide

            _thesaurusShowHideMenuItem = new MenuItem {
                Header = "Show/Hide"
            };
            _thesaurusShowHideMenuItem.ToolTip = new ToolTip {
                Content = "Whatever description we use..."
            };
            _thesaurusShowHideMenuItem.Click += (sender, args) =>
            {
                var m         = new SuggestionsModel(dynamoViewModel);
                var viewModel = new SuggestionsViewModel(m);
                var window    = new SuggestionsView
                {
                    DataContext = viewModel,
                    Owner       = p.DynamoWindow
                };
                window.Left = window.Owner.Left + 400;
                window.Top  = window.Owner.Top + 200;
                window.Show();
            };
            _thesaurusMenuItem.Items.Add(_thesaurusShowHideMenuItem);

            #endregion

            p.dynamoMenu.Items.Add(_thesaurusMenuItem);
        }
Пример #2
0
 public TrainViewModel(TrainModel model)
 {
     Model           = model;
     DirectoryPath   = "";
     Files           = new List <string>();
     SelectDirectory = new RelayCommand(OnSelectDirectory);
     Train           = new RelayCommand(OnTrain);
     WindowLoaded    = new RelayCommand <Window>(OnWindowLoaded);
 }