diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-10 18:20:12 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-10 18:20:12 +0300 |
| commit | 230d8c17b1ecf96aaa6d579b90f28006722e3149 (patch) | |
| tree | 410631a476e5231565a55275a97decfb4c7621fa /Software/Visual_Studio/Tango.Touch/Components | |
| parent | 456a74d3dc0fd3853f0e55f35f999895e23aa7a5 (diff) | |
| download | Tango-230d8c17b1ecf96aaa6d579b90f28006722e3149.tar.gz Tango-230d8c17b1ecf96aaa6d579b90f28006722e3149.zip | |
Working on LightTouchDataGrid !
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Components')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Components/Ripple.cs | 10 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Components/Ripple.xaml | 16 |
2 files changed, 21 insertions, 5 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Components/Ripple.cs b/Software/Visual_Studio/Tango.Touch/Components/Ripple.cs index 7cf097d8e..e0b4245c4 100644 --- a/Software/Visual_Studio/Tango.Touch/Components/Ripple.cs +++ b/Software/Visual_Studio/Tango.Touch/Components/Ripple.cs @@ -85,7 +85,15 @@ namespace Tango.Touch.Components set { SetValue(DisabledProperty, value); } } public static readonly DependencyProperty DisabledProperty = - DependencyProperty.Register("Disabled", typeof(bool), typeof(Ripple), new PropertyMetadata(false)); + DependencyProperty.Register("Disabled", typeof(bool), typeof(Ripple), new PropertyMetadata(false,(d,e) => (d as Ripple).OnDisabledChanged())); + + private void OnDisabledChanged() + { + if (Disabled) + { + CancelRipple(true); + } + } #region Attached Properties diff --git a/Software/Visual_Studio/Tango.Touch/Components/Ripple.xaml b/Software/Visual_Studio/Tango.Touch/Components/Ripple.xaml index 35fc5cd88..6cdaa4d70 100644 --- a/Software/Visual_Studio/Tango.Touch/Components/Ripple.xaml +++ b/Software/Visual_Studio/Tango.Touch/Components/Ripple.xaml @@ -6,12 +6,13 @@ <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="../Resources/Colors.xaml" /> + + <ResourceDictionary> + <converters:WidthHeightToRectConverter x:Key="WidthHeightToRectConverter" /> + </ResourceDictionary> </ResourceDictionary.MergedDictionaries> <Style TargetType="{x:Type local:Ripple}"> - <Style.Resources> - <converters:SizeToRectConverter x:Key="SizeToRectConverter" /> - </Style.Resources> <Setter Property="ClipToBounds" Value="True"></Setter> <Setter Property="Background" Value="Transparent"></Setter> <Setter Property="RippleBrush" Value="{StaticResource TangoRippleLightBrush}"></Setter> @@ -23,7 +24,14 @@ <ControlTemplate TargetType="{x:Type local:Ripple}"> <Border CornerRadius="{TemplateBinding CornerRadius}"> <Border.Clip> - <RectangleGeometry RadiusX="{Binding RelativeSource={RelativeSource AncestorType=local:Ripple},Path=CornerRadius.TopLeft}" RadiusY="{Binding RelativeSource={RelativeSource AncestorType=local:Ripple},Path=CornerRadius.BottomRight}" Rect="{Binding RelativeSource={RelativeSource AncestorType=local:Ripple},Path=RenderSize,Converter={StaticResource SizeToRectConverter}}"></RectangleGeometry> + <RectangleGeometry RadiusX="{Binding RelativeSource={RelativeSource AncestorType=local:Ripple},Path=CornerRadius.TopLeft}" RadiusY="{Binding RelativeSource={RelativeSource AncestorType=local:Ripple},Path=CornerRadius.BottomRight}"> + <RectangleGeometry.Rect> + <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}"> + <Binding RelativeSource="{RelativeSource AncestorType=local:Ripple}" Path="ActualWidth" /> + <Binding RelativeSource="{RelativeSource AncestorType=local:Ripple}" Path="ActualHeight" /> + </MultiBinding> + </RectangleGeometry.Rect> + </RectangleGeometry> </Border.Clip> <Grid x:Name="PART_grid"> <Canvas IsHitTestVisible="False"> |
