This question is locked. New answers and comments are not allowed.
Hi,
I found in forum how to change background color for TileViewItem header but I don't know in what moment I should do that when ItemsSource for TileView is creating dynamicly in ViewModel and one TileViewItem have DataContext as TileViewItemViewModel.
For understand basic of my thinking -> my code is like in your documentation -> http://www.telerik.com/help/silverlight/radtileview-howto-use-fluidcontentcontrol-in-tileview.html
But in my case class MyViewModel have another one property (of course with implemented call OnPropertyChanged) called IsAlert.
In my scenario I want to change TileViewItem's background color header to red if that property is equal to True.
For know I checked if my styles for TileViewItem works using LayoutUpdated event (bad performance = wrong approach) and everything works fine.
Have can I do that?
Best regards,
Lukas
I found in forum how to change background color for TileViewItem header but I don't know in what moment I should do that when ItemsSource for TileView is creating dynamicly in ViewModel and one TileViewItem have DataContext as TileViewItemViewModel.
For understand basic of my thinking -> my code is like in your documentation -> http://www.telerik.com/help/silverlight/radtileview-howto-use-fluidcontentcontrol-in-tileview.html
But in my case class MyViewModel have another one property (of course with implemented call OnPropertyChanged) called IsAlert.
In my scenario I want to change TileViewItem's background color header to red if that property is equal to True.
For know I checked if my styles for TileViewItem works using LayoutUpdated event (bad performance = wrong approach) and everything works fine.
var redControlTemplate = App.Current.Resources[
"RedTileViewItemTemplate"
]
as
Style;
var greenControlTemplate = App.Current.Resources[
"GreenTileViewItemTemplate"
]
as
Style;
foreach
(MyViewModel item
in
tileView.Items)
{
var tileViewItem = tileView.ItemContainerGenerator.ContainerFromItem(item)
as
RadTileViewItem;
if
(tileViewItem !=
null
)
{
if
(item.IsAlert)
{
tileViewItem.Style = redControlTemplate;
}
else
{
tileViewItem.Style = greenControlTemplate;
}
}
}
Have can I do that?
Best regards,
Lukas