Hello. When I want to close RadPain and click 'Close' button ('X') in right upper corner of the RadPain then this RadPain is not closed. Below is XAML where RadPain is:
<
UserControl
x:Class
=
"DeviceReading.Views.DeviceReadingView"
xmlns:prism
=
"http://prismlibrary.com/"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
prism:ViewModelLocator.AutoWireViewModel
=
"True"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
/>
</
Grid.ColumnDefinitions
>
<
StackPanel
Grid.Row
=
"0"
Grid.Column
=
"0"
HorizontalAlignment
=
"Stretch"
Margin
=
"0 5 0 3"
Orientation
=
"Horizontal"
>
<
CheckBox
Content
=
"Gas velocity"
Command
=
"{Binding Path=ShowHideGasVelocityChartViewCommand}"
CommandParameter
=
"{Binding Path=IsChecked, RelativeSource={RelativeSource Self}}"
/>
</
StackPanel
>
<
telerik:RadDocking
Grid.Row
=
"1"
Grid.Column
=
"0"
x:Name
=
"Docking"
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Gas Velocity"
prism:RegionManager.RegionName
=
"GasVelocityChartRegion"
IsHidden
=
"{Binding IsGasVelocityChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking
>
</
Grid
>
</
UserControl
>
Below is the definition of ShowHideGasVelocityChartViewCommand command that is bound to Command property of CheckBox:
public
DelegateCommand<
object
> ShowHideGasVelocityChartViewCommand {
get
;
private
set
; }
private
void
showHideGasVelocityChartView(
object
parameter)
{
if
((
bool
)parameter ==
true
)
this
.IsGasVelocityChartHidden =
true
;
else
this
.IsGasVelocityChartHidden =
false
;
}
Below is the definition of IsGasVelocityChartHiden property that is bound to IsHidden property of the RadPain.
public
bool
IsGasVelocityChartHidden
{
get
{
return
this
._isGasVelocityChartHidden; }
set
{
this
.SetProperty(
ref
this
._isGasVelocityChartHidden, !value); }
}
During application runtime, this RadPain contains View with the dynamically changed chart of gas velocity. This RadPain is shown and hidden by the click on the CheckBox (when the CheckBox is checked then the RadPain is visible, but when the CheckBox is unchecked then the RadPain is invisible - hidden). But I want that this RadPain can ALSO be hidden by clicking of its 'Close' ('X') button that is in the right upper corner of this RadPain. And when the RadPain is closed by clicking its 'Close' ('X') button then the CheckBox must set to Unchecked status so that after I can click on CheckBox, set it to 'Checked' status and visualize the RadPain again. Please help me if this is possible to do it.