'ContentControl Cannot Render GUI
I have a Windows with template
<Style x:Key="LVWindow" TargetType="{x:Type control:LVWindow}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type control:LVWindow}">
<Border x:Name="BorderWindow" BorderThickness=".7" BorderBrush="#464543">
<Border.Effect>
<DropShadowEffect BlurRadius="15" Direction="-90" Color="White" RenderingBias="Quality" ShadowDepth="2"/>
</Border.Effect>
<Grid Background="{DynamicResource BackgroundColor}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" HorizontalAlignment="Right" Orientation="Horizontal" Margin="8">
<ContentControl x:Name="extentTemplate" ContentTemplate="{TemplateBinding TitleTemplate}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</StackPanel>
<Border Grid.Row="1">
<ContentPresenter Content="{TemplateBinding Content}"/>
</Border>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
And i use this for MainWindow, my Windows has two sections, left menu and Workspace, i use ContentControl for render Workspace.
<Border Grid.Column="1" Background="{DynamicResource ForegroundColor}" CornerRadius="5 0 0 0" >
<ContentControl Content="{Binding CurrentView,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Border>
In MainviewModel
private object _currentView;
public object CurrentView
{
get { return _currentView; }
set { _currentView = value; OnPropertyChanged(); }
}
I have problem when hide MainWindow to Taskbar one hour and reshow it, after Windows show section Workspace not reponse any manipulation from user, but Window can resize and Workspace fire event when click any button on view but GUI not render, anyone same problem?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
