Hello,
I'm developing an installation wizard, and i have a resource for radbuttons.
Everything seems ok upon creation, but when i put the mouse over the button or i press it i get the following error:
System.Windows.Data Error: 40 : BindingExpression path error: '(MaterialControls:MaterialAssist.MouseOverBrush)' property not found on 'object' ''RadButton' (Name='LoginButton')'. BindingExpression:Path=(MaterialControls:MaterialAssist.MouseOverBrush); DataItem='RadButton' (Name='LoginButton'); target element is 'Border' (Name='BorderVisual'); target property is 'Background' (type 'Brush')
I have no idea what is wrong.
Code for button in wizard:
<telerik:RadButton x:Name="LoginButton" Margin="0 180 0 35" HorizontalAlignment="Center" Content="Submit" Height="40" Width="105" VerticalAlignment="Bottom" Click="LoginButton_Click" MouseEnter="LoginButton_MouseEnter" MouseLeave="LoginButton_MouseLeave" Style="{DynamicResource TestButton}" CommandParameter="{Binding}"/>
code
<Style x:Key="TestButton" TargetType="{x:Type telerik:RadButton}"> <Setter Property="MinWidth" Value="70"/> <Setter Property="Margin" Value="0,0,5,0"/> <Setter Property="HorizontalAlignment" Value="Left"/> <Setter Property="VerticalAlignment" Value="Center"/> <Style.BasedOn> <Style TargetType="{x:Type telerik:RadButton}"> <Setter Property="MaterialControls:MaterialAssist.MouseOverBrush" Value="{telerik:FluentResource ResourceKey={x:Static telerik:FluentResourceKey.MouseOverBrush}}"/> <Setter Property="MaterialControls:MaterialAssist.PressedBrush" Value="{telerik:FluentResource ResourceKey={x:Static telerik:FluentResourceKey.PressedBrush}}"/> <Setter Property="MaterialControls:MaterialAssist.FocusBrush" Value="{telerik:FluentResource ResourceKey={x:Static telerik:FluentResourceKey.AccentFocusedBrush}}"/> <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey={x:Static telerik:FluentResourceKey.FontFamily}}"/> <Setter Property="FontSize" Value="{telerik:FluentResource ResourceKey={x:Static telerik:FluentResourceKey.FontSize}}"/> <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey={x:Static telerik:FluentResourceKey.MarkerBrush}}"/> <Setter Property="Background" Value="{telerik:FluentResource ResourceKey={x:Static telerik:FluentResourceKey.MainBrush}}"/> <Setter Property="BorderBrush" Value="{telerik:FluentResource ResourceKey={x:Static telerik:FluentResourceKey.MainBrush}}"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="Padding" Value="5"/> <Setter Property="CornerRadius" Value="{telerik:FluentResource ResourceKey={x:Static telerik:FluentResourceKey.CornerRadius}}"/> <Setter Property="SnapsToDevicePixels" Value="True"/> <Setter Property="UseLayoutRounding" Value="True"/> <Setter Property="FocusVisualStyle" Value="{x:Null}"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type telerik:RadButton}"> <Grid> <Border x:Name="BorderVisual" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding CornerRadius}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> <Border x:Name="FocusVisual" BorderBrush="{TemplateBinding MaterialControls:MaterialAssist.FocusBrush}" BorderThickness="{DynamicResource {x:Static telerik:FluentResourceKey.FocusThickness}}" CornerRadius="{TemplateBinding CornerRadius}" IsHitTestVisible="False" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Visibility="Collapsed"/> <MaterialControls:FluentControl BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" HorizontalContentAlignment="Stretch" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalContentAlignment="Stretch"> <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" TextElement.Foreground="{TemplateBinding Foreground}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </MaterialControls:FluentControl> </Grid> <ControlTemplate.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsBackgroundVisible" Value="False"/> <Condition Property="IsEnabled" Value="True"/> <Condition Property="IsMouseOver" Value="False"/> </MultiTrigger.Conditions> <Setter Property="Background" Value="Transparent"/> <Setter Property="BorderBrush" Value="Transparent"/> </MultiTrigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsEnabled" Value="True"/> <Condition Property="IsFocused" Value="True"/> <Condition Property="IsPressed" Value="False"/> <Condition Property="IsMouseOver" Value="False"/> </MultiTrigger.Conditions> <Setter Property="Visibility" TargetName="FocusVisual" Value="Visible"/> </MultiTrigger> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" TargetName="BorderVisual" Value="{Binding (MaterialControls:MaterialAssist.MouseOverBrush), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/> <Setter Property="BorderBrush" TargetName="BorderVisual" Value="{Binding (MaterialControls:MaterialAssist.MouseOverBrush), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/> </Trigger> <Trigger Property="IsPressed" Value="True"> <Setter Property="Background" TargetName="BorderVisual" Value="{Binding (MaterialControls:MaterialAssist.PressedBrush), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/> <Setter Property="BorderBrush" TargetName="BorderVisual" Value="{Binding (MaterialControls:MaterialAssist.PressedBrush), Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Opacity" TargetName="Content" Value="{telerik:FluentResource ResourceKey={x:Static telerik:FluentResourceKey.DisabledOpacity}}"/> <Setter Property="Background" Value="{telerik:FluentResource ResourceKey={x:Static telerik:FluentResourceKey.AlternativeBrush}}"/> <Setter Property="BorderBrush" Value="{telerik:FluentResource ResourceKey={x:Static telerik:FluentResourceKey.AlternativeBrush}}"/> </Trigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsEnabled" Value="False"/> <Condition Property="IsFocused" Value="True"/> </MultiTrigger.Conditions> <Setter Property="Visibility" TargetName="FocusVisual" Value="Collapsed"/> </MultiTrigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsEnabled" Value="False"/> <Condition Property="IsBackgroundVisible" Value="False"/> </MultiTrigger.Conditions> <Setter Property="Background" Value="Transparent"/> <Setter Property="BorderBrush" Value="Transparent"/> </MultiTrigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </Style.BasedOn> </Style>Can someone please help me?
Regards
