a·gen·tic a·gil·i·ty

Infragistics WPF

Overview of using Infragistics WPF controls, focusing on dynamic menu generation with data binding and templates, and challenges with documentation and template selection.

Published on
2 minute read
Image
https://nkdagility.com/resources/qNzd15yz5fn
Subscribe

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   1: <igRibbon:XamRibbon.ApplicationMenu>
1   2: 
1   3:             <igRibbon:ApplicationMenu>
1   4:                 <igRibbon:MenuTool x:Name="uxTeamServerMenuTool" Caption="Team Server" ItemsSource="{Binding AvailableServers}"                                           ItemTemplate="{DynamicResource tAvailableServers}" ButtonType="DropDown"                                           LargeImage="ResourcesImagesTeamServerSelectIcon.png">
1   5:                 </igRibbon:MenuTool>
1   6:                 <igRibbon:MenuTool x:Name="uxTeamProjectMenuTool" Caption="Team Project" ItemsSource="{Binding AvailableProjects}"                                             ButtonType="DropDown" SmallImage="ResourcesImagesTeamProjectSelectIcon.png">
1   7:                 </igRibbon:MenuTool>
1   8:                 <igRibbon:MenuTool x:Name="uxHeatConnectionMenuTool" Caption="Heat Server" ButtonType="DropDown">
1   9:                 </igRibbon:MenuTool>
1  10:                 <igRibbon:MenuTool x:Name="uxHeatApplicationMenuTool" Caption="Heat App" ButtonType="DropDown" >
1  11:                 </igRibbon:MenuTool>
1  12:                 <!-- Place a button in the footer of the ApplicationMenu that allows the user to quit the application. -->
1  13:                 <igRibbon:ApplicationMenu.FooterToolbar>
1  14:                     <igRibbon:ApplicationMenuFooterToolbar>
1  15:                         <igRibbon:ButtonTool Caption="Settings" Command="local:Commands.ClearSettingsCommand" />
1  16:                         <igRibbon:ButtonTool Caption="Exit" />
1  17:                     </igRibbon:ApplicationMenuFooterToolbar>
1  18:                 </igRibbon:ApplicationMenu.FooterToolbar>
1  19:             </igRibbon:ApplicationMenu>
1  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   1: <DataTemplate x:Key="tAvailableServers" DataType="{x:Type tfs:TeamFoundationServer}">
1   2:            <igRibbon:RadioButtonTool
1   3:                            Caption="{Binding Name}"
1   4:                            Tag="{Binding}"
1   5:                            LargeImage="ResourcesImagesTeamServerSelectIcon.png"
1   6:                            igRibbon:MenuToolBase.MenuItemDescription="{Binding Url.ToString}"/>
1   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…

Technorati Tags: ALM   WPF   TFS

Subscribe

Related Blog

No related videos found.

Connect with Martin Hinshelwood

If you've made it this far, it's worth connecting with our principal consultant and coach, Martin Hinshelwood, for a 30-minute 'ask me anything' call.

Our Happy Clients​

We partner with businesses across diverse industries, including finance, insurance, healthcare, pharmaceuticals, technology, engineering, transportation, hospitality, entertainment, legal, government, and military sectors.​

Boxit Document Solutions Logo

Boxit Document Solutions

Lockheed Martin Logo

Lockheed Martin

Ericson Logo

Ericson

Sage Logo

Sage

Kongsberg Maritime Logo

Kongsberg Maritime

Deliotte Logo

Deliotte

DFDS Logo

DFDS

Slicedbread Logo

Slicedbread

Bistech Logo

Bistech

Big Data for Humans Logo

Big Data for Humans

Workday Logo

Workday

Qualco Logo

Qualco

Brandes Investment Partners L.P. Logo

Brandes Investment Partners L.P.

Epic Games Logo

Epic Games

Microsoft Logo

Microsoft

Graham & Brown Logo

Graham & Brown

Xceptor - Process and Data Automation Logo

Xceptor - Process and Data Automation

Cognizant Microsoft Business Group (MBG) Logo

Cognizant Microsoft Business Group (MBG)

Washington Department of Enterprise Services Logo

Washington Department of Enterprise Services

Washington Department of Transport Logo

Washington Department of Transport

Royal Air Force Logo

Royal Air Force

Ghana Police Service Logo

Ghana Police Service

Department of Work and Pensions (UK) Logo

Department of Work and Pensions (UK)

Nottingham County Council Logo

Nottingham County Council

MacDonald Humfrey (Automation) Ltd. Logo

MacDonald Humfrey (Automation) Ltd.

Sage Logo

Sage

Teleplan Logo

Teleplan

Milliman Logo

Milliman

Big Data for Humans Logo

Big Data for Humans

Epic Games Logo

Epic Games