This question is locked. New answers and comments are not allowed.
Hi guys,
I'm using the RadDocking control to show some charts and grids.
Today, the user can set the RadPanel as Float and save it.
I have a property on my ViewModel that says if User can make changes on these panels. Let's call it "IsAllowChanges".
What I want is, when IsAllowChanges is false, set the Header, Background and borders of "Float" RadPane to "Transparent". And come back to original Header, Background and borders when IsAllowChanges is true.
As the RadDocking don't allow me to set the ToolWindow's Style directly, I did a general style.
The problem is, how would I change the styles propertys (or the entire style of the ToolWindow ) when the IsAllowChanges changes?
I don't know if I made myself clear, so see on attachments an example...
I'm using the RadDocking control to show some charts and grids.
Today, the user can set the RadPanel as Float and save it.
I have a property on my ViewModel that says if User can make changes on these panels. Let's call it "IsAllowChanges".
What I want is, when IsAllowChanges is false, set the Header, Background and borders of "Float" RadPane to "Transparent". And come back to original Header, Background and borders when IsAllowChanges is true.
As the RadDocking don't allow me to set the ToolWindow's Style directly, I did a general style.
<SolidColorBrush x:Key="ToolWindow_Background" Color="Transparent"/> <SolidColorBrush x:Key="ToolWindow_OuterBorderBrush" Color="Transparent"/> <telerik:Office_BlackTheme x:Key="Theme"/> <SolidColorBrush x:Key="ToolWindow_InnerBorderBrush" Color="Transparent"/> <Style TargetType="telerik:RadSplitContainer"> <Setter Property="InitialPosition" Value="DockedLeft"/> <Setter Property="Background" Value="{StaticResource ToolWindow_Background}"/> </Style> <Style TargetType="telerik:RadPaneGroup"> <Setter Property="Background" Value="{StaticResource ToolWindow_Background}"/> </Style> <DataTemplate x:Key="toolWindowTemplate"> </DataTemplate> <Style TargetType="telerik:ToolWindow"> <Setter Property="IsTabStop" Value="False"/> <Setter Property="Background" Value="{StaticResource ToolWindow_Background}"/> <Setter Property="BorderBrush" Value="{StaticResource ToolWindow_OuterBorderBrush}"/> <Setter Property="BorderThickness" Value="0"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="telerik:ToolWindow"> <Grid x:Name="VisualRoot" Background="Transparent"> <Border Background="Transparent"> <!--<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" CornerRadius="4"> <Border BorderBrush="{StaticResource ToolWindow_InnerBorderBrush}" BorderThickness="1" CornerRadius="3">--> <Grid Background="Transparent"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <!--<Border x:Name="HeaderElement" Background="Transparent" Grid.Column="0" Padding="3 1" Grid.Row="0"> <telerik:CommandManager.InputBindings> <telerik:InputBindingCollection> <telerik:MouseBinding Command="telerikDocking:RadDockingCommands.PaneHeaderMenuOpen"> <telerik:MouseBinding.Gesture> <telerik:MouseGesture MouseAction="RightClick"/> </telerik:MouseBinding.Gesture> </telerik:MouseBinding> </telerik:InputBindingCollection> </telerik:CommandManager.InputBindings> <ContentPresenter x:Name="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}"/> </Border> <telerik:RadButton x:Name="CloseButton" Grid.Column="1" Command="telerik:WindowCommands.Close" Margin="1 1 3 1" Grid.Row="0" Style="{StaticResource ToolWindow_CloseButtonStyle}"/>--> <ContentPresenter x:Name="Content" Grid.ColumnSpan="2" Content="{TemplateBinding Content}" Margin="3 0 3 3" Grid.Row="1"/> </Grid> </Border> <!--</Border> </Border>--> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> The problem is, how would I change the styles propertys (or the entire style of the ToolWindow ) when the IsAllowChanges changes?
I don't know if I made myself clear, so see on attachments an example...