示例#1
0
        private void Grid_MouseUp(object sender, MouseButtonEventArgs e)
        {
            if (mouseDown)
            {
                // Release the mouse capture and stop tracking it.
                mouseDown             = false;
                captureNextMouseEvent = false;
                theGrid.ReleaseMouseCapture();

                // Hide the drag selection box.
                selectionBox.Visibility = Visibility.Collapsed;

                Point mouseUpPos = e.GetPosition(theGrid);

                View_Model model = (View_Model)DataContext;

                Rect rect = new Rect(mouseDownPos, mouseUpPos);

                rect.X      /= model.CardRenderWidth;
                rect.Y      /= model.CardRenderHeight;
                rect.Width  /= model.CardRenderWidth;
                rect.Height /= model.CardRenderHeight;

                But_Delete_Region.IsEnabled = true;
                model.AddNewCardRegion(rect);
            }
        }
示例#2
0
        private void but_temp_save_Click(object sender, RoutedEventArgs e)
        {
            dia_save.ShowDialog();

            View_Model model = (View_Model)DataContext;

            model.Xml_Save(dia_save.FileName, true);
        }
示例#3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);



            View_Model context = new View_Model();
            MainWindow app     = new MainWindow(context);

            app.Show();
        }
示例#4
0
        private void but_temp_load_Click(object sender, RoutedEventArgs e)
        {
            dia_open.ShowDialog();

            View_Model model = (View_Model)DataContext;

            try
            {
                model.Xml_Load(dia_open.FileName, true);
            }
            catch
            {
                MessageBox.Show("Error Loading File");
            }
        }
示例#5
0
        void Tree_View_Selection_Changed(Object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            View_Model model = (View_Model)DataContext;

            model.Tree_View_Selected_Item_Changed();
        }
示例#6
0
        private void But_Delete_Region_Click(object sender, RoutedEventArgs e)
        {
            View_Model model = (View_Model)DataContext;

            model.DeleteNextSelectedRegion = true;
        }