Skip to content

Commit 85a4339

Browse files
dnenovreddyashish
andauthored
GraphNodeManager Update (#13069)
* Nested Empty List Not Showing - added a recursion to the IsNodeEmptyList method to factor in nested empty lists * Filter Label Consistent Capitalisation - fixed inconsistency in capitalization of Filter titles * Export Tooltip - 'Export to Excel' changed to 'Export' * Tooltip Export and Copy Flip - used a different style of Dynamo Tooltip supporting a positioning for the arrow to adjust for these 2 edge cases * DismissedAlerts Not Updated in Automatic Mode - added a dedicated property inside the NodeModel to raise PropertyChanged when updating the DismissedAlerts - as the external view extension has no access to the NodeViewModel, the code previously acquired the DismissedAlerts count from the .Count value of the DismissedAlert ObservableCollection. However, this wasn't triggering an update and was not being detected inside the external code of the view extension * Icons to Filters - added Icons to the Filter elements in the UI * Aligned Filters to Figma - reshuffled order of filters - changed 'Information' to 'Info' title * Export Default Name - added a default file name based on the name of the current graph - fixed a bug when using the CSV file extension dropdown * Export Unfiltered Nodes Only - only export nodes that haven't been filtered in the UI * Renamed Node Blue Dot - added an identifier to the renamed nodes - IMPORTANT - exposed a method from NodeModelExtensions to allow to check if a node has been renamed! * Comments: nameof - using nameof(<PropertyName>) instead of string value * Comments: GetOriginalName Internal, used InternalsVisibleTo instead - reverted a change making GetOriginalName public - included 'GraphNodeManagerViewExtension' to see internals from DynamoCore using InternalsVisibleTo - comment fix * Summary Comments Added to FilterViewModel - added comments to public properties * Fixed Summary Comments After Change - added the additional parameter that was recently introduced to the comment * Comments: IEnumerable to Array Simplified - changed the way we get an array from the ItemsSource * Comments: Braces - minor change * SearchTextBox Update - added a localization resource for 'Search' watermark text - 'Search' watermark will now disappears on mouse entering the textbox * DataGrid Visual Changes - removed cell margin to create 'continuous' vertical lines - aligned icons and headings * Export Dual Tooltip - added an alternative tooltip that shows when nodes are being filtered * Select Node Behavior Change - now would always select (zoom in around) a Node, so if the user navigates away in the Canvas, they can zoom back around the Node through GNM * Multiple Visual Updates - set negative left/right margin to create 'borderless' look - updated hidden icon (resolution) - multiple visual tweaks to the datagrid lement * Warning/Error Text Contrast - updated font families to default to ArtifaktElementBold for main text and ArtifaktElementRegular for detail information text - updated detailed information text to the default Text color * Hover State Colors, Consistent Selection Color - changed alternating row hover colors to be different to the selected row color - replaced hard-coded color values with resource colors * Dismissed Warning Italic Font - now styles dismissed warnings message in Italic (missing Artefakt Italic resource, placehoder Ariel at the moment) * Any Empty Lists and Null - changed the methods to detect if a node contains Empty List or Null to any instead of all (will now show the respective symbol if any occurrences are found in the node outputs) * GNM EmptyList and Null Test - added unit test checking if the number of Nodes containing Null or Empty List matches what is shown on the UI - added a new dynamo graph to test against * Remove Dismissed Icon - removed icon when a warning is dismissed * Naming Convention - removed underscore to field name for dismissedAlertsCount in NodeModel * Images as Resource - Filter Items now use images as resources converting them to ImageSource from bitmap * Removed/Replaced Converters - replaced converters with Dynamo converters - removed old and unused converters * Color Resources Replaced - replaced most of the color resources with the identical counterparts already present in the main dynamo resource dictionaries * Converter Namespace Rename - renamed the namespace containing all extension specific converters to a more generic name * Merge Fix - fixed small issue after merge on upstream master * Reverted Changes, Fix Tests Fail - reverted changes made to the DynamoModern dictionary - the changes were breaking 2 tests Co-authored-by: reddyashish <43763136+reddyashish@users.noreply.github.com>
1 parent 753d4ec commit 85a4339

File tree

22 files changed

+1371
-255
lines changed

22 files changed

+1371
-255
lines changed

src/DynamoCore/Graph/Nodes/NodeModel.cs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,11 +1081,34 @@ public virtual NodeOutputData OutputData
10811081
};
10821082
}
10831083
}
1084-
1084+
10851085
/// A collection of error/warning/info messages, dismissed via a sub-menu in the node Context Menu.
10861086
[JsonIgnore]
10871087
public ObservableCollection<string> DismissedAlerts { get; set; } = new ObservableCollection<string>();
10881088

1089+
1090+
private int dismissedAlertsCount;
1091+
/// <summary>
1092+
/// Returns the number of dismissed error/warning/info messages.
1093+
/// </summary>
1094+
[JsonIgnore]
1095+
public int DismissedAlertsCount
1096+
{
1097+
get
1098+
{
1099+
return dismissedAlertsCount;
1100+
}
1101+
1102+
internal set // Private setter, see "ArgumentLacing" for details.
1103+
{
1104+
if (dismissedAlertsCount != value)
1105+
{
1106+
dismissedAlertsCount = value;
1107+
RaisePropertyChanged(nameof(DismissedAlertsCount));
1108+
}
1109+
}
1110+
}
1111+
10891112
#endregion
10901113

10911114
#region freeze execution

src/DynamoCore/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@
4848
[assembly: InternalsVisibleTo("DynamoManipulation")]
4949
[assembly: InternalsVisibleTo("IronPythonTests")]
5050
[assembly: InternalsVisibleTo("DynamoPackagesWPF")]
51+
[assembly: InternalsVisibleTo("GraphNodeManagerViewExtension")]
5152

5253
[assembly: TypeForwardedTo(typeof(Dynamo.Scheduler.Disposable))]

src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5166,7 +5166,7 @@
51665166
<Style x:Key="InputBoxDarkThemeStyle" TargetType="{x:Type TextBox}">
51675167
<Setter Property="FontFamily" Value="{StaticResource ArtifaktElementRegular}" />
51685168
<Setter Property="Foreground" Value="{StaticResource DarkThemeBodyMediumBrush}"/>
5169-
<Setter Property="Background" Value="{StaticResource DarkThemeInputBoxBackgroundBrush}"/>
5169+
<Setter Property="Background" Value="#353535"/>
51705170
<Setter Property="UseLayoutRounding" Value="True"/>
51715171
<Setter Property="FontSize" Value="12px"/>
51725172
<Setter Property="Padding" Value="10"/>
@@ -5253,7 +5253,7 @@
52535253
<Grid>
52545254
<TextBox x:Name="InputTextBox"
52555255
Padding="8,10"
5256-
Background="#353535"
5256+
Background="{StaticResource DarkThemeInputBoxBackgroundColor}"
52575257
BorderThickness="0"
52585258
CaretBrush="{StaticResource Blue300Brush}"
52595259
Focusable="True"

src/DynamoCoreWpf/ViewModels/Core/NodeViewModel.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,21 @@ private void DismissedNodeMessages_CollectionChanged(object sender, NotifyCollec
950950

951951
RaisePropertyChanged(nameof(DismissedAlerts));
952952
RaisePropertyChanged(nameof(NumberOfDismissedAlerts));
953+
954+
UpdateModelDismissedAlertsCount();
953955
}
954-
956+
957+
/// <summary>
958+
/// Calls an update for the DismissedAlertCount inside the NodeModel to push PropertyChanged fire
959+
/// </summary>
960+
private void UpdateModelDismissedAlertsCount()
961+
{
962+
if (DismissedAlerts != null)
963+
{
964+
nodeLogic.DismissedAlertsCount = DismissedAlerts.Count;
965+
}
966+
}
967+
955968
/// <summary>
956969
/// Dispose function
957970
/// </summary>

src/GraphNodeManagerViewExtension/Controls/ControlColorsAndBrushes.xaml

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
1-
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2+
xmlns:ui="clr-namespace:Dynamo.UI;assembly=DynamoCoreWpf">
3+
4+
<ResourceDictionary.MergedDictionaries>
5+
<ui:SharedResourceDictionary Source="{x:Static ui:SharedDictionaryManager.DynamoColorsAndBrushesDictionaryUri}" />
6+
<ui:SharedResourceDictionary Source="{x:Static ui:SharedDictionaryManager.DynamoModernDictionaryUri}" />
7+
</ResourceDictionary.MergedDictionaries>
28

39
<!-- Colors -->
4-
<Color x:Key="MidGray">#999999</Color>
5-
<Color x:Key="LightGray">#CCCCCC</Color>
6-
<Color x:Key="Blue">#38abdf</Color>
7-
<Color x:Key="MidLightBlue">#366a81</Color>
8-
<Color x:Key="MidBlue">#365868</Color>
9-
<Color x:Key="MidDarkBlue">#375f71</Color>
10-
<Color x:Key="TextColor">#F5F5F5</Color>
11-
<Color x:Key="GrayOpacity">#5C5C5C5C</Color>
10+
<Color x:Key="MidGrayColor">#999999</Color>
11+
<Color x:Key="BorderColor">#555</Color>
1212

1313
<!-- Brushes -->
14-
<SolidColorBrush x:Key="MidGrayBrush" Color="{StaticResource MidGray}" />
15-
<SolidColorBrush x:Key="LightGrayBrush" Color="{StaticResource LightGray}" />
16-
<SolidColorBrush x:Key="BlueBrush" Color="{StaticResource Blue}" />
17-
<SolidColorBrush x:Key="MidLightBlueBrush" Color="{StaticResource MidLightBlue}" />
18-
<SolidColorBrush x:Key="MidBlueBrush" Color="{StaticResource MidBlue}" />
19-
<SolidColorBrush x:Key="MidDarkBlueBrush" Color="{StaticResource MidDarkBlue}" />
20-
<SolidColorBrush x:Key="TextColorBrush" Color="{StaticResource TextColor}" />
21-
<SolidColorBrush x:Key="GrayOpacityBrush" Color="{StaticResource GrayOpacity}" />
14+
<SolidColorBrush x:Key="MidGrayBrush" Color="{StaticResource MidGrayColor}" />
15+
<SolidColorBrush x:Key="BorderColorBrush" Color="{StaticResource BorderColor}" />
2216

2317
<!-- DataGrid style -->
2418
<Style x:Key="DataGridStyle1" TargetType="{x:Type DataGrid}">
@@ -27,59 +21,69 @@
2721
<Setter Property="CellStyle" Value="{DynamicResource CellStyle1}"/>
2822
<Setter Property="RowHeaderWidth" Value="0"/>
2923
<Setter Property="BorderThickness" Value="0.5" />
30-
<Setter Property="BorderBrush" Value="#555555"/>
24+
<Setter Property="BorderBrush" Value="{StaticResource BorderColorBrush}"/>
3125
<Setter Property="ColumnWidth" Value="Auto"/>
3226
<Setter Property="GridLinesVisibility" Value="Vertical"/>
33-
<Setter Property="VerticalGridLinesBrush" Value="#555555"/>
27+
<Setter Property="VerticalGridLinesBrush" Value="{StaticResource BorderColorBrush}"/>
3428
<Setter Property="UseLayoutRounding" Value="True"></Setter>
29+
<Setter Property="SnapsToDevicePixels" Value="True"></Setter>
3530
</Style>
3631

3732
<!-- DataGridColumnHeader style -->
3833
<Style x:Key="ColumnHeaderStyle1" TargetType="DataGridColumnHeader">
39-
<Setter Property="Height" Value="20"/>
40-
<Setter Property="Background" Value="#333333"/>
41-
<Setter Property="Foreground" Value="#999999"/>
34+
<Setter Property="Height" Value="24"/>
35+
<Setter Property="Background" Value="{StaticResource ExtensionBackgroundColor}"/>
36+
<Setter Property="Foreground" Value="#bbbbbb"/>
37+
<Setter Property="BorderThickness" Value="0 0 0 1"></Setter>
38+
<Setter Property="BorderBrush" Value="{StaticResource BorderColorBrush}"></Setter>
4239
<Setter Property="FontSize" Value="10" />
43-
<Setter Property="BorderThickness" Value="0 0 1 0" />
44-
<Setter Property="BorderBrush" Value="#555555"/>
45-
<Setter Property="Margin" Value="0 0 1 0"/>
46-
<Setter Property="Padding" Value="10 0"/>
40+
<Setter Property="Margin" Value="0"/>
41+
<Setter Property="Padding" Value="6 0"/>
42+
<Setter Property="UseLayoutRounding" Value="True"></Setter>
43+
<Setter Property="SnapsToDevicePixels" Value="True"></Setter>
4744
</Style>
4845

4946
<!-- DataGridRow style -->
5047
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
51-
<Setter Property="Background" Value="#333333"/>
48+
<Setter Property="Background" Value="{StaticResource MainBackgroundColor}"/>
5249
<Setter Property="BorderThickness" Value="0" />
5350
<Setter Property="MinHeight" Value="24"></Setter>
5451
<Setter Property="VerticalContentAlignment" Value="Center"></Setter>
55-
<Setter Property="BorderBrush" Value="#555555"/>
52+
<Setter Property="BorderBrush" Value="{StaticResource BorderColorBrush}"/>
53+
<Setter Property="UseLayoutRounding" Value="True"></Setter>
54+
<Setter Property="SnapsToDevicePixels" Value="True"></Setter>
5655
<Style.Triggers>
57-
<Trigger Property="IsSelected" Value="True">
58-
<Setter Property="Background" Value="#555555" />
56+
<Trigger Property="AlternationIndex" Value="1">
57+
<Setter Property="Background" Value="{StaticResource DarkerGreyBrush}"/>
5958
</Trigger>
6059
<Trigger Property="IsMouseOver" Value="True">
61-
<Setter Property="Background" Value="#555555" />
60+
<Setter Property="Background" Value="#434343"/>
61+
</Trigger>
62+
<Trigger Property="IsSelected" Value="True">
63+
<Setter Property="Background" Value="#4a4a4a" />
6264
</Trigger>
6365
</Style.Triggers>
6466
</Style>
6567

6668
<!-- Cell style -->
6769
<Style x:Key="CellStyle1" TargetType="DataGridCell">
6870
<Setter Property="BorderThickness" Value="0" />
69-
<Setter Property="Margin" Value="1" />
71+
<Setter Property="Margin" Value="1 0 0 0" />
7072
<Setter Property="MinHeight" Value="24"></Setter>
73+
<Setter Property="UseLayoutRounding" Value="True"></Setter>
74+
<Setter Property="SnapsToDevicePixels" Value="True"></Setter>
7175
<Setter Property="Template">
7276
<Setter.Value>
7377
<ControlTemplate TargetType="{x:Type DataGridCell}">
7478
<Grid Background="{TemplateBinding Background}">
75-
<ContentPresenter VerticalAlignment="Center" />
79+
<ContentPresenter VerticalAlignment="Center" Margin="2 0" />
7680
</Grid>
7781
</ControlTemplate>
7882
</Setter.Value>
7983
</Setter>
8084
<Style.Triggers>
8185
<Trigger Property="IsSelected" Value="True">
82-
<Setter Property="Background" Value="#555555" />
86+
<Setter Property="Background" Value="{StaticResource BorderColorBrush}" />
8387
</Trigger>
8488
</Style.Triggers>
8589
</Style>
@@ -111,7 +115,7 @@
111115

112116
<!-- Button Style -->
113117
<Style x:Key="ButtonStyle1" TargetType="{x:Type Button}">
114-
<Setter Property="Foreground" Value="{StaticResource TextColorBrush}"></Setter>
118+
<Setter Property="Foreground" Value="{StaticResource DarkThemeBodyMediumBrush}"></Setter>
115119
<Setter Property="Background" Value="Transparent"/>
116120
<Setter Property="BorderThickness" Value="0"></Setter>
117121
<Setter Property="FontSize" Value="10"></Setter>
@@ -126,7 +130,7 @@
126130
</Setter>
127131
<Style.Triggers>
128132
<Trigger Property="IsMouseOver" Value="True">
129-
<Setter Property="Foreground" Value="{StaticResource BlueBrush}" />
133+
<Setter Property="Foreground" Value="{StaticResource Blue400Brush}" />
130134
</Trigger>
131135
<Trigger Property="IsPressed" Value="True">
132136
<Setter Property="Foreground" Value="{StaticResource MidLightBlueBrush}" />

src/GraphNodeManagerViewExtension/Controls/FilterItemControl.xaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
<ResourceDictionary.MergedDictionaries>
1313
<ResourceDictionary Source="ControlColorsAndBrushes.xaml"/>
1414
<ui:SharedResourceDictionary Source="{x:Static ui:SharedDictionaryManager.DynamoModernDictionaryUri}" />
15+
<ui:SharedResourceDictionary Source="{x:Static ui:SharedDictionaryManager.DynamoColorsAndBrushesDictionaryUri}" />
1516
</ResourceDictionary.MergedDictionaries>
16-
<local:BooleanToBorderColorConverter x:Key="BooleanToBorderColorConverter" ToggleBrush="{StaticResource BlueBrush}"/>
17+
<local:BooleanToBorderColorConverter x:Key="BooleanToBorderColorConverter" ToggleBrush="{StaticResource Blue400Brush}"/>
1718
<local:BooleanToColorConverter x:Key="BooleanToColorConverter"
1819
DefaultBrush="{StaticResource DarkGreyBrush}"
1920
HoverBrush="{StaticResource DarkMidGreyBrush}"
20-
PressedBrush="{StaticResource LightGrayBrush}"
21+
PressedBrush="{StaticResource PrimaryCharcoal300Brush}"
2122
ToggleDefaultBrush="{StaticResource MidBlueBrush}"
2223
ToggleHoverBrush="{StaticResource MidDarkBlueBrush}"
2324
TogglePressedBrush="{StaticResource MidLightBlueBrush}" />
@@ -36,7 +37,16 @@
3637
Converter={StaticResource BooleanToColorConverter},
3738
ConverterParameter=Default,
3839
UpdateSourceTrigger=PropertyChanged}">
39-
<ContentPresenter />
40+
<StackPanel Orientation="Horizontal">
41+
<Image Source="{Binding FilterImage}"
42+
Width="10"
43+
Height="10"
44+
SnapsToDevicePixels="True"
45+
UseLayoutRounding="True"
46+
VerticalAlignment="Stretch"
47+
Margin="2 0 0 0"/>
48+
<ContentPresenter />
49+
</StackPanel>
4050
</Border>
4151

4252
<ControlTemplate.Triggers>
@@ -68,7 +78,7 @@
6878
TextAlignment="Center"
6979
FontSize="10"
7080
FontWeight="Medium"
71-
Foreground="{StaticResource TextColorBrush}"
81+
Foreground="{StaticResource DarkThemeBodyMediumBrush}"
7282
HorizontalAlignment="Center"
7383
VerticalAlignment="Center">
7484
</TextBlock>

src/GraphNodeManagerViewExtension/Controls/SearchBoxControl.xaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:Dynamo.GraphNodeManager.Controls"
77
xmlns:p="clr-namespace:Dynamo.GraphNodeManager.Properties"
8+
xmlns:ui="clr-namespace:Dynamo.UI;assembly=DynamoCoreWpf"
89
mc:Ignorable="d"
910
d:DesignHeight="40" d:DesignWidth="800">
1011
<UserControl.Resources>
1112
<ResourceDictionary>
1213
<ResourceDictionary.MergedDictionaries>
14+
<ui:SharedResourceDictionary Source="{x:Static ui:SharedDictionaryManager.DynamoColorsAndBrushesDictionaryUri}" />
15+
<ui:SharedResourceDictionary Source="{x:Static ui:SharedDictionaryManager.DynamoModernDictionaryUri}" />
1316
<ResourceDictionary Source="ControlColorsAndBrushes.xaml"/>
1417
</ResourceDictionary.MergedDictionaries>
1518
<local:NonEmptyStringToCollapsedConverter x:Key="NonEmptyStringToCollapsedConverter"/>
@@ -18,24 +21,24 @@
1821
<Setter Property="Background" Value="Transparent"/>
1922
<Setter Property="Padding" Value="15 10 5 5"/>
2023
<Setter Property="FontSize" Value="11"/>
21-
<Setter Property="Foreground" Value="{StaticResource TextColorBrush}"></Setter>
24+
<Setter Property="Foreground" Value="{StaticResource DarkThemeBodyMediumBrush}"></Setter>
2225
</Style>
2326
<Style x:Key="TextBlockStyle" TargetType="TextBlock">
2427
<Setter Property="Background" Value="Transparent"/>
2528
<Setter Property="Padding" Value="15 10 5 5"/>
2629
<Setter Property="FontSize" Value="11"/>
27-
<Setter Property="Foreground" Value="{StaticResource TextColorBrush}"></Setter>
30+
<Setter Property="Foreground" Value="{StaticResource DarkThemeBodyMediumBrush}"></Setter>
2831
</Style>
2932
<Style x:Key="BorderStyle" TargetType="Border">
3033
<Setter Property="BorderThickness" Value="0 0 0 1"></Setter>
3134
<Setter Property="Background" Value="Transparent"></Setter>
3235
<Setter Property="BorderBrush" Value="{StaticResource MidGrayBrush}"></Setter>
3336
<Style.Triggers>
3437
<DataTrigger Binding="{Binding ElementName=SearchTextBox, Path=IsMouseOver}" Value="True">
35-
<Setter Property="BorderBrush" Value="{StaticResource LightGrayBrush}"></Setter>
38+
<Setter Property="BorderBrush" Value="{StaticResource PrimaryCharcoal300Brush}"></Setter>
3639
</DataTrigger>
3740
<DataTrigger Binding="{Binding ElementName=SearchTextBox, Path=IsFocused}" Value="True">
38-
<Setter Property="BorderBrush" Value="{StaticResource BlueBrush}"></Setter>
41+
<Setter Property="BorderBrush" Value="{StaticResource Blue400Brush}"></Setter>
3942
</DataTrigger>
4043
</Style.Triggers>
4144
</Style>
@@ -94,13 +97,9 @@
9497
Margin="2 0 0 0"
9598
Opacity="0.5"
9699
VerticalAlignment="Center"
97-
Text="{Binding SearchBoxPrompt}">
98-
<TextBlock.Visibility>
99-
<MultiBinding Converter="{StaticResource MultiBooleanToVisibilityConverter}">
100-
<Binding Path="SearchText"></Binding>
101-
<Binding ElementName="SearchTextBox" Path="IsFocused"></Binding>
102-
</MultiBinding>
103-
</TextBlock.Visibility>
100+
Visibility="Visible"
101+
IsHitTestVisible="False"
102+
Text="{x:Static p:Resources.SearchBoxWatermarkText}">
104103
</TextBlock>
105104

106105
<!-- Search Box -->
@@ -112,6 +111,7 @@
112111
Cursor="IBeam"
113112
HorizontalAlignment="Stretch"
114113
TextChanged="SearchTextBox_OnTextChanged"
114+
IsKeyboardFocusWithinChanged="SearchTextBox_OnKeyboardFocusWithinChanged"
115115
Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}"></TextBox>
116116

117117
<!-- Clear Search -->

src/GraphNodeManagerViewExtension/Controls/SearchBoxControl.xaml.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ private void OnSearchClearButtonClicked(object sender, System.Windows.Input.Mous
3737
{
3838
this.SearchTextBox.Clear();
3939
}
40+
41+
private void SearchTextBox_OnKeyboardFocusWithinChanged(object sender, DependencyPropertyChangedEventArgs e)
42+
{
43+
var textBox = sender as TextBox;
44+
if (textBox == null) return;
45+
46+
if (string.IsNullOrEmpty(textBox.Text) && !textBox.IsKeyboardFocusWithin)
47+
{
48+
SearchTextBoxWatermark.Visibility = Visibility.Visible;
49+
}
50+
else
51+
{
52+
SearchTextBoxWatermark.Visibility = Visibility.Collapsed;
53+
}
54+
}
4055
}
4156

4257
/// <summary>

0 commit comments

Comments
 (0)