示例#1
0
        public MainWindow()
        {
            InitializeComponent();
            SetupViewports();

            App.LoadSettings();

            _fileTreeMenu = new FileTreeViewContextManager(this, treeView);
            _viewModel = new MainWindowViewModel(this, App.Settings.Get<string>("Files.DataPath", ""));
            DataContext = _viewModel;

            var binding = new CommandBinding(ApplicationCommands.Properties);
            binding.Executed += Properties_Executed;
            binding.CanExecute += Properties_CanExecute;
            this.CommandBindings.Add(binding);

            var lastLoadedFile = App.Settings.Get<string>("Files.LastLoadedFile", "");
            if (!string.IsNullOrEmpty(lastLoadedFile))
            {
                _viewModel.LoadFile(lastLoadedFile);
            }
        }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();
            SetupViewports();

            App.LoadSettings();

            _fileTreeMenu = new FileTreeViewContextManager(this, treeView);
            _viewModel    = new MainWindowViewModel(this, App.Settings.Get <string>("Files.DataPath", ""));
            DataContext   = _viewModel;

            var binding = new CommandBinding(ApplicationCommands.Properties);

            binding.Executed   += Properties_Executed;
            binding.CanExecute += Properties_CanExecute;
            this.CommandBindings.Add(binding);

            var lastLoadedFile = App.Settings.Get <string>("Files.LastLoadedFile", "");

            if (!string.IsNullOrEmpty(lastLoadedFile))
            {
                _viewModel.LoadFile(lastLoadedFile);
            }
        }