public VisualPropertyPageManager(Cuisine.Windows.WindowsManager manager)
        {
            t_manager = manager;
            _app      = PaintualUI.Code.Application.Instance;

            _app.ActiveContentHelper.CurrentDrawingBoardChanged += Refresh;
        }
Example #2
0
        public ActiveContentHelper(Cuisine.Windows.WindowsManager windowsManager)
        {
            t_windowsManager = windowsManager;
            t_windowsManager.ActiveDocumentChanged += E_windowsManager_ActiveDocumentChanged;

            _app = PaintualUI.Code.Application.Instance;
        }
Example #3
0
        private System.IO.MemoryStream _stream = new System.IO.MemoryStream(); // for serialization

        public MainWindow()
        {
            this.WindowState = WindowState.Maximized;

            InitializeComponent();

            // the VisualPropertyPage will register and unregister this event itself
            // but MainWindow must also be aware of change for other operations
            // note : ActiveContentChanged does not refer to the document that has focus but to the content which contains
            // control focus
            WindowsManager.ActiveDocumentChanged += E_WindowsManager_ActiveDocumentChanged;
            WindowsManager.DocumentClosing       += E_WindowsManager_DocumentClosing;

            _app = PaintualUI.Code.Application.Instance;

            // order of the following two lines is important, VisualPropertyPageHandler needs ref to ActiveContentHelper
            _app.ActiveContentHelper       = new Code.ActiveContentHelper(WindowsManager);
            _app.VisualPropertyPageManager = new Code.VisualPropertyPageManager(WindowsManager);

            // to hide bug that crashes app sometimes when first file open is one from file system.
            NewDrawingBoard("");

            this.Closing += E_MainWindow_Closing;
        }