This question is locked. New answers and comments are not allowed.
Hi telerik,
I placed a usercontrol in contentpresenter of RadTileView as you advised in this thread
instead of Prism region. Follwing is snippet of xaml in layoutview which has tileview control.
When opened view first time in documenthost of RadDock, everything is fine as attached first image.
However,after open another view over tileview and then return to tileview by tab click,
contents are gone as attached second image.
The code to create usercontrol in viewmodel is as follows which borrowed in your various sample.
However, in case dataTemplate has all controls declared in same xaml, it runs fine without disappearing.
I've tried to debug if the view or Itemsource of tileview control changes when tilew view has focus again,
but can't configure and find it. Currently IsVirtualization is set ON, but it was same when changed to OFF.
What am I missing something ? Pls advise me.
Thank you in advance.
Kang
I placed a usercontrol in contentpresenter of RadTileView as you advised in this thread
instead of Prism region. Follwing is snippet of xaml in layoutview which has tileview control.
/// resource
<
DataTemplate
x:Key
=
"LineContentTemplate"
>
<
ContentPresenter
Content
=
"{Binding View, Mode=OneWay}"
/>
</
DataTemplate
>
/// tileview
<
Grid
x:Name
=
"LayoutRoot"
DataContext
=
"{Binding Source={StaticResource popLineCurrentViewModelViewSource}}"
>
<
telerik:HeaderedContentControl
Style
=
"{StaticResource SchFormBaseStyle}"
>
<
telerik:RadTileView
x:Name
=
"lineTagView"
ItemsSource
=
"{Binding ChildVM}"
ContentTemplate
=
"{StaticResource LineContentTemplate}"
Style
=
"{StaticResource tileViewStyle}"
MinimizedColumnWidth
=
"300"
MinimizedRowHeight
=
"270"
>
When opened view first time in documenthost of RadDock, everything is fine as attached first image.
However,after open another view over tileview and then return to tileview by tab click,
contents are gone as attached second image.
The code to create usercontrol in viewmodel is as follows which borrowed in your various sample.
private FrameworkElement _view;
public FrameworkElement View
{
get
{
SetView();
DetachFromVisualParent(_view);
return _view;
}
}
protected void DetachFromVisualParent(FrameworkElement visual)
{
var parent = System.Windows.Media.VisualTreeHelper.GetParent(visual) as ContentPresenter;
if (parent != null)
{
parent.Content = null;
}
}
However, in case dataTemplate has all controls declared in same xaml, it runs fine without disappearing.
I've tried to debug if the view or Itemsource of tileview control changes when tilew view has focus again,
but can't configure and find it. Currently IsVirtualization is set ON, but it was same when changed to OFF.
What am I missing something ? Pls advise me.
Thank you in advance.
Kang