示例#1
0
        public LineControl(BaseRectangleModel baseRectangleModel)
        {
            InitializeComponent();
            _baseRectangleModel = baseRectangleModel;

            this.Height = (double)_baseRectangleModel.model.Height / 4;
            this.Width  = (double)_baseRectangleModel.model.Width / 4;
            Canvas.SetLeft(this, (double)baseRectangleModel.model.Width - this.Width);
            Canvas.SetTop(this, ((double)baseRectangleModel.model.Height - this.Height) / 2);
        }
示例#2
0
        public MovingControl(BaseRectangleModel baseRectangleModel)
        {
            InitializeComponent();
            clear.Children.Add(baseRectangleModel.shape);
            BaseRectangleModel = baseRectangleModel;
            this.Height        = (double)BaseRectangleModel.model.Height;
            this.Width         = (double)BaseRectangleModel.model.Width;
            Canvas.SetLeft(this, (double)BaseRectangleModel.model.Leftpos);
            Canvas.SetTop(this, (double)BaseRectangleModel.model.Toppos);



            _lineControl = new ObservableCollection <LineControl>();
            _lineControl.CollectionChanged += _lineControl_CollectionChanged;
        }
示例#3
0
        public void AddNewRectangle()
        {
            Shapes model = new Shapes()
            {
                Toppos  = 10,
                Leftpos = -40,
                Width   = 80,
                Height  = 80,
            };

            OveralldbClass.db.Add(model);
            OveralldbClass.db.SaveChanges();

            BaseRectangleModel baseRectangleModel = new BaseRectangleModel(model);

            movingControls.Add(new MovingControl(baseRectangleModel));
        }