Пример #1
0
        public override void PerformPreperation(IUserIO handler)
        {
            base.PerformPreperation(handler);
            string cTitle = handler.UserInputText(localize.WidgetTitle, null, BaseSample.WidgetConfig.WidgetTitle).Result;

            if (cTitle != null)
            {
                BaseSample.WidgetConfig.WidgetTitle = cTitle;
            }
            handler.TriggerPositiveButtonClicked();
        }
Пример #2
0
        public override async void ExecCustom(IUserIO handler)
        {
            base.ExecCustom(handler);
            var clr = await handler.UserSelectColor(localize.IconColor);

            if (clr != null)
            {
                var cfg = BaseSample.GetConfigClone();
                cfg.IconColor = clr.Value;
                BaseSample    = new WidgetCfgSample <WidgetCfg_ActionButton>("custom", cfg);
            }

            handler.TriggerPositiveButtonClicked();
        }
Пример #3
0
        public override async void ExecCustom(IUserIO handler)
        {
            base.ExecCustom(handler);
            NextStepAssistantType = typeof(WidgetCfgAssistant_CalendarCircleWave_OptionsBase);
            var clr = await handler.UserSelectColor(localize.text_TodayColor);

            if (clr != null)
            {
                var cfg = BaseSample.GetConfigClone();
                cfg.ColorTodayBackground = clr.Value;
                BaseSample = new WidgetCfgSample <WidgetCfg_CalendarCircleWave>("custom", cfg);
            }

            NextStepAssistantType = typeof(WidgetCfgAssistant_CalendarCircleWave_OptionsBase);
            handler.TriggerPositiveButtonClicked();
        }
Пример #4
0
        public override async void ExecCustom(IUserIO handler)
        {
            base.ExecCustom(handler);
            NextStepAssistantType = typeof(WidgetCfgAssistant_CalendarCircleWave_OptionsBase);
            if (await handler.UserShowYesNoMessage(localize.DayColorType, localize.DayColorTypeCustomInfo, localize.action_continue, localize.action_abort))
            {
                List <xColor> xclrs = new List <xColor>();
                int           iClr  = 0;
                while (true)
                {
                    iClr++;

                    var clr = await handler.UserSelectColor("Color number " + iClr);

                    if (clr == null)
                    {
                        break;
                    }
                    else
                    {
                        xclrs.Add(clr.Value);
                    }
                }
                if (xclrs.Count > 0)
                {
                    var cfg = BaseSample.GetConfigClone();
                    cfg.DayBackgroundGradient = new DateGradient()
                    {
                        GradientS = { new DynamicGradient(cfg.TimeUnit, xclrs.ToArray()) }
                    };
                    BaseSample = new WidgetCfgSample <WidgetCfg_CalendarCircleWave>("custom", xclrs.ToArray(), cfg);
                }

                NextStepAssistantType = typeof(WidgetCfgAssistant_CalendarCircleWave_CutomDayColorGradientTimeSpan);
                handler.TriggerPositiveButtonClicked();
            }
        }