示例#1
0
        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 MemberChoiceDialog()
        {
            m_Dialog         = new FloatingDialog();
            m_Dialog.Caption = Localization.MemberChoice_Caption + "...";

            Grid LayoutRoot = new Grid();

            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
            });
            LayoutRoot.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });

            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);

            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);

            ContentRoot        = new Grid();
            ContentRoot.Margin = new Thickness(5);
            LayoutRoot.Children.Add(ContentRoot);
            LayoutRoot.Children.Add(buttonsPanel);
            Grid.SetRow(buttonsPanel, 1);

            m_ChoiceControl = new MemberChoiceControl();
            m_ChoiceControl.ApplySelection += new EventHandler(m_ChoiceControl_ApplySelection);
            //m_ChoiceControl.CancelSelection += new EventHandler(m_ChoiceControl_CancelSelection);
            m_ChoiceControl.MultiSelect = false;
            ContentRoot.Children.Add(m_ChoiceControl);

            m_Dialog.SetContent(LayoutRoot);
            m_Dialog.DialogClosed += new EventHandler <DialogResultArgs>(m_Dialog_DialogClosed);
            m_Dialog.Width         = 500;
            m_Dialog.Height        = 400;
        }
示例#3
0
        public PropertiesDialog()
        {
            Dlg           = new FloatingDialog();
            Dlg.MinHeight = 150;
            Dlg.MinWidth  = 200;

            Dlg.Height = 300;
            Dlg.Width  = 400;

            Dlg.Caption = Localization.PropertiesDialog_Caption;

            Grid container = new Grid();

            container.Margin = new Thickness(5, 5, 5, 5);
            container.RowDefinitions.Add(new RowDefinition());
            container.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });

            PropertiesControl = new PropertiesControl();
            container.Children.Add(PropertiesControl);

            // Кнопки диалога
            StackPanel buttonsPanel = new StackPanel()
            {
                Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Right
            };

            container.Children.Add(buttonsPanel);
            Grid.SetRow(buttonsPanel, 3);
            RanetButton OkButton = new RanetButton()
            {
                Width = 70, Height = 22, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 5, 0, 0)
            };

            OkButton.Content = "OK";
            OkButton.Click  += (ev_sender, args) => { Dlg.Close(); };
            buttonsPanel.Children.Add(OkButton);

            Dlg.SetContent(container);
        }