Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Can you reference a XAML Resource from an External Assembly?

 
 
Old 10-12-2006   #1 (permalink)
wackyphill@yahoo.com


 
 

Can you reference a XAML Resource from an External Assembly?

I have an assemblt called ControlsEx. In its project is a XAML file
that has some resources in a dictionary. How can I add those resources
into an Application Resource Collection. How do you reference it in the
Source property?

<Application.Resources>
<ResourceDictionary Source="r.xaml"></ResourceDictionary>
</Application.Resources>


Thanks.


My System SpecsSystem Spec
Old 10-18-2006   #2 (permalink)
Keith Patrick


 
 

Re: Can you reference a XAML Resource from an External Assembly?

Try this one. The source format is based on XPS, and the triple commas are
being used as escape codes.
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary
Source="pack://application:,,,/TheExternalResourceDll;component/TheFilePathInTheDll/MyExternalStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="YouCanStillDefineLocalResourcesHere">

</Style>
</ResourceDictionary>
</Application.Resources>



My System SpecsSystem Spec
Old 10-18-2006   #3 (permalink)
wackyphill@yahoo.com


 
 

Re: Can you reference a XAML Resource from an External Assembly?

Keith,

Yes, that's exactly what I was looking for. You nailed it, thank you
very much!

My System SpecsSystem Spec
Old 02-05-2007   #4 (permalink)


 
 

I Patrick

coud you tell me what is thefilepathinthedll ?

i've tried
"pack://application:,,,/FrameWork.UI.Controls;component/./ReusableStyle.xaml"/>

the xaml file is in the FrameWork.UI.Controls assembly & namespace

what's wrong ?
Thanks
Thierry

Quote  Quote: Originally Posted by Keith Patrick View Post
Try this one. The source format is based on XPS, and the triple commas are
being used as escape codes.
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary
Source="pack://application:,,,/TheExternalResourceDll;component/TheFilePathInTheDll/MyExternalStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="YouCanStillDefineLocalResourcesHere">

</Style>
</ResourceDictionary>
</Application.Resources>
My System SpecsSystem Spec
 

Thread Tools



Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46