private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Id Grid
            Grid grid_id = new Grid();
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_id, 0, 0);

            ////////
            // Id
            TextBlock textBlock_id =
                new TextBlock()
                {
                    VerticalAlignment = VerticalAlignment.Center,
                    Text = (ItemId.HasValue) ? ItemId.ToString() : "NewItem"
                };
            Label label_id = new Label() { Content = "Id:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_id.SetGridRowColumn(textBlock_id, 0, 1);
            grid_id.SetGridRowColumn(label_id, 0, 0);

            ////////
            // Item Grid
            Grid grid_name = new Grid();
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_name, 1, 0);

            ////////
            // Item
            m_textBox_name = new TextBox() { VerticalAlignment = VerticalAlignment.Center, Text = ItemName };
            m_textBox_name.TextChanged += TextBox_Name_TextChanged;
            Label label_name = new Label() { Content = "Item:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_name.SetGridRowColumn(m_textBox_name, 1, 0);
            grid_name.SetGridRowColumn(label_name, 0, 0);

            ////////
            // Description Grid
            Grid grid_description = new Grid();
            grid_description.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_description.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_description, 2, 0);

            ////////
            // Description
            m_textBox_description = new TextBox() { VerticalAlignment = VerticalAlignment.Center, Text = ItemDescription };
            m_textBox_description.TextChanged += TextBox_Description_TextChanged;
            Label label_description = new Label() { Content = "Description:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_description.SetGridRowColumn(m_textBox_description, 0, 1);
            grid_description.SetGridRowColumn(label_description, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }
        private void EncapsulateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            Grid grid_buttons = new Grid();
            grid_buttons.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50.0, GridUnitType.Star) });
            grid_buttons.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_buttons, 1, 0);

            Button button_accept = new Button() { Content = "Accept" };
            button_accept.Click += (sender, args) => { Accepted = true; Close(); };
            grid_buttons.SetGridRowColumn(button_accept, 0, 0);

            Button button_cancel = new Button() { Content = "Cancel" };
            button_cancel.Click += (sender, args) => { Close(); };
            grid_buttons.SetGridRowColumn(button_cancel, 0, 1);

            UIElement thatContent = Content as UIElement;
            Content = null;
            if(thatContent != null)
                grid_main.SetGridRowColumn(thatContent, 0, 0);
            Content = grid_main;
        }
        public UIElement CreateContent(string fileName)
        {
            Grid grid_main = new Grid();
            grid_main.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(100.0, GridUnitType.Star) });
            grid_main.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });

            m_textBox_fileName = new TextBox();
            m_textBox_fileName.TextChanged += (sender, args) => { FileName = m_textBox_fileName.Text; };
            m_textBox_fileName.Text = fileName;
            grid_main.SetGridRowColumn(m_textBox_fileName, 0, 0);

            Button button_openFile = new Button() { Content = "Select file ..." };
            button_openFile.Click += (x, y) =>
                {
                    System.Windows.Forms.OpenFileDialog openFileDialog =
                        new System.Windows.Forms.OpenFileDialog()
                        {
                            CheckFileExists = false,
                            CheckPathExists = true
                        };
                    if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        m_textBox_fileName.Text = openFileDialog.FileName;
                };
            grid_main.SetGridRowColumn(button_openFile, 0, 1);

            return grid_main;
        }
        public UIElement CreateContent(string directoryName)
        {
            Grid grid_main = new Grid();
            grid_main.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(100.0, GridUnitType.Star) });
            grid_main.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });

            m_textBox_directoryName = new TextBox();
            m_textBox_directoryName.TextChanged += (sender, args) => { DirectoryName = m_textBox_directoryName.Text; };
            m_textBox_directoryName.Text = directoryName;
            grid_main.SetGridRowColumn(m_textBox_directoryName, 0, 0);

            Button button_openFile = new Button() { Content = "Select directory ..." };
            button_openFile.Click += (x, y) =>
                {
                    System.Windows.Forms.FolderBrowserDialog selectDirectoryDialog =
                        new System.Windows.Forms.FolderBrowserDialog()
                        {
                            SelectedPath = directoryName
                        };
                    if (selectDirectoryDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        m_textBox_directoryName.Text = selectDirectoryDialog.SelectedPath;
                };
            grid_main.SetGridRowColumn(button_openFile, 0, 1);

            return grid_main;
        }
        private void CreateControls()
        {
            Grid userControl_main = new Grid();
            userControl_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            userControl_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });

            userControl_main.SetGridRowColumn(c_button_newMessageChoiceResult, 0, 0);

            m_stackPanel_messageChoiceResults = new StackPanel() { Orientation = Orientation.Vertical };
            userControl_main.SetGridRowColumn(m_stackPanel_messageChoiceResults, 1, 0);

            Content = userControl_main;
        }
        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // TextBlock
            m_textBlock_roomPreview = new TextBlock() { TextWrapping = TextWrapping.Wrap, Text = string.Empty };
            m_textBlock_roomPreview.MouseLeftButtonDown += TextBlock_RoomPreview_MouseLeftButtonDown;
            m_textBlock_roomPreview.Visibility = System.Windows.Visibility.Collapsed;
            grid_main.SetGridRowColumn(m_textBlock_roomPreview, 0, 0);

            ////////
            // TextBox
            m_textBox_roomPreview = new TextBox() { TextWrapping = TextWrapping.Wrap };
            grid_main.SetGridRowColumn(m_textBox_roomPreview, 0, 0);

            ////////
            // Button
            Button button_loadPreview = new Button() { Content = "Load Preview" };
            button_loadPreview.Click += Button_LoadPreview_Click;
            grid_main.SetGridRowColumn(button_loadPreview, 1, 0);

            ////////
            // Fin
            Content = grid_main;
        }
        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });

            m_comboBox_location = new ComboBox_Location();
            m_comboBox_location.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_location.SelectionChanged += ComboBox_Location_SelectionChanged;
            grid_main.SetGridRowColumn(m_comboBox_location, 0, 0);

            m_image_locationFile = new Image();
            m_image_locationFile.Drop += Image_LocationFile_Drop;
            grid_main.SetGridRowColumn(m_image_locationFile, 1, 0);

            Content = grid_main;
        }
        private UIElement CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            m_grid_location = new UserControl_Location(true);
            grid_main.SetGridRowColumn(m_grid_location, 0, 0);

            Button button_automaticUpsert = new Button() { Content = "Automatic Upsert" };
            button_automaticUpsert.Click += (x, y) =>
            {
                AutomaticUpsert();
            };
            grid_main.SetGridRowColumn(button_automaticUpsert, 1, 0);

            return grid_main;
        }
        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // TextBox
            m_textBox_roomAuthoring = new TextBox() { TextWrapping = TextWrapping.Wrap };
            grid_main.SetGridRowColumn(m_textBox_roomAuthoring, 0, 0);

            ////////
            // Button
            m_button_generateParagraphs = new Button() { Content = "Generate Paragraphs" };
            m_button_generateParagraphs.Click += Button_GenerateParagraphs_Click;
            grid_main.SetGridRowColumn(m_button_generateParagraphs, 1, 0);

            ////////
            // Fin
            Content = grid_main;
        }
        private UIElement CreateControls()
        {
            m_grid_main = new Grid();
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });

            m_comboBox_character = new ComboBox_Character();
            m_comboBox_character.SetActiveAndRegisterForGinTubEvents();
            m_comboBox_character.SelectionChanged += ComboBox_Event_SelectionChanged;
            m_grid_main.SetGridRowColumn(m_comboBox_character, 0, 0);

            return m_grid_main;
        }
        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Name Grid
            Grid grid_name = new Grid();
            grid_name.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_name.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_name, 0, 0);

            ////////
            // Name
            m_textBlock_name = new TextBlock() { VerticalAlignment = VerticalAlignment.Center };
            Label label_name = new Label() { Content = "RoomState Name:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_name.SetGridRowColumn(m_textBlock_name, 0, 1);
            grid_name.SetGridRowColumn(label_name, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }
        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Id Grid
            Grid grid_id = new Grid();
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_id, 0, 0);

            ////////
            // Id
            TextBlock textBlock_id =
                new TextBlock()
                {
                    VerticalAlignment = VerticalAlignment.Center,
                    Text = (AreaId.HasValue) ? AreaId.ToString() : "NewArea"
                };
            Label label_id = new Label() { Content = "Id:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_id.SetGridRowColumn(textBlock_id, 0, 1);
            grid_id.SetGridRowColumn(label_id, 0, 0);

            ////////
            // Name Grid
            Grid grid_name = new Grid();
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_name, 1, 0);

            ////////
            // Name
            m_textBox_name = new TextBox();
            m_textBox_name.TextChanged += TextBox_Name_TextChanged;
            Label label_name = new Label() { Content = "Name:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_name.SetGridRowColumn(m_textBox_name, 1, 0);
            grid_name.SetGridRowColumn(label_name, 0, 0);

            ////////
            // DisplayTime Grid
            Grid grid_displayTime = new Grid();
            grid_displayTime.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_displayTime.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_displayTime, 2, 0);

            ////////
            // DisplayTime
            m_checkBox_displayTime = new CheckBox() { IsChecked = AreaDisplayTime, VerticalAlignment = System.Windows.VerticalAlignment.Center };
            m_checkBox_displayTime.Checked += CheckBox_DisplayTime_Checked;
            Label label_displayTime = new Label() { Content = "Display Time?", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_displayTime.SetGridRowColumn(m_checkBox_displayTime, 0, 1);
            grid_displayTime.SetGridRowColumn(label_displayTime, 0, 0);

            ////////
            // Audio Grid
            Grid grid_audio = new Grid();
            grid_audio.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_audio.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_audio, 3, 0);

            ////////
            // Audio
            m_textBox_audio = new TextBox();
            m_textBox_audio.TextChanged += TextBox_Name_TextChanged;
            Label label_audio = new Label() { Content = "Audio:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_audio.SetGridRowColumn(m_textBox_audio, 1, 0);
            grid_audio.SetGridRowColumn(label_audio, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }
        private void CreateControls()
        {
            m_grid_main = new Grid();
            m_grid_main.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50.0, GridUnitType.Star) });
            m_grid_main.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50.0, GridUnitType.Star) });

            m_comboBox_verbType =
                new ComboBox_VerbType()
                {
                    VerticalAlignment = System.Windows.VerticalAlignment.Top
                };
            m_comboBox_verbType.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_verbType.SelectionChanged += ComboBox_VerbType_SelectionChanged;
            m_grid_main.SetGridRowColumn(m_comboBox_verbType, 0, 0);

            ////////
            // Fin
            Content = m_grid_main;
        }
        private void CreateControls(int? paragraphStateId, string paragraphStateText, int? paragraphStateState, int paragraphId)
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            Button button_modifyParagraphState = new Button() { Content = "Modify Paragraph State" };
            button_modifyParagraphState.Click += Button_UpdateParagraphState_Click;
            grid_main.SetGridRowColumn(button_modifyParagraphState, 0, 0);

            m_userControl_paragraphState = new UserControl_ParagraphState(paragraphStateId, paragraphStateText, paragraphStateState, paragraphId, false, true);
            Border border_paragraphState = new Border() { Style = new Style_DefaultBorder() };
            border_paragraphState.Child = m_userControl_paragraphState;
            grid_main.SetGridRowColumn(border_paragraphState, 1, 0);
            m_userControl_paragraphState.SetActiveAndRegisterForGinTubEvents();

            Border border = new Border() { Style = new Style_DefaultBorder(), Child = grid_main };
            Content = border;
        }
        private void CreateControls()
        {
            m_grid_main = new Grid();
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });

            ////////
            // Add paragraph
            Button button_addParagraph = new Button() { Content = "New Paragraph ..." };
            button_addParagraph.Click += Button_CreateParagraph_Click;
            m_grid_main.SetGridRowColumn(button_addParagraph, 0, 0);

            ////////
            // Paragraph RoomStates
            m_button_selectParagraphRoomStates = new Button() { Content = "Select Paragraph RoomStates", IsEnabled = false };
            m_button_selectParagraphRoomStates.Click += Button_SelectParagraphRoomStates_Click;
            m_grid_main.SetGridRowColumn(m_button_selectParagraphRoomStates, 1, 0);

            ////////
            // Paragraphs
            m_button_modifyParagraph = new Button() { Content = "Modify Paragraph", IsEnabled = false };
            m_button_modifyParagraph.Click += Button_UpdateParagraph_Click;
            m_grid_main.SetGridRowColumn(m_button_modifyParagraph, 2, 0);

            m_stackPanel_paragraphs = new StackPanel() { Orientation = Orientation.Vertical };
            ScrollViewer scrollViewer_paragraphs =
                new ScrollViewer()
                {
                    VerticalScrollBarVisibility = ScrollBarVisibility.Visible
                };
            scrollViewer_paragraphs.Content = m_stackPanel_paragraphs;
            m_grid_main.SetGridRowColumn(scrollViewer_paragraphs, 3, 0);

            ////////
            // Fin
            Content = m_grid_main;
        }
        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Id Grid
            Grid grid_id = new Grid();
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_id, 0, 0);

            ////////
            // Id
            TextBlock textBlock_id =
                new TextBlock()
                {
                    VerticalAlignment = VerticalAlignment.Center,
                    Text = (ActionResultId.HasValue) ? ActionResultId.ToString() : "NewActionResult"
                };
            Label label_id = new Label() { Content = "Id:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_id.SetGridRowColumn(textBlock_id, 0, 1);
            grid_id.SetGridRowColumn(label_id, 0, 0);

            ////////
            // Result Grid
            Grid grid_result = new Grid();
            grid_result.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_result.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_result, 1, 0);

            ////////
            // Result
            m_comboBox_result = new ComboBox_Result();
            m_comboBox_result.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_result.SelectionChanged += ComboBox_Result_SelectionChanged;
            Label label_result = new Label() { Content = "Result:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_result.SetGridRowColumn(m_comboBox_result, 1, 0);
            grid_result.SetGridRowColumn(label_result, 0, 0);

            ////////
            // Action Grid
            Grid grid_action = new Grid();
            grid_action.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_action.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_action, 2, 0);

            ////////
            // Action
            m_comboBox_action = new ComboBox_Action(NounId, ParagraphStateId);
            m_comboBox_action.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_action.SelectionChanged += ComboBox_Action_SelectionChanged;
            Label label_action = new Label() { Content = "Action:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_action.SetGridRowColumn(m_comboBox_action, 1, 0);
            grid_action.SetGridRowColumn(label_action, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }
        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Id Grid
            Grid grid_id = new Grid();
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_id, 0, 0);

            ////////
            // Id
            TextBlock textBlock_id =
                new TextBlock()
                {
                    VerticalAlignment = VerticalAlignment.Center,
                    Text = (ParagraphId.HasValue) ? ParagraphId.ToString() : "NewParagraph"
                };
            Label label_id = new Label() { Content = "Id:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_id.SetGridRowColumn(textBlock_id, 0, 1);
            grid_id.SetGridRowColumn(label_id, 0, 0);

            ////////
            // Order Grid
            Grid grid_order = new Grid();
            grid_order.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_order.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_order, 1, 0);

            ////////
            // Order
            m_textBox_order = new TextBox() { VerticalAlignment = VerticalAlignment.Center };
            m_textBox_order.TextChanged += TextBox_Order_TextChanged;
            m_textBox_order.Text = (ParagraphOrder.HasValue) ? ParagraphOrder.ToString() : "0";
            Label label_order = new Label() { Content = "Order:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_order.SetGridRowColumn(m_textBox_order, 0, 1);
            grid_order.SetGridRowColumn(label_order, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }
        private void CreateControls(int roomStateId, int roomStateState, TimeSpan? roomStateTime, int locationId, int roomId)
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            Button button_modifyRoomState = new Button() { Content = "Modify Room State" };
            button_modifyRoomState.Click += Button_UpdateRoomState_Click;
            grid_main.SetGridRowColumn(button_modifyRoomState, 0, 0);

            m_userControl_roomState = new UserControl_RoomState(roomStateId, roomStateState, roomStateTime, locationId, roomId, false);
            Border border_roomState = new Border() { Style = new Style_DefaultBorder() };
            border_roomState.Child = m_userControl_roomState;
            grid_main.SetGridRowColumn(border_roomState, 1, 0);
            m_userControl_roomState.SetActiveAndRegisterForGinTubEvents();

            Border border = new Border() { Style = new Style_DefaultBorder(), Child = grid_main };
            Content = border;
        }
        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Id Grid
            Grid grid_id = new Grid();
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_id, 0, 0);

            ////////
            // Id
            TextBlock textBlock_id =
                new TextBlock()
                {
                    VerticalAlignment = VerticalAlignment.Center,
                    Text = (MessageChoiceId.HasValue) ? MessageChoiceId.ToString() : "NewMessageChoice"
                };
            Label label_id = new Label() { Content = "Id:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_id.SetGridRowColumn(textBlock_id, 0, 1);
            grid_id.SetGridRowColumn(label_id, 0, 0);

            ////////
            // Name Grid
            Grid grid_name = new Grid();
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_name, 1, 0);

            ////////
            // Name
            m_textBox_name = new TextBox() { VerticalAlignment = VerticalAlignment.Center, Text = MessageChoiceName };
            m_textBox_name.TextChanged += TextBox_Name_TextChanged;
            Label label_name = new Label() { Content = "Name:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_name.SetGridRowColumn(m_textBox_name, 1, 0);
            grid_name.SetGridRowColumn(label_name, 0, 0);

            ////////
            // Text Grid
            Grid grid_text = new Grid();
            grid_text.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_text.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_text, 2, 0);

            ////////
            // Text
            m_textBox_text = new TextBox() { VerticalAlignment = VerticalAlignment.Center, Text = MessageChoiceText };
            m_textBox_text.TextChanged += TextBox_Text_TextChanged;
            Label label_text = new Label() { Content = "Text:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_text.SetGridRowColumn(m_textBox_text, 0, 1);
            grid_text.SetGridRowColumn(label_text, 0, 0);

            ////////
            // Message Grid
            Grid grid_message = new Grid();
            grid_message.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_message.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_message, 3, 0);

            ////////
            // Message
            m_comboBox_message = new ComboBox_Message();
            m_comboBox_message.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_message.SelectionChanged += ComboBox_Message_SelectionChanged;
            Label label_message = new Label() { Content = "Message:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_message.SetGridRowColumn(m_comboBox_message, 1, 0);
            grid_message.SetGridRowColumn(label_message, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }
        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Id Grid
            Grid grid_id = new Grid();
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_id, 0, 0);

            ////////
            // Id
            TextBlock textBlock_id =
                new TextBlock()
                {
                    VerticalAlignment = VerticalAlignment.Center,
                    Text = (ActionId.HasValue) ? ActionId.ToString() : "NewAction"
                };
            Label label_id = new Label() { Content = "Id:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_id.SetGridRowColumn(textBlock_id, 0, 1);
            grid_id.SetGridRowColumn(label_id, 0, 0);

            ////////
            // VerbType Grid
            Grid grid_verbType = new Grid();
            grid_verbType.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_verbType.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_verbType, 1, 0);

            ////////
            // VerbType
            m_comboBox_verbType = new ComboBox_VerbType();
            m_comboBox_verbType.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_verbType.SelectionChanged += ComboBox_VerbType_SelectionChanged;
            Label label_verbType = new Label() { Content = "Verb Type:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_verbType.SetGridRowColumn(m_comboBox_verbType, 1, 0);
            grid_verbType.SetGridRowColumn(label_verbType, 0, 0);

            ////////
            // Noun Grid
            Grid grid_noun = new Grid();
            grid_noun.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_noun.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_noun, 2, 0);

            ////////
            // Noun
            m_comboBox_noun = new ComboBox_Noun(ParagraphStateId);
            m_comboBox_noun.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_noun.SelectionChanged += ComboBox_Noun_SelectionChanged;
            Label label_noun = new Label() { Content = "Noun:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_noun.SetGridRowColumn(m_comboBox_noun, 1, 0);
            grid_noun.SetGridRowColumn(label_noun, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }
        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Id Grid
            Grid grid_id = new Grid();
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_id, 0, 0);

            ////////
            // Id
            TextBlock textBlock_id =
                new TextBlock()
                {
                    VerticalAlignment = VerticalAlignment.Center,
                    Text = (ResultTypeJSONPropertyId.HasValue) ? ResultTypeJSONPropertyId.ToString() : "NewResultTypeJSONProperty"
                };
            Label label_id = new Label() { Content = "Id:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_id.SetGridRowColumn(textBlock_id, 0, 1);
            grid_id.SetGridRowColumn(label_id, 0, 0);

            ////////
            // Property Grid
            Grid grid_field = new Grid();
            grid_field.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_field.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_field, 1, 0);

            ////////
            // Property
            m_textBox_jsonProperty = new TextBox() { VerticalAlignment = VerticalAlignment.Center, Text = ResultTypeJSONPropertyJSONProperty };
            m_textBox_jsonProperty.TextChanged += TextBox_JSONProperty_TextChanged;
            Label jsonProperty = new Label() { Content = "Field:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_field.SetGridRowColumn(m_textBox_jsonProperty, 1, 0);
            grid_field.SetGridRowColumn(jsonProperty, 0, 0);

            ////////
            // DataType Grid
            Grid grid_dataType = new Grid();
            grid_dataType.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_dataType.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_dataType, 2, 0);

            ////////
            // DataType
            m_comboBox_dataType = new ComboBox_JSONPropertyDataType();
            m_comboBox_dataType.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_dataType.SelectionChanged += ComboBox_DataType_SelectionChanged;
            SetDataType(ResultTypeJSONPropertyDataType);
            Label label_dataType = new Label() { Content = "Data Type:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_dataType.SetGridRowColumn(m_comboBox_dataType, 0, 1);
            grid_dataType.SetGridRowColumn(label_dataType, 0, 0);

            ////////
            // ResultType Grid
            Grid grid_resultType = new Grid();
            grid_resultType.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_resultType.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_resultType, 3, 0);

            ////////
            // ResultType
            m_comboBox_resultType = new ComboBox_ResultType();
            m_comboBox_resultType.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_resultType.SelectionChanged += ComboBox_ResultType_SelectionChanged;
            SetResultTypeId(ResultTypeId);
            Label label_resultType = new Label() { Content = "Result Type:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_resultType.SetGridRowColumn(m_comboBox_resultType, 0, 1);
            grid_resultType.SetGridRowColumn(label_resultType, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }
        private void CreateControls(int? verbId, string verbName, int verbTypeId)
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            Button button_modifyVerb = new Button() { Content = "Modify Verb" };
            button_modifyVerb.Click += Button_UpdateVerb_Click;
            grid_main.SetGridRowColumn(button_modifyVerb, 0, 0);

            m_userControl_verb = new UserControl_Verb(verbId, verbName, verbTypeId, false);
            grid_main.SetGridRowColumn(m_userControl_verb, 1, 0);
            m_userControl_verb.SetActiveAndRegisterForGinTubEvents();

            Border border = new Border() { Style = new Style_DefaultBorder(), Child = grid_main };
            Content = border;
        }
        private void CreateControls(int? actionResultId, int actionResultResult, int actionResultAction)
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            Button button_modifyActionResult = new Button() { Content = "Modify ActionResult" };
            button_modifyActionResult.Click += Button_UpdateActionResult_Click;
            grid_main.SetGridRowColumn(button_modifyActionResult, 0, 0);

            m_userControl_actionResult = new UserControl_ActionResult(actionResultId, actionResultResult, actionResultAction, NounId, ParagraphStateId, false);
            Border border_actionResult = new Border() { Style = new Style_DefaultBorder() };
            border_actionResult.Child = m_userControl_actionResult;
            grid_main.SetGridRowColumn(border_actionResult, 1, 0);
            m_userControl_actionResult.SetActiveAndRegisterForGinTubEvents();

            Border border = new Border() { Style = new Style_DefaultBorder(), Child = grid_main };
            Content = border;
        }
        private void CreateControls(int? messageChoiceId, string messageChoiceName, string messageChoiceText, int messageId)
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            Button button_modifyMessageChoice = new Button() { Content = "Modify MessageChoice" };
            button_modifyMessageChoice.Click += Button_UpdateMessageChoice_Click;
            grid_main.SetGridRowColumn(button_modifyMessageChoice, 0, 0);

            m_userControl_messageChoice = new UserControl_MessageChoice(messageChoiceId, messageChoiceName, messageChoiceText, messageId, false, true);
            grid_main.SetGridRowColumn(m_userControl_messageChoice, 1, 0);
            m_userControl_messageChoice.SetActiveAndRegisterForGinTubEvents();

            Border border = new Border() { Style = new Style_DefaultBorder(), Child = grid_main };
            Content = border;
        }
        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Area Grid
            Grid grid_area = new Grid();
            grid_area.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_area.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_area, 0, 0);

            ////////
            // Area
            m_comboBox_area = new ComboBox_Area();
            m_comboBox_area.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_area.SelectionChanged += ComboBox_Area_SelectionChanged;
            Label label_area = new Label() { Content = "Area:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_area.SetGridRowColumn(m_comboBox_area, 1, 0);
            grid_area.SetGridRowColumn(label_area, 0, 0);

            ////////
            // Room
            m_groupBox_room = new GroupBox() { Header = "Room:" };
            grid_main.SetGridRowColumn(m_groupBox_room, 1, 0);

            ////////
            // Time
            m_userControl_timeSpan = new UserControl_TimeSpan(GameStateOnInitialLoadTime);
            grid_main.SetGridRowColumn(m_userControl_timeSpan, 2, 0);
            m_userControl_timeSpan.TimeChangedEvent += UserControl_TimeSpan_TimeChanged;

            ////////
            // Fin
            Content = grid_main;
        }
        private void CreateControls()
        {
            m_grid_main = new Grid();
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });

            ////////
            // Add Noun
            Button button_addNoun = new Button() { Content = "New Noun ..." };
            button_addNoun.Click += Button_CreateNoun_Click;
            m_grid_main.SetGridRowColumn(button_addNoun, 0, 0);

            ////////
            // Nouns
            m_button_modifyNoun = new Button() { Content = "Modify Noun", IsEnabled = false };
            m_button_modifyNoun.Click += Button_UpdateNoun_Click;
            m_grid_main.SetGridRowColumn(m_button_modifyNoun, 1, 0);

            m_stackPanel_nouns = new StackPanel() { Orientation = Orientation.Vertical };
            ScrollViewer scrollViewer_nouns =
                new ScrollViewer()
                {
                    VerticalScrollBarVisibility = ScrollBarVisibility.Visible
                };
            scrollViewer_nouns.Content = m_stackPanel_nouns;
            m_grid_main.SetGridRowColumn(scrollViewer_nouns, 2, 0);

            ////////
            // Fin
            Content = m_grid_main;
        }
        private void CreateControls(
            int? resultTypeJSONPropertyId, 
            string resultTypeJSONPropertyJSONProperty, 
            int? resultTypeJSONPropertyDataType,
            int resultTypeId
        )
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            Button button_modifyResultTypeJSONProperty = new Button() { Content = "Modify ResultTypeJSONProperty" };
            button_modifyResultTypeJSONProperty.Click += Button_UpdateResultTypeJSONProperty_Click;
            grid_main.SetGridRowColumn(button_modifyResultTypeJSONProperty, 0, 0);

            m_userControl_resultTypeJSONProperty =
                new UserControl_ResultTypeJSONProperty
                (
                    resultTypeJSONPropertyId,
                    resultTypeJSONPropertyJSONProperty,
                    resultTypeJSONPropertyDataType,
                    resultTypeId,
                    false
                );
            grid_main.SetGridRowColumn(m_userControl_resultTypeJSONProperty, 1, 0);
            m_userControl_resultTypeJSONProperty.SetActiveAndRegisterForGinTubEvents();

            Border border = new Border() { Style = new Style_DefaultBorder(), Child = grid_main };
            Content = border;
        }
Пример #28
0
        private UIElement CreateControls()
        {
            m_grid_main = new Grid();
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });

            ////////
            // Area
            Label label_area = new Label() { Content = "Area:\t", FontWeight = FontWeights.Bold };

            m_comboBox_areas = new ComboBox();
            m_comboBox_areas.Items.Add(c_comboBoxItem_newArea);
            m_comboBox_areas.SelectedItem = null;

            StackPanel stackPanel_area = new StackPanel() { Orientation = Orientation.Horizontal };
            stackPanel_area.Children.Add(label_area);
            stackPanel_area.Children.Add(m_comboBox_areas);
            m_grid_main.SetGridRowColumn(stackPanel_area, 0, 0);

            ////////
            // Floor
            Label label_z = new Label() { Content = "Floor:\t", FontWeight = FontWeights.Bold };

            m_comboBox_z = new ComboBox();
            m_comboBox_z.SelectionChanged += ComboBox_Z_SelectionChanged;

            StackPanel stackPanel_z = new StackPanel() { Orientation = Orientation.Horizontal };
            stackPanel_z.Children.Add(label_z);
            stackPanel_z.Children.Add(m_comboBox_z);
            m_grid_main.SetGridRowColumn(stackPanel_z, 1, 0);

            ////////
            // Rooms Grid
            m_grid_sub = new Grid();
            m_grid_sub.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(200.0, GridUnitType.Pixel) });
            m_grid_sub.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(5.0, GridUnitType.Pixel) });
            m_grid_sub.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(140.0, GridUnitType.Pixel) });
            m_grid_sub.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(5.0, GridUnitType.Pixel) });
            m_grid_sub.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(100.0, GridUnitType.Star) });
            m_grid_sub.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(5.0, GridUnitType.Pixel) });
            m_grid_sub.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(100.0, GridUnitType.Star) });
            m_grid_sub.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(5.0, GridUnitType.Pixel) });
            m_grid_sub.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(100.0, GridUnitType.Star) });
            m_grid_sub.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(5.0, GridUnitType.Pixel) });
            m_grid_sub.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(100.0, GridUnitType.Star) });
            m_grid_main.SetGridRowColumn(m_grid_sub, 2, 0);

            Rectangle rectangle_roomsOnFloor = new Rectangle() { Fill = Brushes.Lavender };
            m_grid_sub.SetGridRowColumn(rectangle_roomsOnFloor, 0, 0);

            GridSplitter gridSplitter = new GridSplitter() { Width = 5, HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, Background = Brushes.Black };
            m_grid_sub.SetGridRowColumn(gridSplitter, 0, 1);
            GridSplitter gridSplitter2 = new GridSplitter() { Width = 5, HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, Background = Brushes.Black };
            m_grid_sub.SetGridRowColumn(gridSplitter2, 0, 3);
            GridSplitter gridSplitter3 = new GridSplitter() { Width = 5, HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, Background = Brushes.Black };
            m_grid_sub.SetGridRowColumn(gridSplitter3, 0, 5);
            GridSplitter gridSplitter4 = new GridSplitter() { Width = 5, HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, Background = Brushes.Black };
            m_grid_sub.SetGridRowColumn(gridSplitter4, 0, 7);
            GridSplitter gridSplitter5 = new GridSplitter() { Width = 5, HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, Background = Brushes.Black };
            m_grid_sub.SetGridRowColumn(gridSplitter5, 0, 9);

            return m_grid_main;
        }
        private void CreateControls(int roomId, string roomName, int roomX, int roomY, int roomZ, int areaId)
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });

            ////////
            // Room
            m_button_roomAuthoring = new Button() { Content = "Room Authoring" };
            m_button_roomAuthoring.Click += Button_RoomAuthoring_Click;
            grid_main.SetGridRowColumn(m_button_roomAuthoring, 0, 0);

            Button button_roomPreview = new Button() { Content = "View Room Preview" };
            button_roomPreview.Click += Button_RoomPreview_Click;
            grid_main.SetGridRowColumn(button_roomPreview, 1, 0);

            Button button_modifyRoom = new Button() { Content = "Modify Room" };
            button_modifyRoom.Click += Button_UpdateRoom_Click;
            grid_main.SetGridRowColumn(button_modifyRoom, 2, 0);

            m_grid_rooms = new UserControl_Bordered_Room(roomId, roomName, roomX, roomY, roomZ, areaId, false);
            grid_main.SetGridRowColumn(m_grid_rooms, 3, 0);
            m_grid_rooms.SetActiveAndRegisterForGinTubEvents();

            ////////
            // RoomStates
            Button button_addRoomState = new Button() { Content = "New Room State ..." };
            button_addRoomState.Click += Button_CreateRoomState_Click;
            grid_main.SetGridRowColumn(button_addRoomState, 4, 0);

            m_stackPanel_roomStates = new StackPanel() { Orientation = Orientation.Vertical };

            ScrollViewer scrollViewer_roomStates =
                new ScrollViewer()
                {
                    HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden,
                    VerticalScrollBarVisibility = ScrollBarVisibility.Visible
                };
            scrollViewer_roomStates.Content = m_stackPanel_roomStates;
            grid_main.SetGridRowColumn(scrollViewer_roomStates, 5, 0);

            Content = grid_main;
        }
        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Id Grid
            Grid grid_id = new Grid();
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_id, 0, 0);

            ////////
            // Id
            TextBlock textBlock_id =
                new TextBlock()
                {
                    VerticalAlignment = VerticalAlignment.Center,
                    Text = (ResultId.HasValue) ? ResultId.ToString() : "NewResult"
                };
            Label label_id = new Label() { Content = "Id:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_id.SetGridRowColumn(textBlock_id, 0, 1);
            grid_id.SetGridRowColumn(label_id, 0, 0);

            ////////
            // Name Grid
            Grid grid_name = new Grid();
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_name, 1, 0);

            ////////
            // Name
            m_textBox_name = new TextBox() { VerticalAlignment = VerticalAlignment.Center, Text = ResultName };
            m_textBox_name.TextChanged += TextBox_Name_TextChanged;
            Label label_name = new Label() { Content = "Name:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_name.SetGridRowColumn(m_textBox_name, 1, 0);
            grid_name.SetGridRowColumn(label_name, 0, 0);

            ////////
            // JSONData Grid
            Grid grid_jsonData = new Grid();
            grid_jsonData.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_jsonData.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_jsonData, 2, 0);

            ////////
            // JSONData
            m_groupBox_jsonProperties = new GroupBox();
            Label label_jsonData = new Label() { Content = "JSONData:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_jsonData.SetGridRowColumn(m_groupBox_jsonProperties, 1, 0);
            grid_jsonData.SetGridRowColumn(label_jsonData, 0, 0);

            m_stackPanel_jsonProperties = new StackPanel() { Orientation = Orientation.Vertical };
            m_groupBox_jsonProperties.Content = m_stackPanel_jsonProperties;

            ////////
            // ResultTypeId Grid
            Grid grid_resultType = new Grid();
            grid_resultType.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_resultType.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_resultType, 3, 0);

            ////////
            // ResultTypeId
            m_comboBox_resultType = new ComboBox_ResultType() { IsEnabled = false };
            m_comboBox_resultType.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_resultType.SelectionChanged += ComboBox_ResultType_SelectionChanged;
            SetResultTypeId(ResultTypeId);
            Label label_resultType = new Label() { Content = "Result Type:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_resultType.SetGridRowColumn(m_comboBox_resultType, 0, 1);
            grid_resultType.SetGridRowColumn(label_resultType, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }