I am trying to do some simple binding with the XamOutlookBar.
The control seems to be binding but for some reason it looks as if the DataTemplates are not being applied. Here is my code... this is a very simple example I am working with...I must have missed something with the binding, I have used other controls from Infragistic and never had this issue...
Instead of using the bound object property respectively it just shows the object path... Here is a screen shot of the rendered page...
Here is my XAML
<UserControl xmlns:ig="">schemas.infragistics.com/xaml" x:Class="SilverlightApplication1.MainPage" xmlns="">schemas.microsoft.com/.../presentation" xmlns:x="">schemas.microsoft.com/.../xaml" xmlns:d="">schemas.microsoft.com/.../2008" xmlns:mc="">schemas.openxmlformats.org/.../2006" mc:Ignorable="d" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" > <UserControl.Resources> <DataTemplate x:Key="group2Template"> <ig:OutlookBarGroup> <ig:OutlookBarGroup.HeaderTemplate> <DataTemplate> <TextBlock Text="{Binding ItemName}" /> </DataTemplate> </ig:OutlookBarGroup.HeaderTemplate> <ig:OutlookBarGroup.ContentTemplate> <DataTemplate> <TextBlock Text="{Binding ItemName}" /> </DataTemplate> </ig:OutlookBarGroup.ContentTemplate> </ig:OutlookBarGroup> </DataTemplate> </UserControl.Resources> <Grid x:Name="LayoutRoot"> <ig:XamOutlookBar x:Name="test" HorizontalAlignment="Stretch" DefaultGroupsContainer="{StaticResource group2Template}" > </ig:XamOutlookBar> </Grid></UserControl>
Any my code behind....
public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); MockModel mm = new MockModel(); for(int i = 0; i < 3; i++){ MockNode mn = new MockNode(); mn.ItemName = String.Format("Node {0}", i); mm.Nodes.Add(mn); } this.test.GroupsSource = mm.Nodes; } } public class MockModel { public ObservableCollection<MockNode> Nodes; public MockModel() { Nodes = new ObservableCollection<MockNode>(); } } public class MockNode { public string ItemName {get;set;} public string ImageURL {get;set;} }
Hi,
Try the following XAML instead:
<Grid x:Name="LayoutRoot" Background="White">
<ig:XamWebOutlookBar x:Name="TestXamWebOutlookBar">
<ig:XamWebOutlookBar.GroupContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding ItemName}" />
</DataTemplate>
</ig:XamWebOutlookBar.GroupContentTemplate>
<ig:XamWebOutlookBar.GroupHeaderTemplate>
</ig:XamWebOutlookBar.GroupHeaderTemplate>
</ig:XamWebOutlookBar>
</Grid>
HTH,
How would you do a groupcontenttemplate in outlookbar 2010.2? There is no such property.
Hello Andre,
I belive that this question is already discussed here:
https://ko.infragistics.com/community/forums/f/retired-products-and-controls/81189/how-do-you-set-groupcontenttemplate-for-xamoutlookbar-2010-2---there-is-no-such-property