/// <summary> /// Apply the specified Thickness as margin to the Icon in the IHaveIcon /// </summary> /// <param name="haveIcon">IHaveIcon</param> /// <param name="thickness">Thickness for the marging</param> public static void ApplyIconMargin(this IHaveIcon haveIcon, Thickness thickness) { if (haveIcon == null) { throw new ArgumentNullException(nameof(haveIcon)); } if (haveIcon.Icon != null) { haveIcon.Icon.Margin = thickness; } }
/// <summary> /// Apply the specified Brush as Foreground for the icon of the IHaveIcon /// </summary> /// <param name="haveIcon">IHaveIcon</param> /// <param name="foregroundBrush">Brush for the Foreground</param> public static void ApplyIconForegroundColor(this IHaveIcon haveIcon, Brush foregroundBrush) { if (haveIcon == null) { throw new ArgumentNullException(nameof(haveIcon)); } if (haveIcon.Icon != null) { haveIcon.Icon.Foreground = foregroundBrush; } }