Skip to content
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

Wrong foreground/text color with dark theme under frame #3365

Closed
ivanjx opened this issue Nov 7, 2018 · 7 comments
Closed

Wrong foreground/text color with dark theme under frame #3365

ivanjx opened this issue Nov 7, 2018 · 7 comments
Labels
Milestone

Comments

@ivanjx
Copy link

ivanjx commented Nov 7, 2018

Describe the bug
When im using this library's dark theme (BaseDark), i noticed that text color is not converted/applied properly if the control is under a Frame (currently only textblock faced this issue). Please fix this.

To Reproduce
Steps to reproduce the behavior:

  1. Apply base dark theme.
  2. Add a frame under mainwindow.
  3. Add a new page.
  4. Add a textblock on that newly created page.
  5. Load that page under mainwindow's Frame.
  6. Run the app.

Expected behavior
Textblock control text color converted properly to match the theme (should be white).

Screenshots

Running app result:
screenshot_34

Environment:

  • MahApps.Metro version v1.6.5

App.xaml contents:

<Application x:Class="xtreme_unlock_gui_new.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:xtreme_unlock_gui_new"
             Startup="Application_Startup">
    <Application.Resources>
        <ResourceDictionary>
            <FontFamily x:Key="FontAwesomeSolid">Resources/Fonts/fa-solid.otf#Font Awesome 5 Free Solid</FontFamily>
            <FontFamily x:Key="FontAwesomeBrand">Resources/Fonts/fa-brands.otf#Font Awesome 5 Brands Regular</FontFamily>

            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" />                
                <ResourceDictionary Source="Styles/BlackDataGridStyle.xaml" />
                <ResourceDictionary Source="Styles/HamburgerMenuStyle.xaml" />

                <ResourceDictionary Source="Resources/Languages/EN.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>
@punker76
Copy link
Member

punker76 commented Dec 4, 2018

@realivanjx To fix this issue just add the style to the page Style="{DynamicResource MetroPage}". This is the same WPF issue like if you want to use a default style for a Window. I can fix this only by adding the style explicit to the Page or I create a derived class like MetroPage which get's the style with the DefaultStyle key.

@punker76 punker76 closed this as completed Dec 4, 2018
@ivanjx
Copy link
Author

ivanjx commented Dec 4, 2018

Is MetroPage style available on version 1.6.5? I tried but vs2017 seems to not detecting it

@punker76
Copy link
Member

punker76 commented Dec 4, 2018

@realivanjx Yes, it's added via Controls.xaml.

punker76 added a commit that referenced this issue Dec 4, 2018
@ivanjx
Copy link
Author

ivanjx commented Dec 4, 2018

Is it under this? I use this for MetroWindow but idk for MetroPage:

xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"

@punker76
Copy link
Member

punker76 commented Dec 4, 2018

@realivanjx It's a style not a Control.

@ivanjx
Copy link
Author

ivanjx commented Dec 4, 2018

Thanks. It runs successfully and fixes the issue but vs2017 somehow throws an error:

'Page' TargetType does not match type of element 'PageInstance'

Is that normal?

@punker76
Copy link
Member

punker76 commented Dec 4, 2018

@realivanjx I don't know, this is related to which VS you use and/or which SDK...

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

No branches or pull requests

2 participants