Ejemplo n.º 1
0
        public async static Task <string> Show(Layout <View> parent, string title, string header, string defaultText, string ext = "", ColorDialogSettings settings = null)
        {
            // Creating a dialog
            var dlg = new InputDialog()
            {
                Parent   = parent,
                Title    = title,
                ext      = ext,
                settings = settings ?? new ColorDialogSettings(),
            };

            dlg.Settings = dlg.settings;

            await dlg.Initialize();

            dlg.lblHeader.Text = header;
            dlg.edtEditor.Text = defaultText;

            // Zobrazení
            bool result = await dlg.ShowDialog(parent);

            if (result)
            {
                return(dlg.edtEditor.Text);
            }
            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Show color dialog with <see cref="ColorPickerMixer"/> for picking a color.
        /// </summary>
        /// <param name="parent">Root container on the page, where a modal dialog will be temporarily placed</param>
        /// <param name="title">Caption in the header of the dialog</param>
        /// <param name="defaultColor">Preselected color</param>
        /// <param name="settings">Dialog settings</param>
        /// <returns>Color selected in dialog or default color, if cancel is clicked</returns>
        public async static Task <Color> Show(Layout <View> parent, string title, Color defaultColor, ColorDialogSettings settings = null)
        {
            // Creating a dialog
            var dlg = new ColorPickerDialog()
            {
                Parent        = parent,
                Title         = title,
                originalColor = defaultColor,
                settings      = settings ?? new ColorDialogSettings(),
            };

            dlg.Settings = dlg.settings;

            // Initializing
            await dlg.Initialize();

            // Showing
            bool result = await dlg.ShowDialog(parent);

            // Result
            if (result)
            {
                return(dlg.colorEditor.Color);
            }
            return(defaultColor);
        }