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

MahApps Resources are renamed #92

Closed
timunie opened this issue Aug 19, 2019 · 1 comment · Fixed by #93
Closed

MahApps Resources are renamed #92

timunie opened this issue Aug 19, 2019 · 1 comment · Fixed by #93
Milestone

Comments

@timunie
Copy link
Contributor

timunie commented Aug 19, 2019

We should update the Styles resources here also.

for example
AccentColorBrush --> MahApps.Brushes.Accent

Happy coding
Tim

@timunie
Copy link
Contributor Author

timunie commented Aug 26, 2019

I made a workaround until this issue is closed. You have to copy the following code into into your Resources Section (e.g. in App.xaml if the workaround should be Application wide applied)

<!-- /!\ THIS SECTION IS A WORKAROUND FOR THE RENAMED RESOURCES IN MAHAPPS.METRO V2.0.0.ALPHA (ISSUE #92)  /!\ -->
<!--     For more details see: https://github.com/punker76/MahApps.Metro.SimpleChildWindow/issues/92           -->
<!--     You can savely remove this section after issue #92 is fixed                                           -->
            
<SolidColorBrush x:Key="BlackBrush" Color="{DynamicResource MahApps.Colors.Black}" />
<SolidColorBrush x:Key="WhiteBrush" Color="{DynamicResource MahApps.Colors.White}" />
<SolidColorBrush x:Key="AccentColorBrush" Color="{DynamicResource MahApps.Colors.Accent}" />
<SolidColorBrush x:Key="AccentBaseColorBrush" Color="{DynamicResource MahApps.Colors.AccentBase}" />
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{DynamicResource MahApps.Colors.IdealForeground}" />
<SolidColorBrush x:Key="GrayBrush3" Color="{DynamicResource MahApps.Colors.Gray3}" />
<SolidColorBrush x:Key="WindowTitleColorBrush" Color="{DynamicResource MahApps.Colors.Accent}" />
<SolidColorBrush x:Key="NonActiveWindowTitleColorBrush" Color="#808080" />
<SolidColorBrush x:Key="NonActiveBorderColorBrush" Color="#808080" />
<DynamicResource x:Key="BlackColor" ResourceKey="MahApps.Colors.Black"  />

<Style x:Key="LightMetroWindowButtonStyle"  TargetType="Button" BasedOn="{StaticResource MahApps.Styles.Button.MetroWindow.Light}" />


<Style TargetType="{x:Type SimpleChildWindow:ChildWindow}">
    <Setter Property="Background" Value="{DynamicResource MahApps.Brushes.White}" />
    <Setter Property="CloseButtonStyle" Value="{DynamicResource MahApps.Styles.Button.MetroWindow.Light}" />
    <Setter Property="NonActiveBorderBrush" Value="{DynamicResource MahApps.Brushes.Border.NonActive}" />
    <Setter Property="NonActiveGlowBrush" Value="{DynamicResource MahApps.Brushes.Border.NonActive}" />
    <Setter Property="OverlayBrush" Value="{DynamicResource MahApps.Brushes.Gray3}" />
    <Setter Property="TitleBarBackground" Value="{DynamicResource MahApps.Brushes.WindowTitle}" />
    <Setter Property="TitleBarNonActiveBackground" Value="{DynamicResource MahApps.Brushes.WindowTitle.NonActive}" />
    <Setter Property="TitleFontFamily" Value="{DynamicResource MahApps.Fonts.Header}" />
    <Setter Property="TitleFontSize" Value="{DynamicResource MahApps.Sizes.Font.WindowTitle}" />
    <Setter Property="TitleForeground" Value="{DynamicResource MahApps.Brushes.IdealForeground}" />
</Style>

<!-- /!\ E N D    S E C T I O N     T O     R E M O V E  /!\ -->

This workaround should also work for Issue #94 //cc @Symbai

Without the woraround
image

With the workaround
image

Happy coding
Tim

punker76 pushed a commit to timunie/MahApps.Metro.SimpleChildWindow that referenced this issue Aug 29, 2019
Renamed (Hopefully all DynamicResources) according to new MahApps.Metro names. If we don't update this, ChildWindow is broken.
punker76 added a commit to timunie/MahApps.Metro.SimpleChildWindow that referenced this issue Aug 29, 2019
@punker76 punker76 added this to the 2.0.0 milestone Aug 29, 2019
punker76 added a commit to timunie/MahApps.Metro.SimpleChildWindow that referenced this issue Aug 29, 2019
- SimpleChildWindowFocusVisual -> MahApps.Styles.ChildWindow.FocusVisualStyle
- ChildWindowTemplate -> MahApps.Templates.ChildWindow
- MahApps.Styles.ChildWindow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants