Thursday, February 2, 2023 ..:: ::.. Register  Login
 Bloggers Minimize

 Sponsors Minimize

 Users Online Minimize
Membership Membership:
Latest New User Latest: SarahPuglisi
New Today New Today: 72
New Yesterday New Yesterday: 88
User Count Overall: 22923

People Online People Online:
Visitors Visitors: 52
Members Members: 0
Total Total: 52

Online Now Online Now:

 Welcome to! 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:RibbonMenuItem Header="{Binding MyHeader}" IsCheckable="True" IsChecked="{Binding MyIsChecked}"></< font>ribbon:RibbonMenuItem>
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}">
          <Style TargetType="{x:Type ribbon:RibbonMenuItem}">
               <Setter Property="Header" Value="{Binding Name}"/>
               <Setter Property="IsCheckable" Value="True"/>
               <Setter Property="IsChecked" Value="{Binding IsChecked}"/>
          </ Style>
I hope this helps someone else out there and I hope it makes sense!
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 [url=]fdsg[/url] <a href="">dafd</a>    By prada outlet on 2/19/2014 11:09 PM
<p>I do love my <a href="" 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="" title="michael kors outlet">michael kors outlet store</a>.This latest fashion film sees creative director Matthew Williams work next to director <a href="" 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="" 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="" title="coach factory">coach factory outlet</a> Feb 9! But before you shop, check out how <a href="" title="flip flops">fitflop shoes</a>, Taylor Schilling, and a few other gals worked the collection at the <a href="" title="fitflops">fitflops</a> Fashion Week celebration. </p><br><p><a href="" 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="" title="prada outlet">prada outlet</a> in the hustle that we forget to step back and enjoy <a href="" title="coach factory outlet">coach outlet</a>. He drove that point into the ground on Sunday when he left a <a href="" title=""></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="" 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="" 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="" 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="" 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>    By fitflop shoes on 3/5/2014 9:59 PM
<p>We announced our run <a href="" 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="" title="michael kors outlet">michael kors outlet</a> global, to which we said HELL YEAH! The <a href="" title="coach factory">coach factory outlet</a> hue is much more fun, and it's made from a tougher <a href="" title="coach factory outlet">coach outlet</a>.Models wear creations for <a href="" title="michael kors outlet">michael kors outlet</a>'s ready-to-wear autumn/winter collection. Since then, <a href="" title="coach outlet store online">coach outlet store online</a> got his physical act back together with some winter training in his <a href="" title="coach outlet store online">coach outlet store online</a> as well as a trip to <a href="" title="fitflops">fitflop</a> summer in Patagonia.The 36-year old "<a href="" 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="" title="coach factory handbags outlet">coach factory outlet</a>'s separation, and he opened up to the audience before dedicating his song "<a href="" title="fitflop">fitflop shoes</a>" to his estranged wife. </p><br><p>It has to fall somewhere between <a href="" 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="" title="flip flops">fitflop shoes</a> paper dolls to help you create your own <a href="" title=""></a>. How (ahem) scandalous.We have seen <a href="" 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:
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

Copyright 2011 by   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2023 by DotNetNuke Corporation