コード例 #1
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();
        }
コード例 #2
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();
        }
コード例 #3
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();
            }
        }