Seems it does not work for me:
<
UserControl.Resources
>
<
DataTemplate
DataType
=
"vm:MenuItemViewModel"
x:Key
=
"ToolBarItemTemplate"
>
<
c:TemplateSelector
TemplateKey
=
"{Binding MenuItemType}"
Content
=
"{Binding}"
>
<
c:TemplateItem
x:Key
=
"{t:Static Member=vm:MenuItemType.Button}"
>
<
t:RadButton
IsEnabled
=
"{Binding IsEnabled}"
Content
=
"{Binding Text}"
Command
=
"{Binding Command}"
ToolTipService.ToolTip
=
"{Binding ToolTip}"
t:RadToolBar.OverflowMode
=
"{Binding OverflowMode}"
/>
</
c:TemplateItem
>
<
c:TemplateItem
x:Key
=
"{t:Static Member=vm:MenuItemType.Checkbox}"
>
<
t:RadToggleButton
IsEnabled
=
"{Binding IsEnabled}"
Content
=
"{Binding Text}"
Command
=
"{Binding Command}"
CommandParameter
=
"{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}"
ToolTipService.ToolTip
=
"{Binding ToolTip}"
t:RadToolBar.OverflowMode
=
"{Binding OverflowMode}"
/>
</
c:TemplateItem
>
</
c:TemplateSelector
>
</
DataTemplate
>
</
UserControl.Resources
>
<
t:RadToolBarTray
e:RadToolBarTrayExtensions.ItemsSource
=
"{Binding Items}"
VerticalAlignment
=
"Center"
>
<
t:RadToolBarTray.ItemTemplate
>
<
DataTemplate
DataType
=
"vm:MenuViewModel"
>
<
t:RadToolBar
ItemsSource
=
"{Binding Items}"
ItemTemplate
=
"{StaticResource ToolBarItemTemplate}"
/>
</
DataTemplate
>
</
t:RadToolBarTray.ItemTemplate
>
</
t:RadToolBarTray
>
This t:RadToolBar.OverflowMode="{Binding OverflowMode}" is ignored. Even if I set it directly to "Never" or "Always"...
I have an RadToolbar control on my Page. The problem is the Images I have placed on my buttons don't show. My code seems fine. Whats the issue?
<telerik:RadToolBar Grid.Row="1"
Margin="20,20,5,10">
<Button Width="25"
Click="OnInsertClick">
<Image Source="Images/add.png"/>
</Button>
<Button Width="25">
<Image Source="Images/delete.png"/>
</Button>
</telerik:RadToolBar>
I also tried addressing like /Images/add.png but to no avail
<
telerik:RadToolBar
x:Name
=
"quickKeyBar"
Grid.Row
=
"0"
telerik:StyleManager.Theme
=
"Metro"
ItemsSource
=
"{Binding Path=UserQuickKeys}"
HorizontalAlignment
=
"Stretch"
Margin
=
"-1 -2 -1 0"
>
<
telerik:RadToolBar.ItemTemplate
>
<
DataTemplate
>
<
Grid
>
<
telerik:RadButton
Margin
=
"3,0,3,0"
Content
=
"{Binding Path=QuickKeyName}"
Command
=
"{Binding Path=EnterQuickKeyCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
CommandParameter
=
"{Binding}"
IsEnabled
=
"{Binding Path=IsUserQuickKeyUsable}"
telerik:StyleManager.Theme
=
"Metro"
/>
</
Grid
>
</
DataTemplate
>
</
telerik:RadToolBar.ItemTemplate
>
<LinearGradientBrush x:Key="ControlBackground_MouseOver" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#FFBDE4F9" Offset="0" />
<GradientStop Color="#FFB4E0F7" Offset="0.5" />
<GradientStop Color="#FF98D1EF" Offset="0.5" />
<GradientStop Color="#FF81C3E5" Offset="1" />
</LinearGradientBrush>
in
-------
<vsm:VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="RenderMouseOver">
<DiscreteObjectKeyFrame KeyTime="0:0:0">
<DiscreteObjectKeyFrame.Value>
<sys:Boolean>True</sys:Boolean>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBackground_MouseOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBackground_MouseOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconForeground_MouseOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconBackground_MouseOver}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</vsm:VisualState>
<vsm:VisualState x:Name="DropDownOpen">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconForeground_Pressed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconBackground_Pressed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBackground_MouseOver}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</vsm:VisualState>
-----
but unsuccessfully :(<
telerik:RadToolBar
x:Name
=
"radTB"
Height
=
"40"
>
<
telerik:RadButton
HorizontalContentAlignment
=
"Center"
Background
=
"Transparent"
BorderThickness
=
"0"
Width
=
"40"
>
<
StackPanel
>
<
Image
Width
=
"16"
Height
=
"16"
Source
=
"/BusinessApplication1;component/Image16.png"
/>
<
TextBlock
Text
=
"Click"
></
TextBlock
>
</
StackPanel
>
</
telerik:RadButton
>
</
telerik:RadToolBar
>