Esempio n. 1
0
        private void UpdateRecentColors( ColorItem colorItem )
        {
            if( !RecentColors.Contains( colorItem ) )
            RecentColors.Add( colorItem );

              if( RecentColors.Count > 10 ) //don't allow more than ten, maybe make a property that can be set by the user.
            RecentColors.RemoveAt( 0 );
        }
Esempio n. 2
0
        private static ObservableCollection<ColorItem> CreateAvailableColors()
        {
            ObservableCollection<ColorItem> _standardColors = new ObservableCollection<ColorItem>();

              foreach( var item in ColorUtilities.KnownColors )
              {
            if( !String.Equals( item.Key, "Transparent" ) )
            {
              var colorItem = new ColorItem( item.Value, item.Key );
              if( !_standardColors.Contains( colorItem ) )
            _standardColors.Add( colorItem );
            }
              }

              return _standardColors;
        }