public ConfirmDlg(string msg) { InitializeComponent(); txtMsg.Text = msg; Buttons = new Button[] { new Button { Content = "Confirm", Style = FindResource("StyledButton") as Style }, CancelButton }; Buttons.Last().Style = FindResource("StyledButton") as Style; ((Button)Buttons.First()).Click += onOK; }
public SnippetDlg(TextEditor aEditor, ObservableCollection<CodeSnippet> snippets) { InitializeComponent(); Snippets = snippets; editor_ = aEditor; Buttons = new Button[] { new Button { Name = "btnCreate", Content = "Insert", Style = FindResource("StyledButton") as Style, }, CancelButton }; Buttons.First().Click += SnippetDlg_Click; snippetCombo.DataContext = this; }