Exemplo n.º 1
0
        /// <summary>
        /// 外部调用闹钟
        /// </summary>
        public void OpenAlarmClock()
        {
            MainAlarmClockView view = new MainAlarmClockView();

            view.DataContext = new MainAlarmClockViewModel();
            view?.Show();
        }
 /// <summary>
 /// 闹钟按钮
 /// </summary>
 /// <param name="element"></param>
 private void MainAlarmClock(ButtonBase element)
 {
     Task.Factory.StartNew(() =>
     {
         //Thread.Sleep(500);
         DispatcherHelper.CheckBeginInvokeOnUI(
             () =>
         {
             MainAlarmClockView view = new MainAlarmClockView();
             view.DataContext        = new MainAlarmClockViewModel();
             view.Show();
         });
     }).ContinueWith(result =>
     {
         if (result.IsFaulted)
         {
         }
     });
 }