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
or
To access it in .cs
OK, Finally i solved it myself. here is how i solved it.
When you create
Phone Class Library Project
you will not theResourceDictionary.xaml by default
, so what create a xaml page,like how you create a normal xaml file.Now remove the .cs file that is created, add in the .XAML file add your style which is within
ResourceDictionary
tag.The above is all done in
Library project.
Now in the
child app:
suppose you have a style defined in ResourceDictionary as MainScreenButtonStyle you can set in this way