c# - Group resource dictionary files under one resource dictionary file -
Given the Mahapps project, there is a resource dictionaty (Controls.xaml) which is shown as the "root" of the other
Removed the Controls.xaml items to the images given below and show extended with some resource dictionaries that have been merged into the Contorls.xaml file.
If you see in MahApps.Metro.NET45.csproj, you will find the project file:
include page =" styles \ control. Animated SINGLARO tab control. XML "& gt; ; & Lt; Subtype & gt; Designer & lt; / Sub type & gt; & Lt; Generator & gt; MSBuild: Compile & lt; / Generator & gt; & Lt; DependentUpon & gt; Controls.xaml & lt; / DependentUpon & gt; & Lt; / Page & gt;
And similarly for other nested xaml resources.
If you take a look at Controls.xaml, you will see that they use to merge some of the nested xaml resources in Controls.xaml such that:
& lt; ResourceDictionary.MergedDictionaries & gt; & Lt; Source Source = "Pack: // Application:;; / MahApps.Metro; Component / Style / Size .xml" /> & Lt; Resource Source Source = "Pack: // Application:;;, / MahApps.Metro; Components / Styles / Controls .page.xml" /> & Lt; ResourceDictionary source = "Pack: // Application:;; / MahApps.Metro; Components / Styles / ValidationIreTypeplate.xml" /> & Lt; Resource Source Source = "Pack: // Application:;;, / MahApps.Metro; Components / Styles / Controls. Scrollbars.xaml" /> & Lt; Source Source = "Pack: // Application:;;, / MahApps.Metro; Components / Styles / Controls. LISTView.xaml" />
etc ...
I am not sure why they do not add all nested xaml controls in control. Xml.
I do not think there is a way to add the DependentUpon xml node to Visual Studio IDE, I manually added and got the following results. IDE claims to add this functionality (I did not try them)
Note that DependentUpon describes the node : The optional string relies on this file to be compiled correctly Specifies the file I'm not sure that it has a physical effect on the compiling process.
In conclusion, if you want a visual representation in the IDE, where the files rely on each other, then add the dependent user xml node to the csproj file. If you also want to merge resource dictionaries, then ResourceDictionary. Use MergeDictionaries in XML.
Comments
Post a Comment