Exemplo n.º 1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.MainForm = ((Paint.MainWindow)(target));

            #line 8 "..\..\MainWindow.xaml"
                this.MainForm.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.MainForm_MouseUp);

            #line default
            #line hidden

            #line 8 "..\..\MainWindow.xaml"
                this.MainForm.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.MainForm_MouseDown);

            #line default
            #line hidden
                return;

            case 2:
                this.DrawCanvas = ((System.Windows.Controls.Canvas)(target));

            #line 14 "..\..\MainWindow.xaml"
                this.DrawCanvas.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.DrawCanvas_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 14 "..\..\MainWindow.xaml"
                this.DrawCanvas.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.DrawCanvas_MouseLeftButtonUp);

            #line default
            #line hidden

            #line 14 "..\..\MainWindow.xaml"
                this.DrawCanvas.MouseMove += new System.Windows.Input.MouseEventHandler(this.DrawCanvas_MouseMove);

            #line default
            #line hidden
                return;

            case 3:
                this.button = ((System.Windows.Controls.Button)(target));

            #line 15 "..\..\MainWindow.xaml"
                this.button.Click += new System.Windows.RoutedEventHandler(this.button_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 2
0
        public MainWindowViewModel(MainWindow mainWindow)
        {
            statesUndo = new Stack<IMemento>();
            statesRedo = new Stack<IMemento>();

            commandBindings = mainWindow.CommandBindings;
            inkCanvas = mainWindow.InkCanvasWithUndo1;

            inkCanvas.MouseUp += InkCanvasWithUndo1_MouseUp;

            //Create a command binding for the save command
            var saveBindingUndo = new CommandBinding(ApplicationCommands.Undo, OnExecutedCommandsUndo);
            var saveBindingRedo = new CommandBinding(ApplicationCommands.Redo, OnExecutedCommandsRedo);

            //Register the binding to the class
            CommandManager.RegisterClassCommandBinding(typeof (MainWindowViewModel), saveBindingUndo);

            //Adds the binding to the CommandBindingCollection
            commandBindings.Add(saveBindingUndo);
            commandBindings.Add(saveBindingRedo);

            StoreState();
        }
Exemplo n.º 3
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.MainForm = ((Paint.MainWindow)(target));
     
     #line 8 "..\..\MainWindow.xaml"
     this.MainForm.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.MainForm_MouseUp);
     
     #line default
     #line hidden
     
     #line 8 "..\..\MainWindow.xaml"
     this.MainForm.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.MainForm_MouseDown);
     
     #line default
     #line hidden
     return;
     case 2:
     this.DrawCanvas = ((System.Windows.Controls.Canvas)(target));
     
     #line 14 "..\..\MainWindow.xaml"
     this.DrawCanvas.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.DrawCanvas_MouseLeftButtonDown);
     
     #line default
     #line hidden
     
     #line 14 "..\..\MainWindow.xaml"
     this.DrawCanvas.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.DrawCanvas_MouseLeftButtonUp);
     
     #line default
     #line hidden
     
     #line 14 "..\..\MainWindow.xaml"
     this.DrawCanvas.MouseMove += new System.Windows.Input.MouseEventHandler(this.DrawCanvas_MouseMove);
     
     #line default
     #line hidden
     return;
     case 3:
     this.button = ((System.Windows.Controls.Button)(target));
     
     #line 15 "..\..\MainWindow.xaml"
     this.button.Click += new System.Windows.RoutedEventHandler(this.button_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
Exemplo n.º 4
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.v = ((Paint.MainWindow)(target));

            #line 8 "..\..\MainWindow.xaml"
                this.v.SizeChanged += new System.Windows.SizeChangedEventHandler(this.Window_SizeChanged);

            #line default
            #line hidden

            #line 8 "..\..\MainWindow.xaml"
                this.v.Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden

            #line 8 "..\..\MainWindow.xaml"
                this.v.Closing += new System.ComponentModel.CancelEventHandler(this.v_Closing);

            #line default
            #line hidden
                return;

            case 2:
                this.menuPrincipal = ((System.Windows.Controls.Ribbon.Ribbon)(target));
                return;

            case 3:

            #line 16 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Ribbon.RibbonApplicationMenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.abrirRibbonApplicationMenuItem_Click);

            #line default
            #line hidden
                return;

            case 4:

            #line 17 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Ribbon.RibbonApplicationMenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.exportarRibbonApplicationMenuItem_Click);

            #line default
            #line hidden
                return;

            case 5:

            #line 18 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Ribbon.RibbonApplicationMenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.borrarTodoRibbonApplicationMenuItem_Click);

            #line default
            #line hidden
                return;

            case 6:

            #line 19 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Ribbon.RibbonApplicationMenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.guardarRibbonApplicationMenuItem_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.elementoSeleccionado = ((System.Windows.Controls.Label)(target));
                return;

            case 8:
                this.bModificarElemento = ((System.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 31 "..\..\MainWindow.xaml"
                this.bModificarElemento.Click += new System.Windows.RoutedEventHandler(this.bModificarElemento_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.bEliminarElemento = ((System.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 32 "..\..\MainWindow.xaml"
                this.bEliminarElemento.Click += new System.Windows.RoutedEventHandler(this.bEliminarElemento_Click);

            #line default
            #line hidden
                return;

            case 10:

            #line 36 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.RibbonButton_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.opcionManoAlzada = ((System.Windows.Controls.Ribbon.RibbonRadioButton)(target));

            #line 40 "..\..\MainWindow.xaml"
                this.opcionManoAlzada.Click += new System.Windows.RoutedEventHandler(this.onOffSeleccion);

            #line default
            #line hidden
                return;

            case 12:
                this.opcionRectangulo = ((System.Windows.Controls.Ribbon.RibbonRadioButton)(target));

            #line 41 "..\..\MainWindow.xaml"
                this.opcionRectangulo.Click += new System.Windows.RoutedEventHandler(this.onOffSeleccion);

            #line default
            #line hidden
                return;

            case 13:
                this.opcionElipse = ((System.Windows.Controls.Ribbon.RibbonRadioButton)(target));

            #line 42 "..\..\MainWindow.xaml"
                this.opcionElipse.Click += new System.Windows.RoutedEventHandler(this.onOffSeleccion);

            #line default
            #line hidden
                return;

            case 14:
                this.opcionTexto = ((System.Windows.Controls.Ribbon.RibbonRadioButton)(target));

            #line 43 "..\..\MainWindow.xaml"
                this.opcionTexto.Click += new System.Windows.RoutedEventHandler(this.onOffSeleccion);

            #line default
            #line hidden
                return;

            case 15:
                this.opcionRecta = ((System.Windows.Controls.Ribbon.RibbonRadioButton)(target));

            #line 44 "..\..\MainWindow.xaml"
                this.opcionRecta.Click += new System.Windows.RoutedEventHandler(this.onOffSeleccion);

            #line default
            #line hidden
                return;

            case 16:
                this.opcionMover = ((System.Windows.Controls.Ribbon.RibbonRadioButton)(target));

            #line 45 "..\..\MainWindow.xaml"
                this.opcionMover.Click += new System.Windows.RoutedEventHandler(this.onOffSeleccion);

            #line default
            #line hidden
                return;

            case 17:
                this.opcionCursor = ((System.Windows.Controls.Ribbon.RibbonRadioButton)(target));

            #line 46 "..\..\MainWindow.xaml"
                this.opcionCursor.Click += new System.Windows.RoutedEventHandler(this.onOffSeleccion);

            #line default
            #line hidden
                return;

            case 18:
                this.fino = ((System.Windows.Controls.RadioButton)(target));

            #line 50 "..\..\MainWindow.xaml"
                this.fino.Click += new System.Windows.RoutedEventHandler(this.fino_Click);

            #line default
            #line hidden
                return;

            case 19:
                this.normal = ((System.Windows.Controls.RadioButton)(target));

            #line 51 "..\..\MainWindow.xaml"
                this.normal.Click += new System.Windows.RoutedEventHandler(this.normal_Click);

            #line default
            #line hidden
                return;

            case 20:
                this.ancho = ((System.Windows.Controls.RadioButton)(target));

            #line 52 "..\..\MainWindow.xaml"
                this.ancho.Click += new System.Windows.RoutedEventHandler(this.ancho_Click);

            #line default
            #line hidden
                return;

            case 21:
                this.selectorColorContornoPorDefecto = ((System.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 56 "..\..\MainWindow.xaml"
                this.selectorColorContornoPorDefecto.Click += new System.Windows.RoutedEventHandler(this.selectorColorContornoPorDefecto_Click);

            #line default
            #line hidden
                return;

            case 22:
                this.colorContornoPorDefecto = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 23:
                this.selectorColorFondoPorDefecto = ((System.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 61 "..\..\MainWindow.xaml"
                this.selectorColorFondoPorDefecto.Click += new System.Windows.RoutedEventHandler(this.selectorColorFondoPorDefecto_Click);

            #line default
            #line hidden
                return;

            case 24:
                this.colorFondoPorDefecto = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 25:
                this.bCambiarCoordenadas = ((System.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 70 "..\..\MainWindow.xaml"
                this.bCambiarCoordenadas.Click += new System.Windows.RoutedEventHandler(this.bCambiarCoordenadas_Click);

            #line default
            #line hidden
                return;

            case 26:
                this.bMostrarManual = ((System.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 74 "..\..\MainWindow.xaml"
                this.bMostrarManual.Click += new System.Windows.RoutedEventHandler(this.bMostrarManual_Click);

            #line default
            #line hidden
                return;

            case 27:
                this.reglaBot = ((System.Windows.Controls.Canvas)(target));
                return;

            case 28:
                this.reglaLef = ((System.Windows.Controls.Canvas)(target));
                return;

            case 29:
                this.sV = ((System.Windows.Controls.ScrollViewer)(target));

            #line 84 "..\..\MainWindow.xaml"
                this.sV.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.ScrollViewer_ScrollChanged);

            #line default
            #line hidden
                return;

            case 30:
                this.lienzo = ((System.Windows.Controls.Canvas)(target));

            #line 85 "..\..\MainWindow.xaml"
                this.lienzo.MouseLeave += new System.Windows.Input.MouseEventHandler(this.lienzo_MouseLeave);

            #line default
            #line hidden

            #line 85 "..\..\MainWindow.xaml"
                this.lienzo.MouseMove += new System.Windows.Input.MouseEventHandler(this.lienzo_MouseMove);

            #line default
            #line hidden

            #line 85 "..\..\MainWindow.xaml"
                this.lienzo.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.lienzo_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 85 "..\..\MainWindow.xaml"
                this.lienzo.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.lienzo_MouseLeftButtonUp);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 5
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.window = ((Paint.MainWindow)(target));
     return;
     case 2:
     this.InkCanvasWithUndo1 = ((Paint.InkCanvasWithUndo)(target));
     return;
     }
     this._contentLoaded = true;
 }
Exemplo n.º 6
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.MainForm = ((Paint.MainWindow)(target));
     
     #line 9 "..\..\MainWindow.xaml"
     this.MainForm.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.MainForm_MouseUp);
     
     #line default
     #line hidden
     
     #line 9 "..\..\MainWindow.xaml"
     this.MainForm.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.MainForm_MouseDown);
     
     #line default
     #line hidden
     return;
     case 2:
     this.DrawCanvas = ((System.Windows.Controls.Canvas)(target));
     
     #line 16 "..\..\MainWindow.xaml"
     this.DrawCanvas.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.DrawCanvas_MouseLeftButtonDown);
     
     #line default
     #line hidden
     
     #line 16 "..\..\MainWindow.xaml"
     this.DrawCanvas.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.DrawCanvas_MouseLeftButtonUp);
     
     #line default
     #line hidden
     
     #line 16 "..\..\MainWindow.xaml"
     this.DrawCanvas.MouseMove += new System.Windows.Input.MouseEventHandler(this.DrawCanvas_MouseMove);
     
     #line default
     #line hidden
     
     #line 16 "..\..\MainWindow.xaml"
     this.DrawCanvas.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.DrawCanvas_MouseWheel);
     
     #line default
     #line hidden
     return;
     case 3:
     this.menu = ((System.Windows.Controls.Menu)(target));
     return;
     case 4:
     this.comboBox = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 5:
     this.comboBox2 = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 6:
     
     #line 24 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
     
     #line default
     #line hidden
     return;
     case 7:
     
     #line 25 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_2);
     
     #line default
     #line hidden
     return;
     case 8:
     
     #line 26 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_3);
     
     #line default
     #line hidden
     return;
     case 9:
     
     #line 27 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_4);
     
     #line default
     #line hidden
     return;
     case 10:
     
     #line 28 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_5);
     
     #line default
     #line hidden
     return;
     case 11:
     
     #line 29 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.ComboBoxItem)(target)).Selected += new System.Windows.RoutedEventHandler(this.ComboBoxItem_Selected);
     
     #line default
     #line hidden
     return;
     case 12:
     this.slider = ((System.Windows.Controls.Slider)(target));
     
     #line 31 "..\..\MainWindow.xaml"
     this.slider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler<double>(this.slider_ValueChanged);
     
     #line default
     #line hidden
     return;
     case 13:
     this.label = ((System.Windows.Controls.Label)(target));
     return;
     case 14:
     this.button = ((System.Windows.Controls.Button)(target));
     
     #line 35 "..\..\MainWindow.xaml"
     this.button.Click += new System.Windows.RoutedEventHandler(this.button_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }