question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Window border brush

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
punker76commented, Apr 18, 2017

@Pekshev Mh, maybe a undocumented breaking change, so sorry for that. To fix this, set the BorderBrush and GlowBrush to null instead to Brushes.Transparent.

0reactions
Pekshevcommented, Feb 6, 2018

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found