Martin Hinshelwood's Blog

A Scottish dyslexic software developer: Team System MVP, .NET architect, developer, evangelist, technology enthusiast and multi-dimensional free thinker
posts - 322, comments - 385, trackbacks - 67

My Links

News

Get illustrations like mine

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Get Microsoft Silverlight

Subscribe

Personal

Accreditation

Stats

Twitter












Tag Cloud

Article Categories

Archives

Post Categories

Image Galleries

Blogs I read

Blogs of Friends

Multi-Dimentional Free Thinking Bloggers

Personal

Projects

VSTS

Infragistics WPF

 

I am currently getting to grips with the Infragistics WPF controls that they call NetAdvantage for WPF. So far I have found them easy to use, but the documentation of examples is very lax. Do not mistake me, these components are fantastic and do way more work for me than I would care to do myself, but if you Google a particular piece of their API invariable you will get pure documentation and no samples. If you are lucky someone has asked a specific question about it and you can skim their answers, but the likely hood of finding an answer to your question is negligible in my experience.

I still love the components, it just makes it a little more difficult to develop with them…

An example would maybe get us all on the same page:

I am using their Ribbon components in one of my applications and wanted to dynamically generate (using a binding) the menu options.

   1: <igRibbon:XamRibbon.ApplicationMenu>
   2:  
   3:             <igRibbon:ApplicationMenu>

4: <igRibbon:MenuTool x:Name="uxTeamServerMenuTool" Caption="Team Server" ItemsSource="{Binding AvailableServers}"

ItemTemplate="{DynamicResource tAvailableServers}" ButtonType="DropDown"

LargeImage="\Resources\Images\TeamServerSelectIcon.png">

   5:                 </igRibbon:MenuTool>

6: <igRibbon:MenuTool x:Name="uxTeamProjectMenuTool" Caption="Team Project" ItemsSource="{Binding AvailableProjects}"

ButtonType="DropDown" SmallImage="\Resources\Images\TeamProjectSelectIcon.png">

   7:                 </igRibbon:MenuTool>
   8:                 <igRibbon:MenuTool x:Name="uxHeatConnectionMenuTool" Caption="Heat Server" ButtonType="DropDown">
   9:                 </igRibbon:MenuTool>
  10:                 <igRibbon:MenuTool x:Name="uxHeatApplicationMenuTool" Caption="Heat App" ButtonType="DropDown" >
  11:                 </igRibbon:MenuTool>
  12:                 <!-- Place a button in the footer of the ApplicationMenu that allows the user to quit the application. -->
  13:                 <igRibbon:ApplicationMenu.FooterToolbar>
  14:                     <igRibbon:ApplicationMenuFooterToolbar>
  15:                         <igRibbon:ButtonTool Caption="Settings" Command="local:Commands.ClearSettingsCommand" />
  16:                         <igRibbon:ButtonTool Caption="Exit" />
  17:                     </igRibbon:ApplicationMenuFooterToolbar>
  18:                 </igRibbon:ApplicationMenu.FooterToolbar>
  19:             </igRibbon:ApplicationMenu>
  20:         </igRibbon:XamRibbon.ApplicationMenu>

As you can see in line 4 there is a binding that does indeed populate the list. But I am having trouble getting the template to take. I want the Items listed as a set of radio buttons (kinda) and so I added a Template:

   1: <DataTemplate x:Key="tAvailableServers" DataType="{x:Type tfs:TeamFoundationServer}">
   2:            <igRibbon:RadioButtonTool
   3:                            Caption="{Binding Name}"
   4:                            Tag="{Binding}"
   5:                            LargeImage="\Resources\Images\TeamServerSelectIcon.png"
   6:                            igRibbon:MenuToolBase.MenuItemDescription="{Binding Url.ToString}"/>
   7:        </DataTemplate>

This should have displayed what I wanted, but it seams to be ignored.

To allow this to work, all I needed to do was remove the x:Key from the template. But why can't I specify a template by name. What if I wanted to have two templates and choose which one was displayed…

Print | posted on Tuesday, October 28, 2008 1:40 PM | Filed Under [ Team System Windows Presentation Foundation Team System: TFS Heat ITSM ]

Feedback

Gravatar

# re: Infragistics WPF

Hi Martin - I'd have to check with the developers, but my guess is that he Key is not allowed since you can instantiate the same template multiple times. If each instance ended up with the same key, you would have ambiguity. I'd prefer to see an exception raised which warned you, though I'm not sure if that's in the Infragistics code stack, or the Microsoft WPF stack. Eitehr way, I'll pass the feedback on to both the dev team and our docs team.
10/30/2008 4:19 PM | tony lombardo
Gravatar

# re: Infragistics WPF

Martin - good news, looks like this was a bug and is fixed in the latest release (2008.2 available for download today), and will be in the hotfix made available later this month.
11/3/2008 2:33 PM | tony lombardo

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 4 and 6 and type the answer here:

Powered by: