コード例 #1
0
        /// <summary>
        /// Standard Konstrukor
        /// Bei Erstellung eines Objektes dieser Klasse müssen alle geroderten Parameter übergeben werden
        /// </summary>
        /// <param name="labelDescription">Beschreibung des Eingabefeldes. Beispiel "Vorname:"</param>
        /// <param name="placeholderText">Dieser Text wird, vor der ersten Eingabe in dem Entry Objekt angegeben.</param>
        /// <param name="backgroundColor">Die Hintergrundfarbe des Objektes</param>
        /// <param name="textColor">Die Text Farbe des Objektes</param>
        public GridForUserInputForString(string labelDescription, string placeholderText, Color backgroundColor, Color textColor)
        {
            Margin = Margin = new Thickness(6, 2, 6, 0);

            inputField              = new EntryInputfield(placeholderText, Color.FromHex("D68933"), Color.Black);// backgroundColor, textColor);
            inputField.TextChanged += inputField_TextChanged;

            labelForInput = new LabelForInput(labelDescription, Color.FromHex("D68933"), Color.Black);

            Grid grid = new Grid
            {
                BackgroundColor = Color.Yellow,
                VerticalOptions = LayoutOptions.FillAndExpand,
                ColumnSpacing   = 0,
                #region RowDefinitions -
                //RowDefinitions =
                //{
                //   // new RowDefinition { Height = GridLength.Auto },
                //   // new RowDefinition { Height = GridLength.Auto },
                //   // new RowDefinition { Height = new GridLength(1, GridUnitType.Star) },
                //   // new RowDefinition { Height = new GridLength(100, GridUnitType.Absolute) }
                //},
                #endregion
                ColumnDefinitions =
                {
                    // new ColumnDefinition { },
                    // new ColumnDefinition { },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(2, GridUnitType.Star)
                    }
                }
            };

            grid.Children.Add(labelForInput, 0, 0);
            grid.Children.Add(inputField, 1, 0);
            // grid.Children.Add(new LabelForInput(labelUnit, backgroundColor, textColor), 2, 0);

            this.Content = grid; // Das Grid wird dieser Seite als Inhalt übergeben
        }
コード例 #2
0
        /// <summary>
        /// Standard Konstrukor
        /// Bei Erstellung eines Objektes dieser Klasse müssen alle geroderten Parameter übergeben werden
        /// </summary>
        /// <param name="labelDescription">Beschreibung des Eingabefeldes. Beispiel "Vorname:"</param>
        /// <param name="placeholderText">Dieser Text wird, vor der ersten Eingabe in dem Entry Objekt angegeben.</param>
        /// <param name="backgroundColor">Die Hintergrundfarbe des Objektes</param>
        /// <param name="textColor">Die Text Farbe des Objektes</param>
        public GridForUserInputList(string labelDescription, List <string> listOfStrings) // string placeholderText, Color backgroundColor, Color textColor)
        {
            Margin = Margin = new Thickness(6, 2, 6, 0);

            inputFieldUserNames.BackgroundColor       = Color.FromHex("D68933");
            inputFieldUserNames.TextColor             = Color.Black;
            inputFieldUserNames.SelectedIndex         = 0;
            inputFieldUserNames.SelectedIndexChanged += InputFieldMinutes_SelectedIndexChanged;

            inputFieldUserNames.ItemsSource.Add(listOfStrings);

            labelForInput = new LabelForInput(labelDescription, Color.FromHex("D68933"), Color.Black);

            Grid grid = new Grid
            {
                BackgroundColor = Color.Yellow,
                VerticalOptions = LayoutOptions.FillAndExpand,
                ColumnSpacing   = 0,

                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(2, GridUnitType.Star)
                    }
                }
            };

            grid.Children.Add(labelForInput, 0, 0);
            grid.Children.Add(inputFieldUserNames, 1, 0);
            // grid.Children.Add(new LabelForInput(labelUnit, backgroundColor, textColor), 2, 0);

            this.Content = grid; // Das Grid wird dieser Seite als Inhalt übergeben
        }
コード例 #3
0
        /// <summary>
        /// Standard Konstrukor
        /// Bei Erstellung eines Objektes dieser Klasse müssen alle geroderten Parameter übergeben werden
        /// </summary>
        /// <param name="labelDescription">Beschreibung des Eingabefeldes. Beispiel "Vorname:"</param>
        /// <param name="numberOfCoffee">Dieser Text wird, vor der ersten Eingabe in dem Entry Objekt angegeben.</param>
        /// <param name="backgroundColor">Die Hintergrundfarbe des Objektes</param>
        /// <param name="textColor">Die Text Farbe des Objektes</param>
        public ButtonForCoffeeDrinker(CoffeeDrinker coffeeDrinkerForThisButton, int numberOfCoffee, Color backgroundColor, Color textColor)
        {
            Margin = new Thickness(6, 3, 6, 3);

            numberOfCoffeePerMonth = numberOfCoffee;

            coffeeDrinker = coffeeDrinkerForThisButton;

            Button buttonAddCoffeeForUser = new Button();

            buttonAddCoffeeForUser.BackgroundColor = backgroundColor;
            buttonAddCoffeeForUser.Text            = "";
            buttonAddCoffeeForUser.Clicked        += ButtonAddCoffeeForUser_Clicked;

            labelForCoffeeDrinkerName     = new LabelForInput(coffeeDrinker.Firstname + " " + coffeeDrinker.Name, Color.Transparent, textColor);
            labelNumberOfCoffeeForDrinker = new LabelForInput(numberOfCoffeePerMonth.ToString(), Color.Transparent, textColor);
            labelNameCount = new LabelForInput("Anzahl Monat:", Color.Transparent, textColor);
            labelForCoffeeDrinkerName.SetTextsize(26);

            labelNameCount.VerticalTextAlignment = TextAlignment.End;
            labelNumberOfCoffeeForDrinker.VerticalTextAlignment = TextAlignment.Start;

            Grid grid = new Grid
            {
                BackgroundColor = Color.Transparent,//backgroundColor,
                VerticalOptions = LayoutOptions.FillAndExpand,
                ColumnSpacing   = 0,
                HeightRequest   = 80,
                #region RowDefinitions -
                RowDefinitions =
                {
                    // new RowDefinition { Height = GridLength.Auto },
                    // new RowDefinition { Height = GridLength.Auto },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Star)
                    },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Star)
                    }
                },
                #endregion

                #region ColumnDefinition
                ColumnDefinitions =
                {
                    // new ColumnDefinition { },
                    // new ColumnDefinition { },
                    new ColumnDefinition {
                        Width = new GridLength(2, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    }
                }

                #endregion
            };

            grid.Children.Add(buttonAddCoffeeForUser, 0, 2, 0, 2);
            grid.Children.Add(labelForCoffeeDrinkerName, 0, 1, 0, 2);
            grid.Children.Add(labelNameCount, 1, 0);
            grid.Children.Add(labelNumberOfCoffeeForDrinker, 1, 1);
            //grid.Children.Add(buttonAddCoffeeForUser,0,2,0,2);

            this.Content = grid; // Das Grid wird diesem ContentView als Inhalt übergeben
        }