Exemplo n.º 1
0
        public CheckBox CheckBoxFactory(ControlProperties properties)
        {
            // Store properties in field:
            this.controlProperties = properties;
            // Set type:
            type = typeof(CheckBox);
            // Create new CheckBox:
            newItem = new CheckBox();

            // SET PROPERTIES:
            SetAlignmentProperties();
            SetBackgroundProperty();
            SetContentAlignmentProperties();
            SetDimensionProperties();
            SetFontProperties();
            SetGridProperties();
            SetIsCheckedProperty();
            SetIsEnabledProperty();
            SetMarginProperty();
            SetNameProperty();
            SetPaddingProperty();
            SetUidProperty();
            SetVisibilityProperty();

            return((CheckBox)newItem);
        }
Exemplo n.º 2
0
        public TextBlock TextBlockFactory(ControlProperties properties)
        {
            // Store properties in field:
            this.controlProperties = properties;
            // Set type:
            type = typeof(TextBlock);
            // Create new TextBlock:
            newItem = new TextBlock();

            // SET PROPERTIES:
            SetAlignmentProperties();
            SetBackgroundProperty();
            SetDimensionProperties();
            SetFontProperties();
            SetGridProperties();
            SetIsEnabledProperty();
            SetMarginProperty();
            SetNameProperty();
            SetPaddingProperty();
            SetTextProperties();
            SetTextWrappingProperty();
            SetUidProperty();
            SetVisibilityProperty();

            return((TextBlock)newItem);
        }
Exemplo n.º 3
0
        public TabItem TabItemFactory(ControlProperties properties)
        {
            // Store properties in field:
            this.controlProperties = properties;
            // Set type:
            type = typeof(System.Windows.Controls.TabItem);
            // Create new TabItem:
            newItem = new System.Windows.Controls.TabItem();

            // SET PROPERTIES:
            SetAlignmentProperties();
            SetBackgroundProperty();
            SetContentAlignmentProperties();
            SetDimensionProperties();
            SetFontProperties();
            SetGridProperties();
            SetHeaderProperty();
            SetIsEnabledProperty();
            SetIsSelectedProperty();
            SetMarginProperty();
            SetNameProperty();
            SetPaddingProperty();
            SetUidProperty();
            SetVisibilityProperty();

            return((TabItem)newItem);
        }
Exemplo n.º 4
0
        public ScrollViewer ScrollViewerFactory(ControlProperties properties)
        {
            // Store properties in field:
            this.controlProperties = properties;
            // Set type:
            type = typeof(ScrollViewer);
            // Create new ScrollViewer:
            newItem = new ScrollViewer();

            // SET PROPERTIES:
            SetAlignmentProperties();
            SetBackgroundProperty();
            SetContentAlignmentProperties();
            SetDimensionProperties();
            SetFontProperties();
            SetIsEnabledProperty();
            SetMarginProperty();
            SetNameProperty();
            SetPaddingProperty();
            SetScrollBarVisibilityProperties();
            SetUidProperty();
            SetVisibilityProperty();

            return((ScrollViewer)newItem);
        }
Exemplo n.º 5
0
        public ComboBox ComboBoxFactory(ControlProperties properties)
        {
            // Store properties in field:
            this.controlProperties = properties;
            // Set type:
            type = typeof(ComboBox);
            // Create new ComboBox:
            newItem = new ComboBox();

            // SET PROPERTIES:
            SetAlignmentProperties();
            SetBackgroundProperty();
            SetContentAlignmentProperties();
            SetDimensionProperties();
            SetFontProperties();
            SetGridProperties();
            SetIsEnabledProperty();
            SetMarginProperty();
            SetNameProperty();
            SetPaddingProperty();
            SetUidProperty();
            SetVisibilityProperty();

            // create ComboBoxItem as placeholder:
            if (properties.HasComboBoxPlaceholder)
            {
                var placeholder = new ComboBoxItem
                {
                    Content    = properties.ComboBoxPlaceholder,
                    IsEnabled  = false,
                    IsSelected = true
                };
                newItem.Items.Add(placeholder);
            }
            // create ComboBoxItems:
            if (!properties.HasComboBoxItems)
            {
                return((ComboBox)newItem);
            }

            foreach (string[] item_properties in properties.ComboboxItems)
            {
                ComboBoxItem item = new ComboBoxItem();
                for (int i = 0; i < item_properties.Length; i++)
                {
                    if (i == 0)
                    {
                        item.Content = item_properties[i];
                    }
                    if (i == 1)
                    {
                        item.Uid = item_properties[i];
                    }
                }
                ((ComboBox)newItem).Items.Add(item);
            }
            return((ComboBox)newItem);
        }
Exemplo n.º 6
0
        public TabItem(string header, TotoConfig.UserRole userRole, TotoConfig.GamePhase gamePhase)
        {
            this.Header = header;

            this.Name = "tab_" + header;

            ScrollViewer.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
            ScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden;

            this.Content = ScrollViewer;

            InitiateGrid();

            // add grid to scrollviewer:
            ScrollViewer.Content = MainTabGrid;

            // create title bar:
            var textBlockTitle = new TextBlock {
                Name = "txtblck_title", Text = "Titel", Background = BarColour, Height = 80
            };
            var textDecorations = new TextDecorationCollection();

            textDecorations.Add(TextDecorations.Underline);
            textDecorations.Add(TextDecorations.OverLine);
            textBlockTitle.TextDecorations = textDecorations;
            Grid.SetColumnSpan(textBlockTitle, 3);
            MainTabGrid.Children.Add(textBlockTitle);

            // create a combobox:
            string[][] cbItems =
            {
                new string[] { "Optie 1", "ID1" },
                new string[] { "Optie 2", "ID2" },
                new string[] { "Optie 3", "ID3" },
                new string[] { "Optie 4", "ID4", "hoi"}
            };
            var controlProperties = new ControlProperties
            {
                Width  = "auto",
                Height = "30",
                Name   = "my_combobox",
                ComboBoxPlaceholder = "Kies een optie...",
                ComboboxItems       = cbItems,
                Row = 1
            };
            var elementFactory = new ElementFactory();

            MainTabGrid.Children.Add(elementFactory.ComboBoxFactory(controlProperties));
        }
Exemplo n.º 7
0
        public ColumnDefinition ColumnDefinitionFactory(ControlProperties properties)
        {
            // Store properties in field:
            this.controlProperties = properties;
            // Set type:
            type = typeof(ColumnDefinition);
            // Create new ColumnDefinition:
            newItem = new ColumnDefinition();

            // SET PROPERTIES:
            SetIsEnabledProperty();
            SetNameProperty();
            SetWidthProperties();

            return((ColumnDefinition)newItem);
        }
Exemplo n.º 8
0
        public Image ImageFactory(ControlProperties properties)
        {
            // Store properties in field:
            this.controlProperties = properties;
            // Set type:
            type = typeof(Image);
            // Create new Image:
            newItem = new Image();

            // SET PROPERTIES:
            SetDimensionProperties();
            SetGridProperties();
            SetIsEnabledProperty();
            SetMarginProperty();
            SetNameProperty();
            SetSourceProperty();
            SetUidProperty();
            SetVisibilityProperty();

            return((Image)newItem);
        }
Exemplo n.º 9
0
        public DockPanel DockPanelFactory(ControlProperties properties)
        {
            // Store properties in field:
            this.controlProperties = properties;
            // Set type:
            type = typeof(DockPanel);
            // Create new DockPanel:
            newItem = new DockPanel();

            // SET PROPERTIES:
            SetAlignmentProperties();
            SetBackgroundProperty();
            SetDimensionProperties();
            SetIsEnabledProperty();
            SetMarginProperty();
            SetNameProperty();
            SetUidProperty();
            SetVisibilityProperty();

            return((DockPanel)newItem);
        }