Beispiel #1
0
 private void btnTest_Click(object sender, RoutedEventArgs e)
 {
     WallDetails wallInfo = new WallDetails();
     wallInfo.StartEchelonPoint = new EchelonPoint(-125, -225);
     wallInfo.EndEchelonPoint = new EchelonPoint(75, 75);
     wall.WallInfo = wallInfo;
 }
Beispiel #2
0
        public Window1()
        {
            InitializeComponent();

            SetDependencyProperties();

            SetAndMarkOrigin();

            WireupCanvasEvents();

            wall = new Wall();

            WallDetails wallInfo = new WallDetails();
            wallInfo.StartEchelonPoint = new EchelonPoint(-25, -25);
            wallInfo.EndEchelonPoint = new EchelonPoint(75, 75);
            wall.WallInfo = wallInfo;

            WallElement = new WallElement(Origin, wall.WallInfo);

            designerCanvas.Children.Add(WallElement);

            SetBindings();

            this.MouseMove += new MouseEventHandler(Window1_MouseMove);
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
                return null;

            WallElementDetails wallElementDetails = (WallElementDetails)value;
            Point origin = (Point)parameter;

            WallDetails newWallDetails = new WallDetails();

            newWallDetails.StartEchelonPoint = new EchelonPoint(wallElementDetails.StartPoint.X - origin.X,
                                                         wallElementDetails.StartPoint.Y - origin.Y);
            newWallDetails.EndEchelonPoint = new EchelonPoint(wallElementDetails.EndPoint.X - origin.X,
                                                         wallElementDetails.EndPoint.Y - origin.Y);
            return newWallDetails;
        }
Beispiel #4
0
        public WallElement(Point origin, WallDetails wallInfo)
        {
            SetupDependencyProperties();

            SetBindings(origin, wallInfo);
        }
Beispiel #5
0
        private void SetBindings(Point origin, WallDetails wallInfo)
        {
            try
            {
                Origin = origin;
                WallDetails = wallInfo;

                Binding bind;

                //bind = new Binding();
                //bind.Source = this;
                //bind.Path = new PropertyPath(WallElement.WallDetailsProperty);
                //bind.ConverterParameter = Origin;
                //bind.Converter = new EchelonPointToPointConverter();
                //bind.Mode = BindingMode.OneWay;

                //this.SetBinding(WallElementDetailsProperty, bind);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #6
0
        private void OnWallElementDetailsChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            SetFillBrush();

            if (!WallElementDetails.IsFinal)
            {
                // Would call the change method, etc that would communicate to Client Services and start that workflow
                // here we will mock the process
                WallDetails newWallDetails = new WallDetails();
                newWallDetails.StartEchelonPoint = GetAsEchelonPoint(WallElementDetails.StartPoint);
                newWallDetails.EndEchelonPoint = GetAsEchelonPoint(WallElementDetails.EndPoint);
                newWallDetails.IsFinal = true;
                WallDetails = newWallDetails;
            }
            else
            {
                WallElementDetails.IsFinal = false;
            }
        }