Search
Wednesday, July 24, 2019 ..:: Blendblog.net ::.. Register  Login
 Bloggers Minimize

  
 Sponsors Minimize

 Print   
 Users Online Minimize
Membership Membership:
Latest New User Latest: JessieSmalls
New Today New Today: 0
New Yesterday New Yesterday: 1
User Count Overall: 8084

People Online People Online:
Visitors Visitors: 24
Members Members: 0
Total Total: 24

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:


  
 Styling items of a WPF RibbonSplitButton (presumably RibbonToggleButton)...don't use a datatemplate! Minimize
Location: BlogsSean Cullinan    
Posted by: Sean Cullinan 6/4/2012 1:55 PM
Here's the scenario, I am using the WPF Ribbon control (release version). I have a RibbonSplitButton and I want it to present a list of checkable RibbonMenuItems based on an obserable collection of object that is populated at runtime. My first inclination is to set the ItemsSource property of the RibbonSplitButton to my observable collection, then create a datatemplate specified as the ItemsTemplate property of the RibbonSplitButton which contains the RibbonMenuItem. This XAML would look like this:
<ribbon:RibbonSplitButton ItemsSource="{MySource}">
     <
ribbon:RibbonSplitButton.ItemTemplate>
         <
DataTemplate>
              <
ribbon:RibbonMenuItem Header="{Binding MyHeader}" IsCheckable="True" IsChecked="{Binding MyIsChecked}"></< font>ribbon:RibbonMenuItem>
         </
DataTemplate>
      </
ribbon:RibbonSplitButton.ItemTemplate>
</
ribbon:RibbonSplitButton>
What this actually yields though is a RibbonMenuItem rendered inside of another RibbonMenuItem. Quite ugly. The reason for this is that the default object type that is used to present an item in a RibbonSplitButton's dropdown IS a RibbonMenuItem. So this datatemplate puts a RibbonMenuItem inside of another. Once I realized this I figured out that using the ItemContainerStyle could get me the result I wanted. The ItemContainerStyle styles the control that is being used to render the item. Since it is a RibbonMenuItem already (which happens to be the object type I wanted to use anyway) we can use Setters bound to our object to acheive our goal. Here's the proper XAML:
<ribbon:RibbonSplitButton x:Key="Hello" ItemsSource="{MySource}">
     <
ribbon:RibbonSplitButton.ItemContainerStyle>
          <Style TargetType="{x:Type ribbon:RibbonMenuItem}">
               <Setter Property="Header" Value="{Binding Name}"/>
               <Setter Property="IsCheckable" Value="True"/>
               <Setter Property="IsChecked" Value="{Binding IsChecked}"/>
          </ Style>
     </ribbon:RibbonSplitButton.ItemContainerStyle>
</ribbon:RibbonSplitButton>
 
I hope this helps someone else out there and I hope it makes sense!
 
Sean
Permalink |  Trackback

Comments (5)   Add Comment
Re: Styling items of a WPF RibbonSplitButton (presumably RibbonToggleButton)...don't use a datatemplate!    By Bibhu on 6/28/2012 4:46 AM
I did not get what is the x:Key="Hello"

Re: Styling items of a WPF RibbonSplitButton (presumably RibbonToggleButton)...don't use a datatemplate!    By stiphy on 7/22/2012 5:06 PM
You could remove that Key, in the example I pasted this from the button was a Hello button and it just came from there. The key isn't relevant in this demo.

Re: Styling items of a WPF RibbonSplitButton (presumably RibbonToggleButton)...don't use a datatemplate!    By fdsa on 3/4/2013 3:34 AM
http://www.dafdfsa.info/ [url=http://www.dafdfsa.info/]fdsg[/url] <a href="http://www.dafdfsa.info/">dafd</a>

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.ukfitflops.com/    By fitflop shoes on 3/5/2014 9:59 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