From 19c04c363e32b03e62650ad5139a9177636f2dba Mon Sep 17 00:00:00 2001 From: Jordan Wages Date: Sun, 24 Jun 2018 23:26:28 -0500 Subject: [PATCH] Conditional XAML --- butterflow-ui/ButterflowOption.cs | 13 +++++++++ butterflow-ui/Controls.xaml | 6 ++++ .../Localization/Localization.Designer.cs | 20 ++++++++++++- butterflow-ui/Localization/Localization.resx | 8 ++++- butterflow-ui/MainWindow.xaml | 29 +++++++++++++------ 5 files changed, 65 insertions(+), 11 deletions(-) diff --git a/butterflow-ui/ButterflowOption.cs b/butterflow-ui/ButterflowOption.cs index ca9109b..9f17366 100644 --- a/butterflow-ui/ButterflowOption.cs +++ b/butterflow-ui/ButterflowOption.cs @@ -14,11 +14,24 @@ namespace butterflow_ui public string LabelValue { get; set; } + public string DescriptionValue { get; set; } + + public Visibility ToolTipVisibility + { + get + { + //return string.IsNullOrWhiteSpace(this.DescriptionValue) ? Visibility.Hidden : Visibility.Visible; + return Visibility.Hidden; + } + } + #endregion #region Dependency Properties public static DependencyProperty LabelValueProperty = DependencyProperty.Register("LabelValue", typeof(string), typeof(ButterflowOption)); + public static DependencyProperty DescriptionValueProperty = DependencyProperty.Register("DescriptionValue", typeof(string), typeof(ButterflowOption)); + public static DependencyProperty ToolTipVisibilityProperty = DependencyProperty.Register("ToolTipVisibility", typeof(Visibility), typeof(ButterflowOption)); #endregion diff --git a/butterflow-ui/Controls.xaml b/butterflow-ui/Controls.xaml index 27ac339..120b8f9 100644 --- a/butterflow-ui/Controls.xaml +++ b/butterflow-ui/Controls.xaml @@ -13,7 +13,13 @@