public override void RenderOverride(RenderContext localRenderContext) { base.RenderOverride(localRenderContext); PerformLayout(localRenderContext); Brush fill = Fill; if (_fillContext != null && fill != null) { if (fill.BeginRenderBrush(_fillContext, localRenderContext)) { _fillContext.Render(0); fill.EndRender(); } } Brush stroke = Stroke; if (_strokeContext != null && stroke != null) { if (stroke.BeginRenderBrush(_strokeContext, localRenderContext)) { _strokeContext.Render(0); stroke.EndRender(); } } }
protected void OnBackgroundPropertyChanged(AbstractProperty property, object oldValue) { Brush oldBackground = oldValue as Brush; if (oldBackground != null) { oldBackground.ObjectChanged -= OnBrushChanged; } if (Background != null) { Background.ObjectChanged += OnBrushChanged; } _performLayout = true; }
void OnBorderBrushPropertyChanged(AbstractProperty property, object oldValue) { Brush oldBrush = oldValue as Brush; if (oldBrush != null) { oldBrush.ObjectChanged -= OnBorderBrushChanged; } Brush brush = property.GetValue() as Brush; if (brush != null) { brush.ObjectChanged += OnBorderBrushChanged; } OnBorderBrushChanged(brush); }