[英]Border will not show in WPF Control
我正在嘗試以編程方式在類中設置一個派生自System.Windows.Controls.Control
的邊框。
我設置BorderBrush
和BorderThickness
屬性並確保不透明度設置為1
,但邊框仍然不顯示。
_titleBar = GetTemplateChild("PART_TitleBar") as ChartPanelTitleBar;
_titleBar.Background = Brushes.Tomato;
_titleBar.BorderBrush = Brushes.Blue;
_titleBar.BorderThickness = new Thickness(1, 1, 1, 1);
ChartPanelTitleBar
派生自Control
。 更改后台工作,所以BorderBrush
也不應該工作嗎?
您應該將元素包裝在Border中
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.