Exemplo n.º 1
0
        /// <summary>
        /// Creates the controls for displaying the field
        /// <para xml:lang="es">Crea los controles para visualizar el campo.</para>
        /// </summary>
        protected override void CreateValueControl()
        {
            DatePicker = Platform.Current.Create <IDatePicker>();
            TimePicker = Platform.Current.Create <ITimeOfDayPicker>();
            var flow = Platform.Current.Create <Controls.Layout.IFlow>();

            flow.Children.Add(DatePicker);
            flow.Children.Add(TimePicker);

            ValueControl = flow;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Start this instance.
        /// <para xml:lang="es">
        /// Inicia la instancia del objeto Calendar.
        /// </para>
        /// </summary>
        public override void Start()
        {
            base.Start();

            // Create an Stack
            IStack stack = Platform.Current.Create <IStack>();

            // Creates an Label with text and a specific size and adds it to the stack.
            lblLabel        = Platform.Current.Create <ILabel>();
            lblLabel.Text   = "Select a time of day";
            lblLabel.Height = 30;
            stack.Children.Add(lblLabel);

            // Creates an Calendar with text specific and adds it to the stack.
            picker      = Platform.Current.Create <ITimeOfDayPicker>();
            picker.Name = "timePicker";
            picker.Bold = true;
            stack.Children.Add(picker);

            // Creates the Button cmdChange with text specific, with the event also click and adds it to the stack.
            IButton cmdChange = Platform.Current.Create <IButton>();

            cmdChange.Text   = "Select";
            cmdChange.Click += CmdChange_Click;
            stack.Children.Add(cmdChange);

            // Creates the Button cmdClose with text specific, with the event also click and adds it to the stack.
            IButton cmdClose = Platform.Current.Create <IButton>();

            cmdClose.Text   = "Close";
            cmdClose.Click += CmdClose_Click;
            stack.Children.Add(cmdClose);

            // Establishes the content and title of the page
            Platform.Current.Page.Title   = "Test date picker";
            Platform.Current.Page.Content = stack;
        }