private void AddBackroundLabel(Grid otherGrid, RowInfo thisRow, int row) { TextBlock thisText = new TextBlock(); { var withBlock = thisText; withBlock.DataContext = thisRow; YahtzeeColorConverter converter = new YahtzeeColorConverter(); Binding ThisBind = new Binding(nameof(thisRow.IsRecent)); ThisBind.Converter = converter; withBlock.SetBinding(TextBlock.BackgroundProperty, ThisBind); GridHelper.AddControlToGrid(otherGrid, thisText, row, 0); Grid.SetColumnSpan(thisText, 3); } }
private void AddBackroundLabel(Grid otherGrid, RowInfo thisRow, int row) { Label thisText = new Label(); { var withBlock = thisText; withBlock.BindingContext = thisRow; YahtzeeColorConverter converter = new YahtzeeColorConverter(); Binding ThisBind = new Binding(nameof(thisRow.IsRecent)); ThisBind.Converter = converter; withBlock.SetBinding(BackgroundColorProperty, ThisBind); GridHelper.AddControlToGrid(otherGrid, thisText, row, 0); Grid.SetColumnSpan(thisText, 3); thisText.InputTransparent = true; } }