Beispiel #1
0
        /*     /// <summary>
         *   ///  Resets the current tool to the default (= the move tool).
         *   /// </summary>
         *   private void ActivateDefaultTool()
         *   {
         *       TheModel.ActivateDefaultTool();
         *   }
         */

        public PdfOverlay()
        {
            InitializeComponent();

            TheModel = new Overlay.PdfOverlayModel(this, this); // call this after InitializeComponent() so that UI is available

            TheModel.DisplayTree.DisplayTreeChanged += new EventHandler <TikzDisplayTree.DisplayTreeChangedEventArgs>(DisplayTree_DisplayTreeChanged);

            // allow to gain keyboard focus
            canvas1.Focusable = true;

            // handle delete event
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Delete, DeleteCommandHandler));
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, CopyCommandHandler));
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Cut, CutCommandHandler));
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Paste, PasteCommandHandler));
        }
   /*     /// <summary>
        ///  Resets the current tool to the default (= the move tool).
        /// </summary>
        private void ActivateDefaultTool()
        {
            TheModel.ActivateDefaultTool();
        }
       */ 

        public PdfOverlay()
        {          
            InitializeComponent();

            TheModel = new Overlay.PdfOverlayModel(this, this); // call this after InitializeComponent() so that UI is available

            TheModel.DisplayTree.DisplayTreeChanged += new EventHandler<TikzDisplayTree.DisplayTreeChangedEventArgs>(DisplayTree_DisplayTreeChanged);

            // allow to gain keyboard focus
            canvas1.Focusable = true;
            
            // handle delete event
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Delete, DeleteCommandHandler));
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, CopyCommandHandler));
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Cut, CutCommandHandler));
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Paste, PasteCommandHandler));
            
        }