void Model_PropertyChanged(object sender, PVCModelPropertyChangedEventArgs e) { switch (e.PropertyCode) { case SashModel.PARENT_PROPERTY_CODE: Bounds = SurfaceParent().Model.Bounds; break; case SashModel.SASH_TYPE_PROPERTY_CODE: Repaint(); break; case SashModel.CHILD_PROPERTY_CODE: RemoveAllChildren(); Surface = Model.SurfaceChild; Surface.Frame = SurfaceParent().Frame; Surface.Model.Bounds = InnerBounds; AddChild(Surface); break; case SashModel.CODE_PROPERTY_CODE: Repaint(); break; } Surface.ParentBoundsChanged(); }
public void OnPropertyChanged(PVCModelPropertyChangedEventArgs e) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, e); } }
void Model_PropertyChanged(object sender, PVCModelPropertyChangedEventArgs e) { switch (e.PropertyCode) { case MullionModel.LENGTH_PROPERTY_CODE: case MullionModel.MIDDLE_POINT_PROPERTY_CODE: case MullionModel.MULLION_TYPE_PROPERTY_CODE: case MullionModel.ORIENTATION_PROPERTY_CODE: case MullionModel.X_PROPERTY_CODE: case MullionModel.Y_PROPERTY_CODE: if (!SetBounds(Model.X, Model.Y, Model.Width, Model.Height)) { Model.X = X; Model.Y = Y; if (Model.Orientation == Orientation.Horizontal) { Model.Length = Width; } else { Model.Length = Height; } } else if (Frame != null) { Frame.OnDimensionChanged(); } break; case MullionModel.CODE_PROPERTY_CODE: Label = Model.Code; InvalidatePaint(); break; case MullionModel.VIRTUAL_PROPERTY_CODE: Model.MiddlePoint += 1; Model.MiddlePoint -= 1; Repaint(); break; } }
public void Model_PropertyChanged(object sender, PVCModelPropertyChangedEventArgs e) { switch (e.PropertyCode) { case SurfaceModel.X_PROPERTY_CODE: case SurfaceModel.WIDTH_PROPERTY_CODE: case SurfaceModel.HEIGHT_PROPERTY_CODE: case SurfaceModel.Y_PROPERTY_CODE: case SurfaceModel.BOUNDS_PROPERTY_CODE: if (Parent == null) { Bounds = Model.Bounds; } else if (!SetBounds(Model.X, Model.Y, Model.Width, Model.Height)) { Model.Bounds = Bounds; } break; default: break; } }
/// <summary> /// Updates the aFrame based on the Model values /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void Model_PropertyChanged(object sender, PVCModelPropertyChangedEventArgs e) { switch (e.PropertyCode) { case PVCFrameModel.WIDTH_PROPERTY_CODE: case PVCFrameModel.HEIGHT_PROPERTY_CODE: if (!SetBounds(MINX, MINY, Model.Width, Model.Height)) { Model.Width = Width; Model.Height = Height; } else { OnDimensionChanged(); } break; case PVCFrameModel.CODE_PROPERTY_CODE: Label = Model.Code; ChildrenManager.UpdateFillingsCode(this); ChildrenManager.UpdateSashesCode(this); ChildrenManager.UpdateMullionsCode(this, Orientation.Horizontal); ChildrenManager.UpdateMullionsCode(this, Orientation.Vertical); InvalidatePaint(); break; case PVCFrameModel.PROFILE_PROPERTY_CODE: InvalidateLayout(); break; case PVCFrameModel.COLOR_PROPERTY_CODE: case PVCFrameModel.BORDER_COLOR_PROPERTY_CODE: InvalidatePaint(); break; } }
public void Model_PropertyChanged(object sender, PVCModelPropertyChangedEventArgs e) { switch (e.PropertyCode) { case FillingModel.PARENT_PROPERTY_CODE: if (Model.SurfaceParent != null && Model.SurfaceParent.ChildrenCount == 0) { Model.SurfaceParent.AddChild(this); Bounds = Model.SurfaceParent.Model.Bounds; } else { Model.SurfaceParent = null; } break; case FillingModel.FILLING_TYPE_PROPERTY_CODE: break; case FillingModel.CODE_PROPERTY_CODE: break; } Repaint(); }