public DialogBackend() { cmd = new DelegatedCommand <WpfDialogButton> (OnButtonClicked); // Surprisingly, the ItemsControls are focusable by default; disable that to fix tab navigation this.leftButtonContainer.Focusable = false; this.rightButtonContainer.Focusable = false; this.leftButtonContainer.ItemsPanel = leftPanelTemplate; this.leftButtonContainer.ItemTemplateSelector = new DialogButtonTemplateSelector(ButtonStyle, cmd); this.leftButtonContainer.ItemsSource = this.leftButtons; this.leftButtonContainer.HorizontalAlignment = HorizontalAlignment.Left; this.rightButtonContainer.ItemsPanel = rightPanelTemplate; this.rightButtonContainer.ItemTemplateSelector = new DialogButtonTemplateSelector(ButtonStyle, cmd); this.rightButtonContainer.ItemsSource = this.rightButtons; this.rightButtonContainer.HorizontalAlignment = HorizontalAlignment.Right; this.rootPanel.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); separator = new SWC.Separator(); separator.Visibility = Visibility.Collapsed; Grid.SetRow(separator, 2); this.rootPanel.Children.Add(separator); this.rootPanel.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); this.buttonContainer.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto }); this.buttonContainer.ColumnDefinitions.Add(new ColumnDefinition()); this.buttonContainer.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto }); Grid.SetColumn(this.leftButtonContainer, 0); Grid.SetColumn(this.rightButtonContainer, 2); this.buttonContainer.Children.Add(this.leftButtonContainer); this.buttonContainer.Children.Add(this.rightButtonContainer); Grid.SetRow(buttonContainer, 3); this.rootPanel.Children.Add(buttonContainer); buttonContainer.Visibility = Visibility.Collapsed; }
public DialogBackend() { cmd = new DelegatedCommand <DialogButton> (OnButtonClicked); this.buttonContainer.ItemsPanel = PanelTemplate; this.buttonContainer.ItemTemplateSelector = new DialogButtonTemplateSelector(ButtonStyle, cmd); this.buttonContainer.ItemsSource = this.buttons; this.buttonContainer.HorizontalAlignment = HorizontalAlignment.Right; this.rootPanel.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); separator = new SWC.Separator(); Grid.SetRow(separator, 2); this.rootPanel.Children.Add(separator); this.rootPanel.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); Grid.SetRow(this.buttonContainer, 3); this.rootPanel.Children.Add(this.buttonContainer); }