Re-use of Xaml between multiple Windows App projects not possible? RRS feed

  • Question

  • I am working on developing several apps for a company and would love to have a solid basis to work with xaml wise.

    I started with creating some basic styling files within a project and this makes it easy for me to control the style of the app / every element specifically.

    The next step would be to create a "styling project" which would contain most of the basic Xaml styling. Sadly i have not found any method so far to get this done. Have a missed any good walkthroughs or ideas? or is this simply not possible at this point of time?

    To be clear, I am looking for a way to share Xaml between multiple Windows Apps. Not the universal app projects for sharing between Windows and Windows Phone apps etc.



    Monday, January 5, 2015 10:09 AM


  • Hi Mike,

    URI schemes can help share resources in different store app project. You can create a library to hold those XAML styles. Please follow the steps.

    Step 1, create a library project in your solution, add resources dictionary in classlibrary project.

    Step 2, add library reference or library file to your store app or windows phone project.

    Step 3, merge resources dictionary in your store app project.

                    <ResourceDictionary Source="ms-appx:///ClassLibrary1/Dictionary1.xaml"></ResourceDictionary>
            <Button Content="Button" Style="{StaticResource buttonstyle}" HorizontalAlignment="Left" Margin="78,105,0,0" VerticalAlignment="Top"/>


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Tuesday, January 6, 2015 3:36 AM