I’m trying to programmatically set a border in class that is derived from System.Windows.Controls.Control.
I set the BorderBrush and BorderThickness properties and made sure opacity is set to 1, but the border still does not show.
_titleBar = GetTemplateChild("PART_TitleBar") as ChartPanelTitleBar;
_titleBar.Background = Brushes.Tomato;
_titleBar.BorderBrush = Brushes.Blue;
_titleBar.BorderThickness = new Thickness(1, 1, 1, 1);
ChartPanelTitleBar is derived from Control. Changing the Background works, so shouldn’t the BorderBrush work too?
You should wrap your element in a Border