File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Src/ScreenGrid.ViewModels Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 11namespace ScreenGrid . ViewModels
22{
3+ using System ;
34 using System . Linq ;
45 using System . Windows . Media ;
56
@@ -42,5 +43,25 @@ private static string GetColorName(Color color)
4243 . FirstOrDefault ( p => ( Color ) p . GetValue ( null , null ) == color ) ;
4344 return colorProperty != null ? colorProperty . Name : "???" ;
4445 }
46+
47+ public override bool Equals ( Object obj )
48+ {
49+ return ( ( obj is ColorItemViewModel ) && ( this == ( ColorItemViewModel ) obj ) ) ;
50+ }
51+
52+ public override int GetHashCode ( )
53+ {
54+ return this . color . GetHashCode ( ) ;
55+ }
56+
57+ public static bool operator == ( ColorItemViewModel a , ColorItemViewModel b )
58+ {
59+ return ( a . Color == b . Color ) ;
60+ }
61+
62+ public static bool operator != ( ColorItemViewModel a , ColorItemViewModel b )
63+ {
64+ return ( ! ( a == b ) ) ;
65+ }
4566 }
4667}
You can’t perform that action at this time.
0 commit comments