Window border brush
See original GitHub issueI’m update from version 1.1.2.0 to 1.5.0.0. I have in my code such part:
public static void ChangeWindowBordes(string borderType, MetroWindow window)
{
try
{
if (borderType.Equals("AccentBorder"))
{
window.BorderThickness = new Thickness(1);
window.SetResourceReference(Control.BorderBrushProperty, "AccentColorBrush");
window.GlowBrush = Brushes.Transparent;
}
if (borderType.Equals("NoBorder"))
{
window.BorderThickness = new Thickness(0);
window.BorderBrush = Brushes.Transparent;
window.GlowBrush = Brushes.Transparent;
}
if (borderType.Equals("AccentGlowBrush"))
{
window.BorderThickness = new Thickness(0);
window.SetResourceReference(MetroWindow.GlowBrushProperty, "AccentColorBrush");
window.BorderBrush = Brushes.Transparent;
}
if (borderType.Equals("AccentBorderGlowBrush"))
{
window.BorderThickness = new Thickness(1);
window.SetResourceReference(MetroWindow.GlowBrushProperty, "AccentColorBrush");
window.BorderBrush = Brushes.Transparent;
}
if (borderType.Equals("Shadow") || string.IsNullOrEmpty(borderType))
{
window.BorderThickness = new Thickness(0);
window.GlowBrush = Brushes.Black;
window.BorderBrush = Brushes.Transparent;
}
}
catch
{
window.BorderThickness = new Thickness(0);
window.GlowBrush = Brushes.Black;
window.BorderBrush = Brushes.Transparent;
}
}
so, before update it work fine. Now dont work when set variant “AccentBorder”
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Can i set the window border color in WPF?
As far as I can remember (It is more than 4 years ago), you can create a style to use with a WPF...
Read more >Border.BorderBrush Property (System.Windows.Controls)
The Brush that draws the outer border color. This property has no default value. Examples. The following example shows how to set the...
Read more >Control.BorderBrush Property (System.Windows.Controls)
Gets or sets a brush that describes the border background of a control. ... The following example shows how to set the border...
Read more >#272 – Displaying a Border Around a Window | 2000 ...
You can include a border around the edges of a Window using the BorderBrush and BorderThickness properties. By default, the BorderBrush is ...
Read more >Window Border - 2000 Things You Should Know About WPF
The Window class has BorderBrush and BorderThickness properties that allow creating a thick border around the window's client area.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Pekshev Mh, maybe a undocumented breaking change, so sorry for that. To fix this, set the BorderBrush and GlowBrush to
null
instead toBrushes.Transparent
.@punker76 thanks for the answer. But, unfortunately, I’ll have to wait for the official release of version 1.6, since I need to update more than 50 projects. I will refrain while from the alpha version. Have you decided yet when you will make an official release? At least roughly