Hi,
This is not 100% RadTileView/Item specific stuff but still would probably require different kind of implementation for RadTileViewItem templates...
I'm currently using headerTemplate like below as my RadTileView's ItemTemplate:
I have a problem localizing this TileHeader because TileCaption is a string property in each Tile's ViewModel and it gets a value like "Amount: 0" or "Not set" depending on the situation. So the localized part of the property should be "Amount: " or "Not set" or nothing in some cases.
I'm using 3rd party localization addon called WPF Localization extension and localization is done with binding like Text="lex:Loc SomeKey" so basically what I'm asking is how could I make Tile specific ItemTemplate so that I can use data binding to desired localized key or what would be the best way to accomplish binding to TileViewItem so that it will get the change notification and updates accordingly?
My current implementation lacks the functionality to refresh the title when RaisePropertyChanged is triggered (when language is changed) because I don't have data binding to TileCaption (I'm setting the value of TileCaption property in code).
So if I could somehow make tile specific ItemTemplate for each tile I could make binding in XAML. Of course this has other problem because I need to have 2 different localizations depending on the situation but at least the change notification would work.
Or should I create databindings in code-behind...
Br,
Kalle
This is not 100% RadTileView/Item specific stuff but still would probably require different kind of implementation for RadTileViewItem templates...
I'm currently using headerTemplate like below as my RadTileView's ItemTemplate:
<
DataTemplate
x:Key
=
"headerTemplate"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
telerik:RadButton
Width
=
"14"
Height
=
"14"
Margin
=
"0 0 0 0"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
Content
=
"X"
FontSize
=
"10"
Foreground
=
"Black"
Background
=
"White"
Command
=
"{Binding Path=DataContext.RemoveTileCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
CommandParameter
=
"{Binding RelativeSource={RelativeSource AncestorType=telerik:RadTileViewItem}}"
Padding
=
"0"
/>
<
TextBlock
x:Name
=
"TileHeader"
FontSize
=
"10"
Text
=
"{Binding Path=DataContext.DataContext.TileCaption, RelativeSource={RelativeSource AncestorType=telerik:RadTileViewItem}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
HorizontalAlignment
=
"Left"
/>
</
StackPanel
>
</
DataTemplate
>
I have a problem localizing this TileHeader because TileCaption is a string property in each Tile's ViewModel and it gets a value like "Amount: 0" or "Not set" depending on the situation. So the localized part of the property should be "Amount: " or "Not set" or nothing in some cases.
I'm using 3rd party localization addon called WPF Localization extension and localization is done with binding like Text="lex:Loc SomeKey" so basically what I'm asking is how could I make Tile specific ItemTemplate so that I can use data binding to desired localized key or what would be the best way to accomplish binding to TileViewItem so that it will get the change notification and updates accordingly?
My current implementation lacks the functionality to refresh the title when RaisePropertyChanged is triggered (when language is changed) because I don't have data binding to TileCaption (I'm setting the value of TileCaption property in code).
So if I could somehow make tile specific ItemTemplate for each tile I could make binding in XAML. Of course this has other problem because I need to have 2 different localizations depending on the situation but at least the change notification would work.
Or should I create databindings in code-behind...
Br,
Kalle