Skip to content

Commit a218188

Browse files
committed
ripple-roo
1 parent 86f81f3 commit a218188

15 files changed

+149
-57
lines changed

MaterialDesignColors.WpfExample/MainWindow.xaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@
154154
<RadioButton Style="{StaticResource MaterialDesignRadioButton}" x:Name="FieldsRadioButton" Margin="8 0 0 0" VerticalAlignment="Center">Fields</RadioButton>
155155
<Button Click="ProgressButton_OnClick" Margin="48 0 0 0">PROGRESS</Button>
156156
</StackPanel>
157-
<wpfExample:Buttons Visibility="{Binding ElementName=ButtonsRadioButton, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}" />
158-
<wpfExample:TextFields Visibility="{Binding ElementName=FieldsRadioButton, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}" />
159-
157+
<wpfExample:Buttons Visibility="{Binding ElementName=ButtonsRadioButton, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}" />
158+
<ScrollViewer Visibility="{Binding ElementName=FieldsRadioButton, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
159+
<wpfExample:TextFields />
160+
</ScrollViewer>
160161
</DockPanel>
161162

162163
</Window>

MaterialDesignColors.WpfExample/ProgressWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
Background="{DynamicResource MaterialDesignPaper}"
77
mc:Ignorable="d"
88
Title="Progress Indicators" Height="300" Width="600" Left="40" Top="40">

MaterialDesignColors.WpfExample/TextFields.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</Style>
3535
</ResourceDictionary>
3636
</UserControl.Resources>
37-
<Grid Margin="16">
37+
<Grid Margin="16" VerticalAlignment="Top">
3838
<Grid.ColumnDefinitions>
3939
<ColumnDefinition Width="Auto" />
4040
<ColumnDefinition Width="150" />
@@ -78,6 +78,7 @@
7878
<ComboBoxItem>Windows</ComboBoxItem>
7979
</ComboBox>
8080
<TextBox Grid.Row="0" Grid.RowSpan="3" Grid.Column="4" TextWrapping="Wrap" VerticalAlignment="Stretch" Margin="16 0 0 0"
81+
MinWidth="280"
8182
wpf:TextFieldAssist.Hint="Multiline text">Multiline. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</TextBox>
8283
<Viewbox Grid.Row="1" Grid.Column="0">
8384
<Canvas Width="24" Height="24">

MaterialDesignThemes.Wpf/MaterialDesignThemes.Wpf.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@
228228
<Compile Include="Converters\TextFieldHintVisibilityConverter.cs" />
229229
<Compile Include="TimePicker.cs" />
230230
<Compile Include="ToolTipAssist.cs" />
231-
<Compile Include="VisualFeedbackAssist.cs" />
232-
<Compile Include="VisualFeedbackContentControl.cs" />
231+
<Compile Include="RippleAssist.cs" />
232+
<Compile Include="Ripple.cs" />
233233
<EmbeddedResource Include="Properties\Resources.resx">
234234
<Generator>ResXFileCodeGenerator</Generator>
235235
<LastGenOutput>Resources.Designer.cs</LastGenOutput>

MaterialDesignThemes.Wpf/VisualFeedbackContentControl.cs renamed to MaterialDesignThemes.Wpf/Ripple.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515

1616
namespace MaterialDesignThemes.Wpf
1717
{
18-
public class VisualFeedbackContentControl : ContentControl
18+
public class Ripple : ContentControl
1919
{
20-
static VisualFeedbackContentControl()
20+
static Ripple()
2121
{
22-
DefaultStyleKeyProperty.OverrideMetadata(typeof(VisualFeedbackContentControl), new FrameworkPropertyMetadata(typeof(VisualFeedbackContentControl)));
22+
DefaultStyleKeyProperty.OverrideMetadata(typeof(Ripple), new FrameworkPropertyMetadata(typeof(Ripple)));
2323
}
2424

25-
public VisualFeedbackContentControl()
25+
public Ripple()
2626
{
2727
MouseMove += OnMouseMove;
2828
}
@@ -44,7 +44,7 @@ private void OnMouseMove(object sender, MouseEventArgs mouseEventArgs)
4444
}
4545

4646
public static readonly DependencyProperty FeedbackProperty = DependencyProperty.Register(
47-
"Feedback", typeof (Brush), typeof (VisualFeedbackContentControl), new PropertyMetadata(default(Brush)));
47+
"Feedback", typeof (Brush), typeof (Ripple), new PropertyMetadata(default(Brush)));
4848

4949
public Brush Feedback
5050
{
@@ -54,7 +54,7 @@ public Brush Feedback
5454

5555
private static readonly DependencyPropertyKey MouseXPropertyKey =
5656
DependencyProperty.RegisterReadOnly(
57-
"MouseX", typeof (double), typeof (VisualFeedbackContentControl),
57+
"MouseX", typeof (double), typeof (Ripple),
5858
new PropertyMetadata(default(double)));
5959

6060
public static readonly DependencyProperty MouseXProperty =
@@ -68,7 +68,7 @@ public double MouseX
6868

6969
private static readonly DependencyPropertyKey MouseYPropertyKey =
7070
DependencyProperty.RegisterReadOnly(
71-
"MouseY", typeof (double), typeof (VisualFeedbackContentControl),
71+
"MouseY", typeof (double), typeof (Ripple),
7272
new PropertyMetadata(default(double)));
7373

7474
public static readonly DependencyProperty MouseYProperty =
@@ -82,7 +82,7 @@ public double MouseY
8282

8383
private static readonly DependencyPropertyKey MouseLeftButtonDownXPropertyKey =
8484
DependencyProperty.RegisterReadOnly(
85-
"MouseLeftButtonDownX", typeof (double), typeof (VisualFeedbackContentControl),
85+
"MouseLeftButtonDownX", typeof (double), typeof (Ripple),
8686
new PropertyMetadata(default(double)));
8787

8888
public static readonly DependencyProperty MouseLeftButtonDownXProperty =
@@ -96,7 +96,7 @@ public double MouseLeftButtonDownX
9696

9797
private static readonly DependencyPropertyKey MouseLeftButtonDownYPropertyKey =
9898
DependencyProperty.RegisterReadOnly(
99-
"MouseLeftButtonDownY", typeof (double), typeof (VisualFeedbackContentControl),
99+
"MouseLeftButtonDownY", typeof (double), typeof (Ripple),
100100
new PropertyMetadata(default(double)));
101101

102102
public static readonly DependencyProperty MouseLeftButtonDownYProperty =

MaterialDesignThemes.Wpf/VisualFeedbackAssist.cs renamed to MaterialDesignThemes.Wpf/RippleAssist.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace MaterialDesignThemes.Wpf
44
{
5-
public static class VisualFeedbackAssist
5+
public static class RippleAssist
66
{
77
public static readonly DependencyProperty ClipToBoundsProperty = DependencyProperty.RegisterAttached(
8-
"ClipToBounds", typeof (bool), typeof (VisualFeedbackAssist), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.Inherits));
8+
"ClipToBounds", typeof (bool), typeof (RippleAssist), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.Inherits));
99

1010
public static void SetClipToBounds(DependencyObject element, bool value)
1111
{

MaterialDesignThemes.Wpf/Themes/Generic.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424

2525
<converters:BrushToRadialGradientBrushConverter x:Key="BrushToRadialGradientBrushConverter" />
2626

27-
<Style TargetType="{x:Type local:VisualFeedbackContentControl}">
27+
<Style TargetType="{x:Type local:Ripple}">
2828
<Setter Property="HorizontalAlignment" Value="Stretch" />
2929
<Setter Property="VerticalAlignment" Value="Stretch" />
3030
<Setter Property="Background" Value="Transparent" />
3131
<Setter Property="IsTabStop" Value="False" />
32-
<Setter Property="ClipToBounds" Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:VisualFeedbackAssist.ClipToBounds)}" />
32+
<Setter Property="ClipToBounds" Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:RippleAssist.ClipToBounds)}" />
3333
<Setter Property="Feedback" Value="{Binding RelativeSource={RelativeSource Self}, Path=Foreground}" />
3434
<Setter Property="Template">
3535
<Setter.Value>
36-
<ControlTemplate TargetType="{x:Type local:VisualFeedbackContentControl}">
36+
<ControlTemplate TargetType="{x:Type local:Ripple}">
3737
<Grid Background="Transparent">
3838
<Canvas IsHitTestVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
3939
<Ellipse x:Name="ClickEllipse" Fill="{TemplateBinding Feedback}" Opacity="0" Width="0" Height="0" Canvas.Left="{TemplateBinding MouseLeftButtonDownX}" Canvas.Top="{TemplateBinding MouseLeftButtonDownY}"

0 commit comments

Comments
 (0)