Skip to content

Commit 5eea899

Browse files
committed
tweaking some of the feedback brushes
1 parent 0e24e33 commit 5eea899

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

MaterialDesignThemes.Wpf/Themes/Generic.xaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@
2828
<Setter Property="HorizontalAlignment" Value="Stretch" />
2929
<Setter Property="VerticalAlignment" Value="Stretch" />
3030
<Setter Property="Background" Value="Transparent" />
31+
<Setter Property="Feedback" Value="{Binding RelativeSource={RelativeSource Self}, Path=Foreground}" />
3132
<Setter Property="Template">
3233
<Setter.Value>
3334
<ControlTemplate TargetType="{x:Type local:VisualFeedbackContentControl}">
3435
<Grid ClipToBounds="True" Background="Transparent">
3536
<Canvas IsHitTestVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
3637
<Ellipse Opacity="0" Width="60" Height="60" Canvas.Left="{TemplateBinding MouseX}" Canvas.Top="{TemplateBinding MouseY}"
37-
x:Name="HoverEllipse" Fill="{TemplateBinding Foreground, Converter={StaticResource BrushToRadialGradientBrushConverter}}">
38+
x:Name="HoverEllipse" Fill="{TemplateBinding Feedback, Converter={StaticResource BrushToRadialGradientBrushConverter}}">
3839
<Ellipse.RenderTransform>
3940
<TransformGroup>
4041
<ScaleTransform/>
@@ -44,7 +45,7 @@
4445
</TransformGroup>
4546
</Ellipse.RenderTransform>
4647
</Ellipse>
47-
<Ellipse x:Name="ClickEllipse" Fill="{TemplateBinding Foreground}" Opacity="0" Width="0" Height="0" Canvas.Left="{TemplateBinding MouseLeftButtonDownX}" Canvas.Top="{TemplateBinding MouseLeftButtonDownY}"
48+
<Ellipse x:Name="ClickEllipse" Fill="{TemplateBinding Feedback}" Opacity="0" Width="0" Height="0" Canvas.Left="{TemplateBinding MouseLeftButtonDownX}" Canvas.Top="{TemplateBinding MouseLeftButtonDownY}"
4849
RenderTransformOrigin=".5,.5">
4950
<Ellipse.RenderTransform>
5051
<TransformGroup>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Button.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<Border Background="{TemplateBinding Background}" Effect="{StaticResource MaterialDesignShadowDepth1}" />
3838
<Border Background="{TemplateBinding Background}" x:Name="border" CornerRadius="2">
3939
<wpf:VisualFeedbackContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Focusable="False"
40+
Feedback="White"
4041
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
4142
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
4243
Padding="{TemplateBinding Padding}"
@@ -94,6 +95,7 @@
9495
<Grid>
9596
<Border Background="{TemplateBinding Background}" x:Name="border" CornerRadius="2">
9697
<wpf:VisualFeedbackContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Focusable="False"
98+
Feedback="{DynamicResource MaterialDesignDivider}"
9799
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
98100
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
99101
Padding="{TemplateBinding Padding}"

MaterialDesignThemes.Wpf/VisualFeedbackContentControl.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ private void OnMouseMove(object sender, MouseEventArgs mouseEventArgs)
4343
MouseY = position.Y;
4444
}
4545

46+
public static readonly DependencyProperty FeedbackProperty = DependencyProperty.Register(
47+
"Feedback", typeof (Brush), typeof (VisualFeedbackContentControl), new PropertyMetadata(default(Brush)));
48+
49+
public Brush Feedback
50+
{
51+
get { return (Brush) GetValue(FeedbackProperty); }
52+
set { SetValue(FeedbackProperty, value); }
53+
}
54+
4655
private static readonly DependencyPropertyKey MouseXPropertyKey =
4756
DependencyProperty.RegisterReadOnly(
4857
"MouseX", typeof (double), typeof (VisualFeedbackContentControl),

0 commit comments

Comments
 (0)