Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            Logger.Init();

            EditorKernel.Inject(this);

            ThemeResourceDictionary.ApplyTheme(this, Settings.Theme);

            removeInvalidRecents();

            workspacePanel.Loaded += WorkspacePanel_Loaded;
            Width  = Settings.WindowSize.Width != 0 ? Settings.WindowSize.Width : 800;
            Height = Settings.WindowSize.Height != 0 ? Settings.WindowSize.Height : 600;

            if (Settings.ReopenMostRecentProject && Settings.RecentProjects.Count > 0)
            {
                // TODO: reopen project
                string  path    = Settings.RecentProjects[0];
                Project project = Controls.Workspace.Extensions.ReadFromBinaryFile <Project>(path);
                ProjectExplorer.Project = project;
            }

            AddHandler(ActionPerformedEvent, new RoutedActionPerformedEventHandler(actionPerformedHandler));
            AddHandler(FileOpenedEvent, new RoutedFileOpenedEventHandler(fileOpenedHandler));
            AddHandler(PropertyGrid.ValueEditedEvent, new RoutedValueEditedEventHandler(valueEditedHandler));

            AddHandler(WorkspacePanel.SelectionChangedEvent, new RoutedSelectionChangedEventHandler(selectionChangedHandler));
            AddHandler(WorkspacePanel.PanelFocusedEvent, new PanelActionEventHandler(panelFocused));

            Logger.OnLog += Logger_OnLog;
        }
Ejemplo n.º 2
0
        public SettingsWindow()
        {
            InitializeComponent();

            EditorKernel.Inject(this);

            propertyGrid.PropertyEditorFactory = new PropertyEditorFactory();
            propertyGrid.SelectedObject        = Settings;

            ThemeResourceDictionary.ApplyTheme(this, Settings.Theme);
        }