This is a migrated thread and some comments may be shown as answers.

How to get "Icon" to support FrameworkElements?

1 Answer 28 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 04 Feb 2010, 07:17 PM
Is there any way to change the "Icon" property of the RadOutlookBarItem to a generic ContentPresenter instead of an Image?

In my application, we have spent considerable effort "drawing" our icons in xaml so that they can be resized easily and to use them here would require us to convert them to an image which would be a waste...

1 Answer, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 05 Feb 2010, 03:56 PM
Hi Rob,

Unfortunately you cannot change the type of the Icon property. Instead you will have to add an additional property to your business object that will store the xaml icon. Then you can specify a DataTemplate and put a ContentPresenter that will be bound to the property holding the icon.

public class MyBussinessObject
{
    public object XamlIcon { get; set; }
    public object Header { get; set; }
}

<DataTemplate x:Key="MyItemTemplate">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <ContentPresenter Content="{Binding XamlIcon}" />
        <ContentPresenter Content="{Binding Header}" Grid.Column="1" />
    </Grid>
</DataTemplate>
 
<telerikNavigation:RadOutlookBar x:Name="outlookBar1" ItemTemplate="{StaticResource MyItemTemplate}" />

Let me know if this is a possible solution to your scenario. If you have additional questions or comments, I'd be glad to further assist you.

Kind regards,
Kiril Stanoev
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
OutlookBar
Asked by
Rob
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Share this question
or