Exemple #1
0
        public override ICollection<UIElement> EditControls(FleuxControlPage settingsPage)
        {
            var controls = base.EditControls(settingsPage);
            var bindingManager = new BindingManager();

            // sms count method selection
            var ctrUnreadType = new SelectSettingsControl
            {
                Caption = "Unread Count".Localize(),
                Items = new List<object> { "Standart".Localize(), "MTK".Localize() },
            };
            controls.Add(ctrUnreadType);
            bindingManager.Bind(this, "UnreadType", ctrUnreadType, "SelectedIndex", true);

            controls.Add(new Separator());

            return controls;
        }
        public override ICollection<UIElement> EditControls(FleuxControlPage settingsPage)
        {
            var controls = base.EditControls(settingsPage);
            var bindingManager = new BindingManager();

            var fileControl = new FileSettingsControl(settingsPage)
                                  {
                                      Caption = "Application".Localize(),
                                      Value = CommandLine,
                                  };
            controls.Add(fileControl);
            bindingManager.Bind(this, "CommandLineForEdit", fileControl, "Value");

            var playOnTapAnimationControl = new FlagSettingsControl
                                                    {
                                                        Caption = "Play On Tap Animation".Localize(),
                                                    };
            controls.Add(playOnTapAnimationControl);
            bindingManager.Bind(this, "PlayOnTapAnimation", playOnTapAnimationControl, "Value", true);

            return controls;
        }
        public override ICollection<UIElement> EditControls(FleuxControlPage settingsPage)
        {
            var controls = base.EditControls(settingsPage);
            var bindingManager = new BindingManager();

            var colorControl = new ColorSettingsControl(true)
                                   {
                                       Caption = "Tile color".Localize(),
                                       ARGBValue = _tileColor,
                                   };
            controls.Add(colorControl);
            bindingManager.Bind(this, "TileColor", colorControl, "ARGBValue");

            var imgControl = new ImageSettingsControl()
                                 {
                                     Caption = "Button background".Localize(),
                                     Value = TileImage,
                                 };
            controls.Add(imgControl);
            bindingManager.Bind(this, "TileImage", imgControl, "Value");

            return controls;
        }
        public virtual ICollection<UIElement> EditControls(FleuxControlPage settingsPage, BindingManager bindingManager)
        {
            var controls = new List<UIElement>();

            var ctrLockScreenImage = new ImageSettingsControl
                                         {
                                             Caption = "Lock screen background",
                                         };
            controls.Add(ctrLockScreenImage);
            bindingManager.Bind(this, "Background", ctrLockScreenImage, "Value", true);

            var formatControl = new SelectSettingsControl
                                    {
                                        Caption = "Date format",
                                        Items = _dateSamples,
                                    };
            controls.Add(formatControl);
            bindingManager.Bind(this, "DateSampleIndex", formatControl, "SelectedIndex", true);

            var flagControl = new FlagSettingsControl
                                  {
                                      Caption = "24-Hours",
                                  };
            controls.Add(flagControl);
            bindingManager.Bind(this, "Is24Hour", flagControl, "Value", true);
            /*****************************************************************************************************/
            // Top Bar
            /* Блокируем нет пока иконок черного цвета
            var TopBarWhiteIconflagControl = new FlagSettingsControl { Caption = "TopBar white Icon", };
            controls.Add(TopBarWhiteIconflagControl);
            bindingManager.Bind(this, "TopBarWhiteIcon", TopBarWhiteIconflagControl, "Value", true);*/

            var TopBarColorBatteryflagControl = new FlagSettingsControl { Caption = "TopBar color battery", };
            controls.Add(TopBarColorBatteryflagControl);
            bindingManager.Bind(this, "TopBarColorBattery", TopBarColorBatteryflagControl, "Value", true);

            var TopBarFontColorControl = new ColorSettingsControl(true) { Caption = "TopBar time color", };
            controls.Add(TopBarFontColorControl);
            bindingManager.Bind(this, "TopBarFontColorIndex", TopBarFontColorControl, "Value", true);
            /*****************************************************************************************************/
            // Media Player
            var PlayerWhiteIconflagControl = new FlagSettingsControl { Caption = "Player white icon", };
            controls.Add(PlayerWhiteIconflagControl);
            bindingManager.Bind(this, "PlayerWhiteIcon", PlayerWhiteIconflagControl, "Value", true);

            var PlayerFontColorControl = new ColorSettingsControl(true) { Caption = "Player text color", };
            controls.Add(PlayerFontColorControl);
            bindingManager.Bind(this, "PlayerFontColorIndex", PlayerFontColorControl, "Value", true);
            /*****************************************************************************************************/
            // Date Time
            /* Пока не сделал отображение будильника
            var DateTimeWhiteIconflagControl = new FlagSettingsControl { Caption = "Alarm white icon", };
            controls.Add(DateTimeWhiteIconflagControl);
            bindingManager.Bind(this, "DateTimeWhiteIcon", DateTimeWhiteIconflagControl, "Value", true);*/

            var DateTimeFontColorControl = new ColorSettingsControl(true) { Caption = "Date text color", };
            controls.Add(DateTimeFontColorControl);
            bindingManager.Bind(this, "DateTimeFontColorIndex", DateTimeFontColorControl, "Value", true);
            /*****************************************************************************************************/
            // Appointment
            var AppointmentWhiteIconflagControl = new FlagSettingsControl { Caption = "Appointment white icon", };
            controls.Add(AppointmentWhiteIconflagControl);
            bindingManager.Bind(this, "AppointmentWhiteIcon", AppointmentWhiteIconflagControl, "Value", true);

            var AppointmentFontColorControl = new ColorSettingsControl(true) { Caption = "Appointment text color", };
            controls.Add(AppointmentFontColorControl);
            bindingManager.Bind(this, "AppointmentFontColorIndex", AppointmentFontColorControl, "Value", true);
            /*****************************************************************************************************/
            // Status
            var StatusWhiteIconflagControl = new FlagSettingsControl { Caption = "Status white icon", };
            controls.Add(StatusWhiteIconflagControl);
            bindingManager.Bind(this, "StatusWhiteIcon", StatusWhiteIconflagControl, "Value", true);

            var StatusFontColorControl = new ColorSettingsControl(true) { Caption = "Status text color", };
            controls.Add(StatusFontColorControl);
            bindingManager.Bind(this, "StatusFontColorIndex", StatusFontColorControl, "Value", true);

            return controls;
        }
Exemple #5
0
        public override ICollection<UIElement> EditControls(FleuxControlPage settingsPage)
        {
            var controls = base.EditControls(settingsPage);
            var bindingManager = new BindingManager();

            var WhiteIconflagControl = new FlagSettingsControl { Caption = "Player white icon", };
            controls.Add(WhiteIconflagControl);
            bindingManager.Bind(this, "WhiteIcon", WhiteIconflagControl, "Value", true);

            var fontNameControl = new SelectSettingsControl { Caption = "Font Name", Items = _fontNamesData, };
            controls.Add(fontNameControl);
            bindingManager.Bind(this, "FontNameIndex", fontNameControl, "SelectedIndex", true);

            var fontSizeControl = new SelectSettingsControl { Caption = "Font Size", Items = _fontSizesData, };
            controls.Add(fontSizeControl);
            bindingManager.Bind(this, "FontSizeIndex", fontSizeControl, "SelectedIndex", true);

            var fontColorControl = new ColorSettingsControl(true) { Caption = "Font Color", };
            controls.Add(fontColorControl);
            bindingManager.Bind(this, "FontColorIndex", fontColorControl, "Value", true);

            foreach (var control in controls)
                if (control.Name.Contains("Icon"))
                {
                    controls.Remove(control);
                    break;
                }
            foreach (var control in controls)
                if (control.Name.Contains("Caption"))
                {
                    controls.Remove(control);
                    break;
                }

            return controls;
        }
Exemple #6
0
        public override ICollection<UIElement> EditControls(FleuxControlPage settingsPage)
        {
            var controls = base.EditControls(settingsPage);
            var bindingManager = new BindingManager();

            var captionControl = new StringSettingsControl(settingsPage)
                                     {
                                         Caption = "Caption".Localize(),
                                         Name = "Caption",
                                     };
            controls.Add(captionControl);
            bindingManager.Bind(this, "Caption", captionControl, "Value", true);

            var captionFontControl = new FontSettingsControl
            {
                Caption = "Caption Font".Localize(),
                Name = "CaptionFont",
            };
            controls.Add(captionFontControl);
            bindingManager.Bind(this, "CaptionFont", captionFontControl, "Value", true);

            var imgControl = new ImageSettingsControl()
                                 {
                                     Caption = "Icon image".Localize(),
                                     Name = "Icon",
                                 };
            controls.Add(imgControl);
            bindingManager.Bind(this, "IconPath", imgControl, "Value", true);

            return controls;
        }
        public override ICollection<UIElement> EditControls(FleuxControlPage settingsPage)
        {
            var controls = base.EditControls(settingsPage);
            var bindingManager = new BindingManager();

            var is24HourControl = new FlagSettingsControl
                                  {
                                      Caption = "24-Hours".Localize(),
                                  };
            controls.Add(is24HourControl);
            bindingManager.Bind(this, "Is24Hour", is24HourControl, "Value", true);

            var showAlarmControl = new FlagSettingsControl
            {
                Caption = "Show alarm".Localize(),
            };
            controls.Add(showAlarmControl);
            bindingManager.Bind(this, "ShowAlarm", showAlarmControl, "Value", true);

            var formatControl = new SelectSettingsControl
                                    {
                                        Caption = "Date format".Localize(),
                                        Items = _dateSamples,
                                    };
            controls.Add(formatControl);
            bindingManager.Bind(this, "DateSampleIndex", formatControl, "SelectedIndex", true);

            var timeFontControl = new FontSettingsControl
                                          {
                                              Caption = "Time Font".Localize(),
                                          };
            controls.Add(timeFontControl);
            bindingManager.Bind(this, "TimeFont", timeFontControl, "Value", true);

            var dateFontControl = new FontSettingsControl
                                          {
                                              Caption = "Date Font".Localize(),
                                          };
            controls.Add(dateFontControl);
            bindingManager.Bind(this, "DateFont", dateFontControl, "Value", true);

            var alarmFontControl = new FontSettingsControl
            {
                Caption = "Alarm Font".Localize(),
            };
            controls.Add(alarmFontControl);
            bindingManager.Bind(this, "AlarmFont", alarmFontControl, "Value", true);

            // hide control for icon / caption selection
            foreach (var control in controls)
                if (control.Name.Contains("Icon"))
                {
                    controls.Remove(control);
                    break;
                }
            foreach (var control in controls)
                if (control.Name.Contains("Caption"))
                {
                    controls.Remove(control);
                    break;
                }
            foreach (var control in controls)
                if (control.Name.Contains("CaptionFont"))
                {
                    controls.Remove(control);
                    break;
                }

            return controls;
        }
        public override ICollection<UIElement> EditControls(FleuxControlPage settingsPage)
        {
            var controls = base.EditControls(settingsPage);
            var bindingManager = new BindingManager();

            foreach (var control in controls)
                if (control.Name.Contains("Icon"))
                {
                    controls.Remove(control);
                    break;
                }
            foreach (var control in controls)
                if (control.Name.Contains("Caption"))
                {
                    controls.Remove(control);
                    break;
                }

            return controls;
        }
        public virtual ICollection<UIElement> EditControls(FleuxControlPage settingsPage, BindingManager bindingManager)
        {
            var controls = new List<UIElement>();

            var ctrLockScreenImage = new ImageSettingsControl
            {
                Caption = _str_lockScreenBackground.Localize(),
            };
            controls.Add(ctrLockScreenImage);
            bindingManager.Bind(this, "Background", ctrLockScreenImage, "Value", true);

            var formatControl = new SelectSettingsControl
            {
                Caption = _str_dateFormat.Localize(),
                Items = _dateSamples,
            };
            controls.Add(formatControl);
            bindingManager.Bind(this, "DateSampleIndex", formatControl, "SelectedIndex", true);

            var flagControl = new FlagSettingsControl
            {
                Caption = _str_is24Hour.Localize(),
            };
            controls.Add(flagControl);
            bindingManager.Bind(this, "Is24Hour", flagControl, "Value", true);

            return controls;
        }
        public override ICollection<UIElement> EditControls(FleuxControlPage settingsPage)
        {
            var controls = base.EditControls(settingsPage);
            var bindingManager = new BindingManager();

            var showDateControl = new FlagSettingsControl { Caption = "Show Date".Localize(), };
            controls.Add(showDateControl); bindingManager.Bind(this, "IsShowDate", showDateControl, "Value", true);

            var showCalendarControl = new FlagSettingsControl { Caption = "Show Calendar".Localize(), };
            controls.Add(showCalendarControl); bindingManager.Bind(this, "IsShowCalendar", showCalendarControl, "Value", true);

            var timeScreenControl = new SelectSettingsControl { Caption = "Time Screen", Items = _timeScreensData, };
            controls.Add(timeScreenControl);
            bindingManager.Bind(this, "TimeScreenIndex", timeScreenControl, "SelectedIndex", true);

            var dateFontControl = new FontSettingsControl
            {
                Caption = "Date Font".Localize(),
                Name = "DateFont",
            };
            controls.Add(dateFontControl);
            bindingManager.Bind(this, "DateFont", dateFontControl, "Value", true);

            var timeFontControl = new FontSettingsControl
            {
                Caption = "Time Font".Localize(),
                Name = "TimeFont",
            };
            controls.Add(timeFontControl);
            bindingManager.Bind(this, "TimeFont", timeFontControl, "Value", true);

            var weekFontControl = new FontSettingsControl
            {
                Caption = "Week Font".Localize(),
                Name = "WeekFont",
            };
            controls.Add(weekFontControl);
            bindingManager.Bind(this, "WeekFont", weekFontControl, "Value", true);

            foreach (var control in controls)
                if (control.Name.Contains("Icon"))
                {
                    controls.Remove(control);
                    break;
                }

            return controls;
        }
        public override ICollection<UIElement> EditControls(FleuxControlPage settingsPage)
        {
            var controls = base.EditControls(settingsPage);
            var bindingManager = new BindingManager();

            var contactControl = new ContactSettingsControl
                                 {
                                     Caption = str_Contact.Localize(),
                                     Value = ContactId,
                                 };
            controls.Add(contactControl);
            bindingManager.Bind(this, "ContactId", contactControl, "Value");

            var imgControl = new ImageSettingsControl()
            {
                Caption = str_AlternateImage.Localize(),
                Value = AlternatePicturePath,
            };
            controls.Add(imgControl);
            bindingManager.Bind(this, "AlternatePicturePath", imgControl, "Value");

            return controls;
        }
Exemple #12
0
        private void CreateControls()
        {
            ScreenRoutines.CursorWait();
            try
            {
                Control.ShadowedAnimationMode = FleuxControl.ShadowedAnimationOptions.FromRight;

                var appBar = new ApplicationBar
                {
                    Size = new Size(Size.Width, 48 + 2 * 10),
                    Location = new Point(0, Size.Height - 48 - 2 * 10)
                };
                appBar.AddButton(ResourceManager.Instance.GetBitmapFromEmbeddedResource(
                    (MetroTheme.PhoneBackgroundBrush == Color.White) ?
                        "Metrohome65.Settings.Controls.Images.back-light.bmp" : "Metrohome65.Settings.Controls.Images.back-dark.bmp"
                    ));
                appBar.ButtonTap += (sender, args) => Close();
                Control.AddElement(appBar.AnimateHorizontalEntrance(false));

                var stackPanel = new StackPanel { Size = new Size(SettingsConsts.MaxWidth, 10), };

                // buttons for selecting font family
                stackPanel.AddElement(
                    new TextElement("Font family") { AutoSizeMode = TextElement.AutoSizeModeOptions.OneLineAutoHeight, }
                );

                var fonts = new List<string>
                    {
                        MetroTheme.PhoneFontFamilyNormal,
                        MetroTheme.PhoneFontFamilyLight,
                        MetroTheme.PhoneFontFamilySemiLight,
                        MetroTheme.PhoneFontFamilySemiBold,
                    };
                var fontBindingManager = new BindingManager() { MultiBind = true, };
                foreach (var font in fonts)
                {
                    var button = new ToggleButton(font)
                        {
                            Size = new Size(SettingsConsts.MaxWidth, 50),
                        };
                    stackPanel.AddElement(button);
                    fontBindingManager.Bind(_textStyle, "FontFamily", button, "Value", true);
                    stackPanel.AddElement(new DelegateUIElement() { Size = new Size(10, 10), });
                }

                stackPanel.AddElement(new DelegateUIElement() { Size = new Size(10, 20) });

                // buttons for selecting font size
                stackPanel.AddElement(
                    new TextElement("Font size") { AutoSizeMode = TextElement.AutoSizeModeOptions.OneLineAutoHeight, }
                );

                var sizePanel = new Canvas()
                {
                    Size = new Size(SettingsConsts.MaxWidth, 10),
                };
                stackPanel.AddElement(sizePanel);

                var sizeBindingManager = new BindingManager() { MultiBind = true, };
                var sizes = new List<int>
                    {
                         8, 10, 11, 12, 14,
                        16, 18, 20, 22, 24,
                        26, 28, 30, 32, 34,
                        36, 38, 42, 46, 50,
                    };
                var i = 0;
                foreach (var size in sizes)
                {
                    var button = new ToggleButton(size)
                            {
                                Location = new Point((i%5)*90, (i/5)*60),
                                Size = new Size(80, 50),
                            };
                    sizeBindingManager.Bind(_textStyle, "FontSize", button, "Value", true);
                    sizePanel.AddElement(button);
                    i++;
                }

                stackPanel.AddElement(new DelegateUIElement() { Size = new Size(10, 20)});

                // font color
                var fontColor = new ColorSettingsControl(false)
                    {
                        Size = new Size(SettingsConsts.MaxWidth, 50),
                        Caption = "Font color",
                    };
                fontBindingManager.Bind(_textStyle, "Foreground", fontColor, "Value", true);
                stackPanel.AddElement(fontColor);

                stackPanel.AddElement(new DelegateUIElement() { Size = new Size(10, 20) });

                // example text block
                _example = new TextElement("Example")
                    {
                        AutoSizeMode = TextElement.AutoSizeModeOptions.OneLineAutoHeight,
                        Style = _textStyle,
                    };
                _textStyle.PropertyChanged += (sender, args) => _example.Update();
                stackPanel.AddElement(_example);

                var scroller = new SolidScrollViewer
                {
                    Content = stackPanel,
                    Location = new Point(SettingsConsts.PaddingHor, SettingsConsts.PaddingHor),
                    Size = new Size(this.Size.Width - SettingsConsts.PaddingHor, this.Size.Height - appBar.Size.Height - SettingsConsts.PaddingHor),
                    ShowScrollbars = true,
                    HorizontalScroll = false,
                    VerticalScroll = true,
                };

                Control.AddElement(scroller);
            }
            finally
            {
                ScreenRoutines.CursorNormal();
            }
        }