private void SetColors(MaterialColorConfiguration materialColor)
 {
     TryAddColorResource(MaterialConstants.Color.PRIMARY, materialColor.Primary);
     TryAddColorResource(MaterialConstants.Color.PRIMARY_VARIANT, materialColor.PrimaryVariant);
     TryAddColorResource(MaterialConstants.Color.ON_PRIMARY, materialColor.OnPrimary);
     TryAddColorResource(MaterialConstants.Color.SECONDARY, materialColor.Secondary);
     TryAddColorResource(MaterialConstants.Color.SECONDARY_VARIANT, materialColor.SecondaryVariant);
     TryAddColorResource(MaterialConstants.Color.ON_SECONDARY, materialColor.OnSecondary);
     TryAddColorResource(MaterialConstants.Color.BACKGROUND, materialColor.Background);
     TryAddColorResource(MaterialConstants.Color.ON_BACKGROUND, materialColor.OnBackground);
     TryAddColorResource(MaterialConstants.Color.SURFACE, materialColor.Surface);
     TryAddColorResource(MaterialConstants.Color.ON_SURFACE, materialColor.OnSurface);
     TryAddColorResource(MaterialConstants.Color.ERROR, materialColor.Error);
     TryAddColorResource(MaterialConstants.Color.ON_ERROR, materialColor.OnError);
 }
        private void SetColors(MaterialColorConfiguration materialColor)
        {
            this.TryAddColorResource(MaterialConstants.Color.PRIMARY, materialColor.Primary);
            this.TryAddColorResource(MaterialConstants.Color.PRIMARY_VARIANT, materialColor.PrimaryVariant);
            this.TryAddColorResource(MaterialConstants.Color.ONPRIMARY, materialColor.OnPrimary);
            this.TryAddColorResource(MaterialConstants.Color.SECONDARY, materialColor.Secondary);
            this.TryAddColorResource(MaterialConstants.Color.SECONDARY_VARIANT, materialColor.SecondaryVariant);
            this.TryAddColorResource(MaterialConstants.Color.ONSECONDARY, materialColor.OnSecondary);
            this.TryAddColorResource(MaterialConstants.Color.BACKGROUND, materialColor.Background);
            this.TryAddColorResource(MaterialConstants.Color.ONBACKGROUND, materialColor.OnBackground);
            this.TryAddColorResource(MaterialConstants.Color.SURFACE, materialColor.Surface);
            this.TryAddColorResource(MaterialConstants.Color.ONSURFACE, materialColor.OnSurface);
            this.TryAddColorResource(MaterialConstants.Color.ERROR, materialColor.Error);
            this.TryAddColorResource(MaterialConstants.Color.ONERROR, materialColor.OnError);

            Material.PlatformConfiguration.ChangeStatusBarColor(materialColor.PrimaryVariant);
        }
 internal MaterialColors(MaterialColorConfiguration materialColor)
 {
     this.InitializeComponent();
     this.SetColors(materialColor ?? new MaterialColorConfiguration());
 }
 internal MaterialColors(MaterialColorConfiguration materialColor)
 {
     InitializeComponent();
     SetColors(materialColor);
 }