Beispiel #1
0
        public PlaceholderPageViewModel()
        {
            EffectOn.Value = true;


            ColorToggle.Subscribe(x => {
                PlaceColor.Value = x ? Color.Silver : Color.Red;
            });

            TextToggle.Subscribe(x => {
                PlaceText.Value = x ? "Placeholder Text" :
                                  "Placeholder Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text End";
            });

            ColorToggle.Value = true;
            TextToggle.Value  = true;

            ChangeTextCommand.Subscribe(_ => {
                if (string.IsNullOrEmpty(EditText.Value))
                {
                    EditText.Value = "Abcdef";
                }
                else
                {
                    EditText.Value = "";
                }
            });
        }
Beispiel #2
0
 public AlterColorPageViewModel()
 {
     ColorToggle.Subscribe(x => {
         Accent.Value = x ? Color.FromHex("#2455b3") : Color.FromHex("#CCA3B0");
     });
 }