I am working on a project where i have child project which is referencing the library project.
In my Library project(Phone class library) how do i create ResourceDictionary.xaml where i need to add some styles and use it in xaml files and as well as .cs files.
I need to access styles in ResourceDictionary.xaml in my xaml files as well as .cs files how to do it ?
Create a folder as Generic
in the root folder and have your resource files there...
To access it in XAML
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Generic.xaml" />
</ResourceDictionary.MergedDictionaries>
or
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/AssembleName;component/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>
To access it in .cs
new URI(pack://application:,,,/AssembleName;component/Generic.xaml)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With