Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Can you reference a XAML Resource from an External Assembly?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 10-12-2006   #1 (permalink)
wackyphill@yahoo.com
Guest


 

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
Guest


 

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
Guest


 

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)
Newbie


Join Date: Feb 2007
 
Rep Power: 13
ThierryDfr is on a distinguished road
  ThierryDfr is offline

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:
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
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Reference material for creating Resource Dictionary DLL Bruce Parker Avalon 1 06-01-2007 07:41 AM
Best way to reference ConfigurationManager.AppSettings in XAML Keith Patrick Avalon 0 12-19-2006 02:19 PM
How to reference another element in the same XAML file? TyraelTong Avalon 2 09-27-2006 08:20 AM
XAML Assembly References Joseph Bittman MVP MCSD Avalon 4 02-26-2006 02:23 PM
Reference a xaml window from a WinFX Custom Control Library ? Peter Fitzgibbons Avalon 3 02-24-2006 04:11 PM


Vistax64.com 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 2005-2008

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 47 48 49 50 51