/// <summary> /// Centralizes code to create a checker brush for a <see cref="Border"/>. /// </summary> /// <param name="border">Border which will have its Background modified.</param> /// <param name="color">Color to use for transparent checkerboard.</param> /// <returns>Task</returns> public static async Task UpdateBorderBackgroundWithCheckerAsync(Border border, Color color) { if (border != null) { int width = Convert.ToInt32(border.ActualWidth); int height = Convert.ToInt32(border.ActualHeight); var bitmap = await ColorPickerRenderingHelpers.CreateCheckeredBitmapAsync( width, height, color); if (bitmap != null) { border.Background = await ColorPickerRenderingHelpers.BitmapToBrushAsync(bitmap, width, height); } } }
private async void CheckeredBackgroundBorder_Loaded(object sender, RoutedEventArgs e) { await ColorPickerRenderingHelpers.UpdateBorderBackgroundWithCheckerAsync( sender as Border, ColorPicker.CheckerBackgroundColor); // TODO: Check initialization }