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

size of icon in MenuItem

1 Answer 91 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 23 Sep 2011, 03:15 PM
Hi,

I have a databound RadContextMenu (as a DropDownContent of a RadRibbonSplittButton).
The size of the icons I am binding to is 16 x 16, But they appear larger. So I asume, I have to style the Icon in the RadMenuItem and set the Stretch property to "None". But I have no idea how...

Please have a look at the sceenshot and the code snippets.

Thanks for any help!
Thomas
    <telerik:HierarchicalDataTemplate ItemsSource="{Binding SubItems}"
                                      x:Name="MenuItemTemplate">
        <telerik:ContainerBinding.ContainerBindings>
            <telerik:ContainerBindingCollection>
                <telerik:ContainerBinding PropertyName="Icon"
                                          Binding="{Binding SmallImage, Converter={StaticResource ImageConverter}, ConverterParameter=IgnoreTargetType}" />
                <telerik:ContainerBinding PropertyName="Command"
                                          Binding="{Binding Command}" />
                <telerik:ContainerBinding PropertyName="CommandParameter"
                                          Binding="{Binding CommandParameter, Mode=TwoWay}" />
            </telerik:ContainerBindingCollection>
        </telerik:ContainerBinding.ContainerBindings>
            <TextBlock Text="{Binding Text}" />
    </telerik:HierarchicalDataTemplate>


    <DataTemplate x:Name="DropDownButtonWithContextMenuTemplate">         <telerik:RadRibbonDropDownButton Text="{Binding Text}"                                          Size="{Binding Size}"                                          CollapseToSmall="WhenGroupIsSmall"                                          CollapseToMedium="WhenGroupIsMedium"                                          LargeImage="{Binding LargeImage}"                                          SmallImage="{Binding SmallImage}"                                          Command="{Binding Command}"                                          CommandParameter="{Binding CommandParameter}">             <telerik:RadRibbonDropDownButton.DropDownContent>                 <telerik:RadContextMenu ItemsSource="{Binding Buttons}"                                         ItemTemplate="{StaticResource MenuItemTemplate}">                 </telerik:RadContextMenu>             </telerik:RadRibbonDropDownButton.DropDownContent>         </telerik:RadRibbonDropDownButton>     </DataTemplate>


1 Answer, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 28 Sep 2011, 11:43 AM
Hello Thomas,

I am pretty sure the ImageConverter build Image-es from URIs. Perhaps you could check the code of that converter and if it really creates an Image instances put the Stretch=None there.

Regards,
Pana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Menu
Asked by
Thomas
Top achievements
Rank 1
Answers by
Pana
Telerik team
Share this question
or