Beispiel #1
0
        public EditorWindow()
        {
            InitializeComponent();

            DataContext = new EditorWindowViewModel();

            Loaded  += (sender, e) => StartEngine();
            Closing += (sender, e) => StopEngine();
        }
Beispiel #2
0
        /// <summary>
        /// Allows for the (board) editor to be opened.
        /// </summary>
        /// <param name="sender"></param>
        private void _OpenEditor(object sender)
        {
            EditorWindow          newEditorWindow          = new EditorWindow();
            EditorWindowViewModel newEditorWindowViewModel = new EditorWindowViewModel(Dialogs);

            newEditorWindowViewModel.Close = new Action(() => newEditorWindow.Close());
            newEditorWindow.DataContext    = newEditorWindowViewModel;
            newEditorWindow.Show();
        }
        public EditorWindow()
        {
            InitializeComponent();

            var tableControllerViewModel = new TableControllerViewModel();
            var viewModel = new EditorWindowViewModel(tableControllerViewModel);

            DataContext = viewModel;
            viewModel.PropertyChanged += (s, e) =>
            {
                var x = s as EditorWindowViewModel;
                if (x == null)
                {
                    return;
                }
                if (e.PropertyName == "Project")
                {
                    tableControllerViewModel.Project = viewModel.Project;
                }
            };
            TablesController.DataContext = tableControllerViewModel;
        }