MahApps / MahApps.Metro

A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
https://mahapps.com
MIT License
9.29k stars 2.45k forks source link

Resources issues #319

Closed Rickrat closed 11 years ago

Rickrat commented 11 years ago

There is resource issues with the themes, to reproduce them, do as follows:

Create a WPF Project with reference to mahapps.metro and change main window to Controls:MetroWindow

in main window resources load only the colors. ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml"

in main window code behind, apply a theme:

            ThemeManager.ChangeTheme(this, ThemeManager.DefaultAccents.First(a => a.Name == "Blue"), Theme.Light);

Then run the app. works great. When you hover over the close/maximize buttons, you see the proper wording, and lines between them. e.g. [min] | [max] | [ x ] and the tooltips work as defined.

Now load the resources from the dictionaries in the window.resources. (NOTE IT IS controls.xaml THAT IS THE PROBLEM).

/Styles/Fonts.xaml
/Styles/Controls.xaml
/Styles/Controls.AnimatedSingleRowTabControl.xaml
/Styles/Accents/Blue.xaml
/Styles/Accents/BaseLight.xaml

Then re-run. the lines between the buttons are gone, and tooltips are black, and you can't read them. additionally, with Windows XP, it is even worse.

ghost commented 11 years ago

The lines? This is not a bug, this is the expected behaviour.

The tooltips for light themes are black background, white text. The tooltips for dark themes are light background, black text.

MahApps Metro Demo

Rickrat commented 11 years ago

What I am saying, is that the tooltips are black with black text. There is a bug with the controls.xaml.

Rickrat commented 11 years ago

Jpg

This is what I am talking about. If you have just colors.xaml loaded and change theme in code, the tooltips work. If you load

/Styles/Fonts.xaml
/Styles/Controls.xaml
/Styles/Controls.AnimatedSingleRowTabControl.xaml
/Styles/Accents/Blue.xaml
/Styles/Accents/BaseLight.xaml

Then it shows up black on black.

ghost commented 11 years ago

I can't replicate that, as indicated by my screenshot. Provide a full repro. The demo project does exactly what you're describing and works.

additionally, with Windows XP, it is even worse.

How is it "even worse"? Is it even blacker than black?

Rickrat commented 11 years ago
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" />

                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro.Resources;component/Icons.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />

            </ResourceDictionary.MergedDictionaries>

If I add those resources like that in the app.xaml, this effect can be seen (black on black). But if I include it in the window, it works fine e.g. can read tooltip, but the lines are gone.

MahApps.Metro_2013-01-22_16-39-32Z.zip (http://dl.compdj.com/files/MahApps.Metro_2013-01-22_16-39-32Z.zip)

Rickrat commented 11 years ago

lol "blacker than black". No, It's hard to describe what happens, when I get to work tomorrow, I will try to post the differences between xp and windows 7 for you here.

ghost commented 11 years ago

As per the documentation, MA.M resources need to be imported at the Window level, not at Application level.

Rickrat commented 11 years ago

Ahhh, ah ha. I see. But couldn't it be "fixed" to work at an application level?