You can verify it by setting IsEnabled="False" and RoundCorners="False" on the ButtonChrome or by setting Width or Height to something like 3.99 and the "White Border" goes away. Pen innerBorderPen = this.InnerBorderPen ĭc.DrawRoundedRectangle(null, innerBorderPen, new Rect(bounds.Left + 1.5, bounds.Top + 1.5, bounds.Width - 3.0, bounds.Height - 3.0), 1.75, 1.75) Īs we can see, there is no property to disable this. If ((base.IsEnabled || this.RoundCorners) & ((bounds.Width >= 4.0) & (bounds.Height >= 4.0))) Private void DrawInnerBorder(DrawingContext dc, ref Rect bounds) This.DrawInnerBorder(drawingContext, ref bounds) This.DrawBorder(drawingContext, ref bounds) This.DrawDropShadows(drawingContext, ref bounds) This.DrawBackground(drawingContext, ref bounds) Rect bounds = new Rect(0.0, 0.0, base.ActualWidth, base.ActualHeight) Protected override void OnRender(DrawingContext drawingContext) The actual routine being called is DrawInnerBorder and its called from within OnRender in ButtonChrome. I don't think there's an easy way to get rid of that White Border. One of the great fetatures of WPF is the ability to leverage the behavior of a control while completely swapping the look of that control.You can just delete the chrome altogether and create a custom appearence that matches your requirement.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |