Hi,
How can I change the assets and styles of the Syntax Editor during run-time?
I don't want to have the blue border any more, when MouseIsOver, another Background and BorderBrush, and some Control.Template Triggers,etc.
In our application the SyntaxEditor is wrapped in a custom control, which is integrated in the application, only using the wrapper-dll.
Now the styles of the application should be attached to the wrapped Syntaxeditor-Control as well.
I tried to implement the sample from ThemesSamples/ThemeOverride, but the SyntaxEditor look and feel doesn't change not at all.
This is the codesnippet from the xaml, I want to use as resource:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:themes="http://schemas.actiprosoftware.com/winfx/xaml/themes"
xmlns:editor="clr-namespace:Gradient.WPF.Actipro.Controls.SyntaxEditor"
>
<Style x:Key="{x:Type editor:BaseSyntaxEditor}" TargetType="{x:Type editor:BaseSyntaxEditor}">
<Setter Property="Background" Value="#FFFF7F50"/>
<Setter Property="BorderBrush" Value="{DynamicResource grau50}"/>
<Setter Property="BorderThickness" Value="0.6" />
<Setter Property="Margin" Value="4"/>
<Setter Property="Padding" Value="1,2"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type editor:BaseSyntaxEditor}">
<Grid>
<Border x:Name="hg" CornerRadius="0,3,3,3" Background="{StaticResource weiss}"/>
<Border x:Name="Border" CornerRadius="0,3,3,3" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="{StaticResource grau10}"/>
<Setter Property="BorderBrush" Value="{DynamicResource grau80}"/>
</Trigger>
<Trigger Property="IsFocused" Value="true">
<Setter Property="Background" Value="{StaticResource aktiv50}"/>
<Setter Property="BorderBrush" Value="{DynamicResource aktiv}"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="BorderBrush" Value="{DynamicResource aktiv}"/>
<Setter Property="Background" Value="{DynamicResource aktiv50}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
How can I bind this resource not static but dependent perhaps on a property to syntax editor, when it is loaded or during run-time?
Thanks!