New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom dialog background and foreground #2497

Closed
void22 opened this Issue May 10, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@void22

void22 commented May 10, 2016

What steps will reproduce this issue?

I'm using custom dialog as a message box (with Background="Transparent" and Foreground=White) like in the picture:
dialogtest01

It works well with version 1.1.2, but since 1.2.0 (including the latest 1.3.0-ALPHA147) both Background and Foreground colors are "ignored".

The result is:
dialogtest02

Expected outcome

What I already tried:

  • Set colors in xaml
  • Set colors via bindings from VM
  • Set colors before dialog shown
    var dialog = new TestDialog(); dialog.Background = new SolidColorBrush(Colors.Red);
  • Create new style
  • Add custom resource to dialog.DialogSettings.CustomResourceDictionary

None of them is working. I'm sorry if this question was already answered, but I did not find a solution neither on SO nor here.

Environment

  • MahApps.Metro v1.2.0
  • Windows 10 x64
  • Visual Studio 2015
  • .NET Framework 4.6
@void22

This comment has been minimized.

Show comment
Hide comment
@void22

void22 May 16, 2016

It seems the problem is in BaseMetroDialog.Initialize().

If I change the Loaded delegate from
this.Loaded += (sender, args) => { OnLoaded(); HandleTheme(); };

to
HandleTheme();
this.Loaded += (sender, args) => { OnLoaded(); };

everything is working as expected.

The loaded event triggers properly and HandleTheme() runs as it should so I don't know why this happens.

void22 commented May 16, 2016

It seems the problem is in BaseMetroDialog.Initialize().

If I change the Loaded delegate from
this.Loaded += (sender, args) => { OnLoaded(); HandleTheme(); };

to
HandleTheme();
this.Loaded += (sender, args) => { OnLoaded(); };

everything is working as expected.

The loaded event triggers properly and HandleTheme() runs as it should so I don't know why this happens.

@punker76 punker76 self-assigned this Sep 20, 2016

@punker76 punker76 added this to the 1.4.0 milestone Sep 20, 2016

@punker76 punker76 closed this Oct 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment