public override void AddContent(string content) { if (textBlock == null) { textBlock = new TextBlock(Manager); Presenter.Add(textBlock); } Text = content; }
public Label(Manager manager, string text) : this(manager) { if (textBlock == null) { textBlock = new TextBlock(manager); Presenter.Add(textBlock); } Text = text; }
public Window(Manager manager) : base(manager) { // TODO: Replace with control template. containerPanel = new StackPanel(manager); var background = (Color)"#323741"; windowBorder =new Border(manager) { CornerRadius = 5, BorderThickness = 1, Background = Background, BorderBrush = background, }; base.Add(windowBorder); titleBorder = new Border(manager) { Background = background, Padding = new Thickness(8, 12), HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Top, }; titleLabel = new TextBlock(manager, Title) { FontStyle = FontStyle.Bold, TextColor = Color.White, HorizontalAlignment = HorizontalAlignment.Left, TextAlignment = Alignment.TopLeft }; windowBorder.Add(containerPanel); containerPanel.Add(titleBorder); titleBorder.Add(titleLabel); contentArea = new StackPanel(manager) { Margin = 8, }; containerPanel.Add(contentArea); Margin = 16; Effects.Add(new DropShadowEffect(manager, 12, Color.Black * .2f)); }