public NotificationWindow(Notification notification) { InitializeComponent(); textBlockTitle.Text = notification.Description; textBlockDescription.Load(notification.Commands); _notification = notification; DataContext = _notification; foreach (var command in notification.Commands) { Button button = new Button(); button.Click += CloseNotification; button.HorizontalAlignment = HorizontalAlignment.Center; button.Load(command); stackPanelButtons.Children.Add(button); } }