I was using the stable version on nuget and changed to 1.1.3-alpha225 also from nuget. I did that so I could call dialogs through the ViewModel. But now I'm getting this error:
An error occurred while finding the resource dictionary "pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml"
All other dictionaries are ok:
<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" />
The controls is the only one giving error:
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml"
Does anyone know if it changed on the new version or if there's a known bug?
Related
i'm trying to use MaterialDesginThemes and HandyControl ResourceDictionary together but after i run my application it seems that it only recognising Handycontrol recourses at then i find out that application resources can only recognize the last line in the recourse dictionary can any one help how to fix this problem
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Purple.xaml" />
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
This is my App.xaml conf
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Goldenrod.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.DataGrid.xaml" />
with that I receive this error:
cannot locate resource 'themes/recommended/primary/materialdesigncolor.goldenrod.xaml'
But if I change Goldenrod by Blue then everything works fine, I also can use Goldenrod as foreground in my Views etc.
The problem happens if try to use it as Primary in my Theme
I just created a new project and got the MahApps.Metro from nuget. I added this to my App.xaml:
<Application.Resources>
<ResourceDictionary>
<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>
</ResourceDictionary>
</Application.Resources>
But I get one error like this for each ResourceDictionary entry:
An error occurred while finding the resource dictionary "pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml".
But the dictionaries are found because when I run the application the styles are being applied to the controls. It seems to be a design time only error.
Is there any way to hide them? I'm also having errors for each MahApps Style property that I have set in my XAMLs. Since it's a big application my Error List always has ~30 errors.
This is really annoying, because the styles are being applied when the applicatino run, so there's nothing wrong. When I have a real error it turns in a hell to find it in the middle of all of these other 'erros'
I have the same error if i don't have checked "Run project code in XAML Designer (if supported)". Maybe it is a problem.
My resource merged in App.xaml. but in design mode not found
in Run time it found and work correctly
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Assets/Styles/Main.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Style="{StaticResource pnlRibbon}" the resource "pnlRibbon" could not be resolved in design time
Use this syntax:
<ResourceDictionary Source="projectName;component/Assets/Styles/Main.xaml" />
it been solved with add this code to the .csproj file
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
I originally posted this message on the MVVM Light CodePlex page but haven't heard a response yet so I'm hoping someone here can help me. Here is the question:
I recently started playing with MVVM (new to WPF too - quite the learning curve for all of this) and everything was working great with my ViewModelLocator instance and binding design-time for VS2010 until I started using the MetroToolkit provided on CodePlex. Before utilizing the toolkit, I had the following:
<Application.Resources>
<local:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />
</Application.Resources>
All of my views were binding great and everything looked really good. I was surprised at just how easy someone without MVVM (or MVC) experience could get up and running. Then I hit a snag of MetroToolkit requiring merged resource dictionaries and now no matter what I try I can't get VS to find my ViewModelLocator again inside App.xaml. Here is the new markup:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Colors.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Animations.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Geometry.xaml"/>
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Generic.xaml"/>
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Buttons.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Scrollbar.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Scrollviewer.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/RadioButton.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/ProgressBar.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/ContextMenu.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Tooltip.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Checkbox.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Headings.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Textbox.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Combobox.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Slider.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Expander.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/TabControl.xaml" />
</ResourceDictionary.MergedDictionaries>
<local:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />
</ResourceDictionary>
</Application.Resources>
I have tried giving the resource dictionary a key, adding the line outside of the area (above and below - throws nasty and very unhelpful errors) and can't get it to find my VM Locator. It works immediately when I remove the block from App.xaml, but based on my very limited knowledge of WPF I need those if I want the styles to be available to all views in my application.
Any thoughts? This has been driving me crazy for a few hours now.
yep...I just saw this the other day...You have to put a resource dictionary inside...
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Colors.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Animations.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Geometry.xaml"/>
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Generic.xaml"/>
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Buttons.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Scrollbar.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Scrollviewer.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/RadioButton.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/ProgressBar.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/ContextMenu.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Tooltip.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Checkbox.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Headings.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Textbox.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Combobox.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Slider.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/Expander.xaml" />
<ResourceDictionary Source="/MetroToolkit;component/Themes/Dark/TabControl.xaml" />
<ResourceDictionary>
<local:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
**EDIT
Sorry...Fixed it now...I was going from memory...this is the way it is in mine.
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Dictionaries/converters.xaml" />
<ResourceDictionary Source="assets/styles.xaml" />
<ResourceDictionary Source="assets/sdkstyles.xaml" />
<ResourceDictionary Source="assets/corestyles.xaml" />
<ResourceDictionary>
<local:ApplicationResources x:Key="ApplicationResources" />
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>