Пример #1
0
        private bool SaveModel(GoodModel model)
        {
            var greet = Models.Get <HelloModel>(Uri.Model("greeting"));

            switch (System.DateTime.Now.TimeOfDay.Hours)
            {
            case int h when h < 5:
                greet.Greeting = "Good night!";
                break;

            case int h when h < 12:
                greet.Greeting = "Good morning!";
                break;

            case int h when h < 17:
                greet.Greeting = "Good afternoon!";
                break;

            default:
                greet.Greeting = "Good evening!";
                break;
            }
            InvokeChanged(greet, ChangingSource.Save);

            return(true);
        }
Пример #2
0
 private bool LoadModel(GoodModel model) => true;