Search
Saturday, October 19, 2019 ..:: Blendblog.net ::.. Register  Login
 Bloggers Minimize

  
 Sponsors Minimize

 Print   
 Users Online Minimize
Membership Membership:
Latest New User Latest: KellyFenton
New Today New Today: 1
New Yesterday New Yesterday: 2
User Count Overall: 8149

People Online People Online:
Visitors Visitors: 12
Members Members: 0
Total Total: 12

Online Now Online Now:

  
 Welcome to blendblog.net! Minimize

If you are a developer or designer who is creating cutting edge user interface experiences using Microsoft Expression Blend you've just found a great resource!  The purpose of this site is to share our experience with this brand new product.  As with any new piece of software there is a ton to discover.  Bugs will be revealed and workarounds discovered, hopefully this can be a resource to share in the discovery process!

While this site will focus largely on Expression Blend, it will also encompass WPF, Visual Studio, Silverlight, and other .net 3.5 technologies as they relate to the creation of great software.

Please login using your Microsoft LiveID or register a new account.  Doing so will let you comment on any of the blog entries on the site.  We look forward to helping you in your endeavors as well as you helping others in theirs!  We'd love to have more bloggers on our site...if you are interested please register and contact us!

Follow us:


  
 WPF Resource Dictionary Browser for DrawingImages Minimize
Location: BlogsSean Cullinan    
Posted by: Sean Cullinan 3/12/2008 7:01 PM

I apologize for not blogging in a while.  I have been focused 100% on getting a prototype of our product ready for some meetings we have across the pond at months end and haven't had a chance to get on here.

In building our application we have created a big resource dictionary that contains nothing but DrawingImage objects.  I created a helper class to to give me some intellisense to get the images out of this resource dictionary.  The resource dictionary is stored in its own XAML file.  As we added more and more objects it became more difficult to remember exactly what the objects looked like. 

I then started looking for some 3rd party Vector graphics files and found Grafile.  The provided samples of their work that are already put in XAML resource dictionaries.  However they provided no thumbnails to facilitate browsing the images.

This made me realize that there is definitely a need out there for a simple DrawingImage browser application.  Four hours later and I had one :)  Attached to this post is my source and a compiled .exe.  The code is in VB but should be pretty straighforward to C# people. 

The most interesting challenge when writing this code was how to load xaml files off of disk into a resource dictionary.  Most examples I've seen have the XAML files in the project.  The trick is to use the System.Windows.Markup.XAMLReader.  This can "load" the xaml out of a stream into an object, in this case a resource dictionary object declared in code.  I had already read my xaml file into a byte array (as I also keep it in an xmldocument object which I'll explain in a second) and was able to simply use a memorystream object that pointed to this bytearray and use that to load it into the XAMLReader.

Because there is no way to access the resourcedictionary by index, just by key, I also keep a copy of the resource dictionary in an xmlNodeList.  This way I can get the key easily.

Another stumbling block is the lack of a directory picker in WPF.  I used the system.win32.OpenFileDialog method which isn't perfect (it looks like you are picking a file) but works for now.  To make it seem like this behavior is by design I made it so that when you select a file it opens the whole directory but makes the file you selected the "active file." 

The application is simple to use.  It lets you select a directory (or even a file in a directory) and presents a list of files with the .xaml extension in a simple listbox.  If you select a file that is a resource dictionary with drawing images in it then it will load up the first drawingImage on the right side.  It gives you the "key" name of the image in the resource dictionary and a slider to move from image to image.

I included a test resource dictionary in the zip file.  Also, please don't use the maginfier icon that I provided in your commercial apps, it is something that I created for my commercial app and I'd like to keep it unique (its not that great anyway).

If anyone wants to play it would be cool to add a "filmstrip" type view giving previews of all images.

I already found some duplicate entries in our rather large Images ResourceDictionary thanks to this program.  It is going to be very useful for us going forward and I figure I'd share it with the community!

Sean

ImageBrushViewer.zip

Copyright ©2008 Sean Cullinan
Permalink |  Trackback

Comments (5)   Add Comment
Re: WPF Resource Dictionary Browser for DrawingImages    By daview on 10/10/2011 11:41 PM
I have a question.<br><br>I want to use the DrawingImage drawing some ICONs or IconImages for other Application, How can I do?

http://www.pradaoutlet-store.com/    By prada outlet on 2/19/2014 11:08 PM
<p>I do love my <a href="http://www.michaelkorsoutletmkstore.com/" title="michael kors outlet">michael kors outlet</a> bag but if I had a bigger budget I would definitely buy a bag more like the <a href="http://www.michael-kors-outlet-store.com/" title="michael kors outlet">michael kors outlet store</a>.This latest fashion film sees creative director Matthew Williams work next to director <a href="http://www.coachhandbagsnew2014.com/" title="coach handbags">coach handbags outlet</a>, with &quot;FUCCBOI&quot; being &quot;a study of behaviour, style and movement that focuses on the interplay between dramatic performance and trashing.&quot;But with so <a href="http://www.coach-factory-outlet-online.com/" title="coach factory">coach factory outlet online</a> out there, it's hard to keep track of what app is meant for what,but will you be voting for sophistication, simple chic, girly grunge or clashing prints?.Peter Pilotto for <a href="http://www.coachfactoryoutlet-2014.com/" title="coach factory">coach factory outlet</a> Feb 9! But before you shop, check out how <a href="http://www.fitflopflip-flop.com/" title="flip flops">fitflop shoes</a>, Taylor Schilling, and a few other gals worked the collection at the <a href="http://www.fitflopdesign.com/" title="fitflops">fitflops</a> Fashion Week celebration. </p><br><p><a href="http://www.coachoutletstoreonline2014.com/" title="coach outlet store online">coach outlet store online</a> is pregnant and totally freaking nekkid.We both have these shoes and are obsessed with them.Sometimes we get <a href="http://www.pradaoutlet-store.com/" title="prada outlet">prada outlet</a> in the hustle that we forget to step back and enjoy <a href="http://www.coachfactoryoutlet-purse.com/" title="coach factory outlet">coach outlet</a>. He drove that point into the ground on Sunday when he left a <a href="http://www.coachfactoryoutlet-2014.com/" title="www.coachfactory.com/store">www.coachfactory.com/store</a> after answering just one question. Don't get us wrong - we are devoted urbanites through and through, but the shows, events, and general craziness of <a href="http://www.ukfitflops.com/" title="fitflop uk">fitflop uk</a> can leave us feeling a little worn out. which got me thinking about which bag to carry (shocking, I know).The <a href="http://www.coachfactoryoutlethandbags.com/" title="coach factory handbags outlet">coach handbags outlet</a> has mixed together Picasso's cubism, along with some surrealism and pop art to re-imagine <a href="http://www.fitflopsflipflops.com/" title="flip flops">fitflops</a> and coach as high art prints. It's also about how the headphones fit well not only on your ears but your body as well. The efficiency of the headphones will depend on how you're going to use it.</p><br><p>The new premium sneaker from fitflop has reworked the classic running <a href="http://www.coachstoreonline.com/" title="coach outlet store online">coach outlet store online</a> shoe and styled it with contrast studs and multi-colored panels.Meg Lukens Noonan finds out on a sartorial journey in search of tailors, craftsmen, artisans and a fitflop .The survey panels are categorized so you may pick what is of interest to you and there are tools that can help you keep track of what survey you have taken and your earnings.</p><br>

http://www.pradaoutlet-store.com/    By prada outlet on 2/19/2014 11:09 PM
<p>I do love my <a href="http://www.michaelkorsoutletmkstore.com/" title="michael kors outlet">michael kors outlet</a> bag but if I had a bigger budget I would definitely buy a bag more like the <a href="http://www.michael-kors-outlet-store.com/" title="michael kors outlet">michael kors outlet store</a>.This latest fashion film sees creative director Matthew Williams work next to director <a href="http://www.coachhandbagsnew2014.com/" title="coach handbags">coach handbags outlet</a>, with &quot;FUCCBOI&quot; being &quot;a study of behaviour, style and movement that focuses on the interplay between dramatic performance and trashing.&quot;But with so <a href="http://www.coach-factory-outlet-online.com/" title="coach factory">coach factory outlet online</a> out there, it's hard to keep track of what app is meant for what,but will you be voting for sophistication, simple chic, girly grunge or clashing prints?.Peter Pilotto for <a href="http://www.coachfactoryoutlet-2014.com/" title="coach factory">coach factory outlet</a> Feb 9! But before you shop, check out how <a href="http://www.fitflopflip-flop.com/" title="flip flops">fitflop shoes</a>, Taylor Schilling, and a few other gals worked the collection at the <a href="http://www.fitflopdesign.com/" title="fitflops">fitflops</a> Fashion Week celebration. </p><br><p><a href="http://www.coachoutletstoreonline2014.com/" title="coach outlet store online">coach outlet store online</a> is pregnant and totally freaking nekkid.We both have these shoes and are obsessed with them.Sometimes we get <a href="http://www.pradaoutlet-store.com/" title="prada outlet">prada outlet</a> in the hustle that we forget to step back and enjoy <a href="http://www.coachfactoryoutlet-purse.com/" title="coach factory outlet">coach outlet</a>. He drove that point into the ground on Sunday when he left a <a href="http://www.coachfactoryoutlet-2014.com/" title="www.coachfactory.com/store">www.coachfactory.com/store</a> after answering just one question. Don't get us wrong - we are devoted urbanites through and through, but the shows, events, and general craziness of <a href="http://www.ukfitflops.com/" title="fitflop uk">fitflop uk</a> can leave us feeling a little worn out. which got me thinking about which bag to carry (shocking, I know).The <a href="http://www.coachfactoryoutlethandbags.com/" title="coach factory handbags outlet">coach handbags outlet</a> has mixed together Picasso's cubism, along with some surrealism and pop art to re-imagine <a href="http://www.fitflopsflipflops.com/" title="flip flops">fitflops</a> and coach as high art prints. It's also about how the headphones fit well not only on your ears but your body as well. The efficiency of the headphones will depend on how you're going to use it.</p><br><p>The new premium sneaker from fitflop has reworked the classic running <a href="http://www.coachstoreonline.com/" title="coach outlet store online">coach outlet store online</a> shoe and styled it with contrast studs and multi-colored panels.Meg Lukens Noonan finds out on a sartorial journey in search of tailors, craftsmen, artisans and a fitflop .The survey panels are categorized so you may pick what is of interest to you and there are tools that can help you keep track of what survey you have taken and your earnings.</p><br>

http://www.pradaoutlet-store.com/    By prada outlet on 2/19/2014 11:12 PM
<p>I do love my <a href="http://www.michaelkorsoutletmkstore.com/" title="michael kors outlet">michael kors outlet</a> bag but if I had a bigger budget I would definitely buy a bag more like the <a href="http://www.michael-kors-outlet-store.com/" title="michael kors outlet">michael kors outlet store</a>.This latest fashion film sees creative director Matthew Williams work next to director <a href="http://www.coachhandbagsnew2014.com/" title="coach handbags">coach handbags outlet</a>, with &quot;FUCCBOI&quot; being &quot;a study of behaviour, style and movement that focuses on the interplay between dramatic performance and trashing.&quot;But with so <a href="http://www.coach-factory-outlet-online.com/" title="coach factory">coach factory outlet online</a> out there, it's hard to keep track of what app is meant for what,but will you be voting for sophistication, simple chic, girly grunge or clashing prints?.Peter Pilotto for <a href="http://www.coachfactoryoutlet-2014.com/" title="coach factory">coach factory outlet</a> Feb 9! But before you shop, check out how <a href="http://www.fitflopflip-flop.com/" title="flip flops">fitflop shoes</a>, Taylor Schilling, and a few other gals worked the collection at the <a href="http://www.fitflopdesign.com/" title="fitflops">fitflops</a> Fashion Week celebration. </p><br><p><a href="http://www.coachoutletstoreonline2014.com/" title="coach outlet store online">coach outlet store online</a> is pregnant and totally freaking nekkid.We both have these shoes and are obsessed with them.Sometimes we get <a href="http://www.pradaoutlet-store.com/" title="prada outlet">prada outlet</a> in the hustle that we forget to step back and enjoy <a href="http://www.coachfactoryoutlet-purse.com/" title="coach factory outlet">coach outlet</a>. He drove that point into the ground on Sunday when he left a <a href="http://www.coachfactoryoutlet-2014.com/" title="www.coachfactory.com/store">www.coachfactory.com/store</a> after answering just one question. Don't get us wrong - we are devoted urbanites through and through, but the shows, events, and general craziness of <a href="http://www.ukfitflops.com/" title="fitflop uk">fitflop uk</a> can leave us feeling a little worn out. which got me thinking about which bag to carry (shocking, I know).The <a href="http://www.coachfactoryoutlethandbags.com/" title="coach factory handbags outlet">coach handbags outlet</a> has mixed together Picasso's cubism, along with some surrealism and pop art to re-imagine <a href="http://www.fitflopsflipflops.com/" title="flip flops">fitflops</a> and coach as high art prints. It's also about how the headphones fit well not only on your ears but your body as well. The efficiency of the headphones will depend on how you're going to use it.</p><br><p>The new premium sneaker from fitflop has reworked the classic running <a href="http://www.coachstoreonline.com/" title="coach outlet store online">coach outlet store online</a> shoe and styled it with contrast studs and multi-colored panels.Meg Lukens Noonan finds out on a sartorial journey in search of tailors, craftsmen, artisans and a fitflop .The survey panels are categorized so you may pick what is of interest to you and there are tools that can help you keep track of what survey you have taken and your earnings.</p><br>

http://www.ukfitflops.com/    By fitflop shoes on 3/5/2014 9:55 PM
<p>We announced our run <a href="http://www.coach-factory-outlet-online.com/" title="coach factory">coach factory outlet online</a> and by Tuesday morning, we had emails from running crews around the world who wanted to take this <a href="http://www.michaelkorsoutletmkstore.com/" title="michael kors outlet">michael kors outlet</a> global, to which we said HELL YEAH! The <a href="http://www.coachfactoryoutlets2014.com/" title="coach factory">coach factory outlet</a> hue is much more fun, and it's made from a tougher <a href="http://www.coachfactoryoutletspurse.com/" title="coach factory outlet">coach outlet</a>.Models wear creations for <a href="http://www.michael-kors-outlet-store.com/" title="michael kors outlet">michael kors outlet</a>'s ready-to-wear autumn/winter collection. Since then, <a href="http://www.coachstoreonline.com/" title="coach outlet store online">coach outlet store online</a> got his physical act back together with some winter training in his <a href="http://www.coachoutletstoreonline2014.com/" title="coach outlet store online">coach outlet store online</a> as well as a trip to <a href="http://www.fitflopdesign.com/" title="fitflops">fitflop</a> summer in Patagonia.The 36-year old "<a href="http://www.coachhandbagsnew2014.com/" title="coach handbags">coach handbags outlet</a> Lines" singer returned to the stage last night for his first concert following the news of he and <a href="http://www.coachfactoryoutlethandbags.com/" title="coach factory handbags outlet">coach factory outlet</a>'s separation, and he opened up to the audience before dedicating his song "<a href="http://www.ukfitflops.com/" title="fitflop">fitflop shoes</a>" to his estranged wife. </p><br><p>It has to fall somewhere between <a href="http://www.pradaoutlet-store.com/" title="prada outlet">prada outlet</a> and sensible (granted, that's a word rarely uttered along the front rows of any runway). What's your secret to traveling in style?Here are some <a href="http://www.fitflopflip-flop.com/" title="flip flops">fitflop shoes</a> paper dolls to help you create your own <a href="http://www.coachfactoryoutlets2014.com/" title="www.coachfactory.com/store">www.coachfactory.com/store</a>. How (ahem) scandalous.We have seen <a href="http://www.fitflopsflipflops.com/" title="flip flops">fitflops</a> for several charities. Clarks Sportswear Tawyer silhouette by fitflops, we're given a couple new angles on the shoe, which is dressed up in navy and burgundy, with leather laces and a rubber;</p><br>


Your name:
Title:
Comment:
Add Comment   Cancel 

  
 Search Minimize

  
 Archive Minimize

  
 Blendblog Survey Minimize
Our next client application will be written using:




Which Tablet Do you expect to buy?





Submit Survey  View Results

 Print   
Copyright 2011 by blendblog.net   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2019 by DotNetNuke Corporation