public IconDetailsViewModel(IIcon icon, ISize size = null, IIconColor color = null)
            : this()
        {
            var sizes     = icon.Provider.GetSizes();
            var densities = icon.Provider.GetDensities();

            // fill selection controls
            this._icon      = icon;
            this._colors    = new ObservableCollection <IIconColor>(MaterialIconColor.Get());
            this._size      = size ?? sizes.First();
            this._sizes     = new ObservableCollection <ISize>(sizes);
            this._densities = new ObservableCollection <Selectable <string> >(
                densities.Select(density => new Selectable <string>(density, !density.Contains("drawable"),
                                                                    (x) => this.AddToProjectCommand.RaiseCanExecuteChanged())));

            // fill user selection
            this._color                 = color ?? MaterialIconColor.Black;
            this._colorCode             = this.ColorToCode(this._color.Color);
            this._materialColorSelected = this._color is MaterialIconColor
                ? this._color
                : MaterialIconColor.Black;
            this._projectIcon = icon.Provider.CreateProjectIcon(this.Icon,
                                                                this.Color, this.Size, densities.FirstOrDefault());

            this.GenerateName();
        }
 public GoogleProjectIcon(IIcon icon, IIconColor color, ISize size, string density)
 {
     this.Icon    = icon;
     this.Color   = color;
     this.Size    = size;
     this.Density = density;
 }
 public ProjectIconDesign(IIcon icon, IIconColor color, ISize size, string density)
 {
     this.Icon     = icon;
     this.FullName = icon.Name;
     this.Color    = color;
     this.Size     = size;
     this.Density  = density;
 }
 public abstract IProjectIcon CreateProjectIcon(IIcon icon, IIconColor color, ISize size, string density);
 public IProjectIcon CreateProjectIcon(IIcon icon, IIconColor color, ISize size, string density)
 {
     return(new ProjectIconDesign(icon, color, size, density));
 }
Example #6
0
 public GoogleAndroidProjectIcon(IIcon icon, IIconColor color, ISize size, string density)
     : base(icon, color, size, density)
 {
 }
 public override IProjectIcon CreateProjectIcon(IIcon icon, IIconColor color, ISize size, string density) =>
 new GoogleiOSProjectIcon(icon, color, size, density);