public MeasureChoiceDialog() { m_Dialog = new FloatingDialog(); m_Dialog.Caption = Localization.MeasureChoice_Caption + "..."; Grid PopUpLayoutRoot = new Grid(); PopUpLayoutRoot.RowDefinitions.Add(new RowDefinition() { }); PopUpLayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); // Контрол выбора m_ChoiceControl = new MeasureChoiceCtrl(); m_ChoiceControl.Margin = new Thickness(5); m_ChoiceControl.ApplySelection += new EventHandler(m_ChoiceControl_ApplySelection); m_ChoiceControl.SelectedItemChanged += new EventHandler <Ranet.AgOlap.Controls.General.ItemEventArgs>(m_ChoiceControl_SelectedItemChanged); // Кнопки OK и Cancel StackPanel buttonsPanel = new StackPanel() { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Right }; buttonsPanel.Margin = new Thickness(5, 0, 5, 5); OkButton = new RanetButton() { Width = 75, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 0, 10, 0) }; OkButton.Content = Localization.DialogButton_Ok; OkButton.Click += new RoutedEventHandler(OkButton_Click); buttonsPanel.Children.Add(OkButton); RanetButton CancelButton = new RanetButton() { Width = 75, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 0, 0, 0) }; CancelButton.Content = Localization.DialogButton_Cancel; CancelButton.Click += new RoutedEventHandler(CancelButton_Click); buttonsPanel.Children.Add(CancelButton); PopUpLayoutRoot.Children.Add(m_ChoiceControl); PopUpLayoutRoot.Children.Add(buttonsPanel); Grid.SetRow(buttonsPanel, 1); m_Dialog.SetContent(PopUpLayoutRoot); m_Dialog.DialogClosed += new EventHandler <DialogResultArgs>(m_Dialog_DialogClosed); m_Dialog.Width = 500; m_Dialog.Height = 400; UpdateButtonsState(); }
public MeasureChoiceDialog() { m_Dialog = new FloatingDialog(); m_Dialog.Caption = Localization.MeasureChoice_Caption + "..."; Grid PopUpLayoutRoot = new Grid(); PopUpLayoutRoot.RowDefinitions.Add(new RowDefinition() { }); PopUpLayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); // Контрол выбора m_ChoiceControl = new MeasureChoiceCtrl(); m_ChoiceControl.Margin = new Thickness(5); m_ChoiceControl.ApplySelection += new EventHandler(m_ChoiceControl_ApplySelection); m_ChoiceControl.SelectedItemChanged += new EventHandler<Ranet.AgOlap.Controls.General.ItemEventArgs>(m_ChoiceControl_SelectedItemChanged); // Кнопки OK и Cancel StackPanel buttonsPanel = new StackPanel() { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Right }; buttonsPanel.Margin = new Thickness(5, 0, 5, 5); OkButton = new RanetButton() { Width = 75, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 0, 10, 0) }; OkButton.Content = Localization.DialogButton_Ok; OkButton.Click += new RoutedEventHandler(OkButton_Click); buttonsPanel.Children.Add(OkButton); RanetButton CancelButton = new RanetButton() { Width = 75, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 0, 0, 0) }; CancelButton.Content = Localization.DialogButton_Cancel; CancelButton.Click += new RoutedEventHandler(CancelButton_Click); buttonsPanel.Children.Add(CancelButton); PopUpLayoutRoot.Children.Add(m_ChoiceControl); PopUpLayoutRoot.Children.Add(buttonsPanel); Grid.SetRow(buttonsPanel, 1); m_Dialog.SetContent(PopUpLayoutRoot); m_Dialog.DialogClosed += new EventHandler<DialogResultArgs>(m_Dialog_DialogClosed); m_Dialog.Width = 500; m_Dialog.Height = 400; UpdateButtonsState(); }