This question is locked. New answers and comments are not allowed.
Hi
I have added ItemMinimizedTemplate along with ItemTemplate and Title Template.
| <telerikNavigation:RadOutlookBar.ItemMinimizedTemplate> |
| <DataTemplate> |
| <Grid> |
| <TextBlock Text="{Binding Label}" FontWeight="Bold" FontSize="24"/> |
| </Grid> |
| </DataTemplate> |
| </telerikNavigation:RadOutlookBar.ItemMinimizedTemplate> |
But whenever, i have tried to minimize the outlookbar control, it shows an error
InnerException = {System.NotSupportedException: ItemsControl.Items must not be a UIElement type when an ItemTemplate is set.
at System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.GetContainerForItem(Object item)
at System.Windows.Controls.ItemC...
Please find the source code for your refrence and let me know a solution to resolve this issue.
Xaml
| <UserControl x:Class="SilverlightApplication1.MainPage" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:local="clr-namespace:SilverlightApplication1" |
| xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"> |
| <UserControl.Resources> |
| <local:MyItemsSource x:Key="myItemsSource" /> |
| </UserControl.Resources> |
| <Grid x:Name="LayoutRoot" Height="300" Width="400"> |
| <telerikNavigation:RadOutlookBar x:Name="outlookbar" |
| ItemsSource="{StaticResource myItemsSource}"> |
| <telerikNavigation:RadOutlookBar.ItemTemplate> |
| <DataTemplate> |
| <Grid> |
| <TextBlock Text="{Binding Label}" Cursor="Hand" /> |
| </Grid> |
| </DataTemplate> |
| </telerikNavigation:RadOutlookBar.ItemTemplate> |
| <telerikNavigation:RadOutlookBar.TitleTemplate> |
| <DataTemplate> |
| <Grid> |
| <TextBlock Text="{Binding Label}" FontWeight="Bold" FontSize="24"/> |
| </Grid> |
| </DataTemplate> |
| </telerikNavigation:RadOutlookBar.TitleTemplate> |
| <telerikNavigation:RadOutlookBar.ItemMinimizedTemplate> |
| <DataTemplate> |
| <Grid> |
| <TextBlock Text="{Binding Label}" FontWeight="Bold" FontSize="24"/> |
| </Grid> |
| </DataTemplate> |
| </telerikNavigation:RadOutlookBar.ItemMinimizedTemplate> |
| </telerikNavigation:RadOutlookBar> |
| </Grid> |
| </UserControl> |
C#
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Net; |
| using System.Windows; |
| using System.Windows.Controls; |
| using System.Windows.Documents; |
| using System.Windows.Input; |
| using System.Windows.Media; |
| using System.Windows.Media.Animation; |
| using System.Windows.Shapes; |
| using Telerik.Windows.Controls; |
| using System.Collections.ObjectModel; |
| namespace SilverlightApplication1 |
| { |
| public partial class MainPage : UserControl |
| { |
| public MainPage() |
| { |
| InitializeComponent(); |
| } |
| } |
| public class MyItemsSource : ObservableCollection<MyItem> |
| { |
| public MyItemsSource() |
| { |
| this.Add(new MyItem() { Label = "Item 1" }); |
| this.Add(new MyItem() { Label = "Item 2" }); |
| this.Add(new MyItem() { Label = "Item 3" }); |
| this.Add(new MyItem() { Label = "Item 4" }); |
| } |
| } |
| public class MyItem |
| { |
| public string Label { get; set; } |
| } |
| } |
Regards
SUNU
