From ee0e75deb96326a272b07cab353b4d24225056c2 Mon Sep 17 00:00:00 2001 From: Artur Date: Sun, 11 Oct 2015 01:12:44 +0300 Subject: [PATCH] Add InputGestureText usage --- MainDemo.Wpf/MenusAndToolBars.xaml | 8 +- .../TextFieldHintVisibilityConverter.cs | 5 +- .../Themes/MaterialDesignTheme.Menu.xaml | 222 +++++++++++++----- 3 files changed, 170 insertions(+), 65 deletions(-) diff --git a/MainDemo.Wpf/MenusAndToolBars.xaml b/MainDemo.Wpf/MenusAndToolBars.xaml index 24b7b74d84..ceccf02726 100644 --- a/MainDemo.Wpf/MenusAndToolBars.xaml +++ b/MainDemo.Wpf/MenusAndToolBars.xaml @@ -18,7 +18,7 @@ - + @@ -30,9 +30,9 @@ - - - + + + diff --git a/MaterialDesignThemes.Wpf/Converters/TextFieldHintVisibilityConverter.cs b/MaterialDesignThemes.Wpf/Converters/TextFieldHintVisibilityConverter.cs index 81c7806754..c04e32019b 100644 --- a/MaterialDesignThemes.Wpf/Converters/TextFieldHintVisibilityConverter.cs +++ b/MaterialDesignThemes.Wpf/Converters/TextFieldHintVisibilityConverter.cs @@ -7,9 +7,12 @@ namespace MaterialDesignThemes.Wpf.Converters { public class TextFieldHintVisibilityConverter : IValueConverter { + public Visibility IsEmptyValue { get; set; } = Visibility.Visible; + public Visibility IsNotEmptyValue { get; set; } = Visibility.Hidden; + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return string.IsNullOrEmpty((value ?? "").ToString()) ? Visibility.Visible : Visibility.Hidden; + return string.IsNullOrEmpty((value ?? "").ToString()) ? IsEmptyValue : IsNotEmptyValue; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Menu.xaml b/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Menu.xaml index 920e381197..6b0454fadc 100644 --- a/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Menu.xaml +++ b/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Menu.xaml @@ -1,15 +1,21 @@  + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf" + xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters"> + +