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

ProgressDialog cannot find the AccentColorBrush Resources #1149

Closed
ye4241 opened this issue Mar 12, 2014 · 4 comments
Closed

ProgressDialog cannot find the AccentColorBrush Resources #1149

ye4241 opened this issue Mar 12, 2014 · 4 comments
Assignees
Labels
Milestone

Comments

@ye4241
Copy link

ye4241 commented Mar 12, 2014

        <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/BaseLight.xaml" />
        </ResourceDictionary.MergedDictionaries>

Add all ResourceDictionary, still show cannot find the AccentColorBrush Resources when i used the MetroDialogColorScheme.Theme.
i try to track this error still no answer.Only follow shows in the debug when i try to close the progress dialog.
i've see the PART_ProgressBar, but i seems ok...please help me out,i need the progress dialog works.

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='MahApps.Metro.Controls.MetroWindow', AncestorLevel='1''. BindingExpression:Path=ActualWidth; DataItem=null; target element is 'MetroProgressBar' (Name='PART_ProgressBar'); target property is 'Width' (type 'Double')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='MahApps.Metro.Controls.Dialogs.ProgressDialog', AncestorLevel='1''. BindingExpression:Path=ProgressBarForeground; DataItem=null; target element is 'MetroProgressBar' (Name='PART_ProgressBar'); target property is 'Foreground' (type 'Brush')
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='Remove'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='41580444'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='System.Windows.Media.Animation.Storyboard'; TargetElement.HashCode='41580444'; TargetElement.Type='System.Windows.Media.Animation.Storyboard'
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='Remove'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='33008913'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='System.Windows.Media.Animation.Storyboard'; TargetElement.HashCode='33008913'; TargetElement.Type='System.Windows.Media.Animation.Storyboard'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackColorBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='WhiteColorBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='DefaultFont'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='IdealForegroundColorBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='AccentColorBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='WhiteBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='IdealForegroundColorBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='IdealForegroundColorBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='ControlsDisabledBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='GrayBrush8'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackColorBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='WhiteColorBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='DefaultFont'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='IdealForegroundColorBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='AccentColorBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='WhiteBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='IdealForegroundColorBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='IdealForegroundColorBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='ControlsDisabledBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='GrayBrush8'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='DefaultFont'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='WhiteBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='ControlsDisabledBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='GrayBrush8'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='DefaultFont'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='WhiteBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='DefaultFont'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BlackBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='WhiteBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='TextBrush'

@AzureKitsune AzureKitsune self-assigned this Mar 12, 2014
@AzureKitsune
Copy link
Member

Where are you putting those resources? App.xaml or are you putting it in the top level of your MetroWindow?

@ye4241
Copy link
Author

ye4241 commented Mar 15, 2014

@Amrykid my application is a class library(类库), and it doesn't have the default app.xaml, so i can only put the ResourceDictionary under my MetroWindow, i know this causes this issue now.

when i try to add app.xaml, and make it the ApplicationDefination manually, it causes many new isuue, and the application cannot run.

i have sloved the System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='MahApps.Metro.Controls.MetroWindow', AncestorLevel='1''. BindingExpression:Path=ActualWidth; DataItem=null; target element is 'MetroProgressBar' (Name='PART_ProgressBar'); target property is 'Width' (type 'Double'), just change the Controls\Dialogs\ProgressDialog.cs,

ProgressBarForeground = this.FindResource("AccentColorBrush") as Brush;
to:
ProgressBarForeground = parentWindow.FindResource("AccentColorBrush") as Brush;

this code ensure the application find the resources...

when it comes to the message dialog, i haven't known how to solve...

@punker76 punker76 added this to the v0.14 milestone Mar 24, 2014
@AzureKitsune
Copy link
Member

@ye4241 Where are you adding the resources to?

AzureKitsune added a commit to AzureKitsune/MahApps.Metro that referenced this issue Mar 29, 2014
@ye4241
Copy link
Author

ye4241 commented Apr 2, 2014

@Amrykid the class library cannot define the ApplicationDefination, so use the Windows.Resources, I know it caused this issue, don't know how to solve.

when it comes to the New ThemeManager, can this solve this issue ( when a application don't have the App.xaml)?

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

4 participants