public KeyCanvas AddTextBlock(string name, KeyTextBlock textBlock) { if (_textBlocks.ContainsKey(name)) { throw new Exception($"TextBlock {name} already exists"); } Canvas.Children.Add(textBlock.Get()); _textBlocks.TryAdd(name, textBlock); return(this); }
public KeyTextBlock CreateTextBlock(string text = "", bool centered = true) { var ktb = new KeyTextBlock(_width, _height, text, centered); return(ktb); }