Skip to content

Commit 0bf671a

Browse files
committed
Added a text message into the central item when colors history is empty
1 parent e154bc9 commit 0bf671a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ColorPicker/ColorsHistoryWindow.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Grid>
1111
<controls:CircularMenu x:Name="circularMenu" IsOpen="False" Background="#CCFFFFFF">
1212
<controls:CircularMenu.CentralItem>
13-
<controls:CircularMenuCentralItem/>
13+
<controls:CircularMenuCentralItem ContentText="History empty"/>
1414
</controls:CircularMenu.CentralItem>
1515
</controls:CircularMenu>
1616
</Grid>

ColorPicker/Controls/CircularMenu.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public override void BeginInit()
5454
base.BeginInit();
5555
}
5656

57-
5857
private void Items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
5958
{
6059
if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
@@ -69,6 +68,10 @@ private void Items_CollectionChanged(object sender, System.Collections.Specializ
6968
(e.NewItems[0] as CircularMenuItem).MouseLeave -= CircularMenuItem_MouseLeave;
7069
(e.NewItems[0] as CircularMenuItem).PreviewMouseDown -= CircularMenuItem_MouseDown;
7170
}
71+
if(Items?.Count > 0)
72+
{
73+
CentralItem.ContentText = string.Empty;
74+
}
7275
}
7376

7477
private void CircularMenuItem_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)

0 commit comments

Comments
 (0)