public MainPage() { InitializeComponent(); var _viewModel = new StopWatchViewModel(App.Current as IModelPool); this.BindingContext = _viewModel; // メッセージ受信処理:Laps画面の表示 _viewModel.Messenger.Register(typeof(StartViewMessage).Name, async message => { var msg = message as StartViewMessage; var v = new LapView() { BindingContext = new LapViewModel(App.Current as IModelPool), }; await this.Navigation.PushAsync(v, true); }); // メッセージ受信処理:トーストの表示 _viewModel.Messenger.Register(typeof(ShowToastMessage).Name, message => { var msg = message as ShowToastMessage; //CrossToastPopUp.Current.ShowToastMessage(msg.Text); //var toast = new MessageIOS(); //toast.ShortAlert(msg.Text); }); }
public MainWindow() { InitializeComponent(); var _viewModel = new StopWatchViewModel(App.Current as IModelPool); this.DataContext = _viewModel; // メッセージ受信処理:Laps画面の表示 _viewModel.Messenger.Register(typeof(StartViewMessage).Name, message => { var msg = message as StartViewMessage; var v = new LapView() { DataContext = new LapViewModel(App.Current as IModelPool), Owner = this, WindowStartupLocation = WindowStartupLocation.CenterOwner, }; v.ShowDialog(); }); // メッセージ受信処理:トーストの表示(WPFではメッセージボックスにした) _viewModel.Messenger.Register(typeof(ShowToastMessage).Name, message => { var msg = message as ShowToastMessage; MessageBox.Show(msg.Text); }); }
public StopWatch() { InitializeComponent(); BindingContext = new StopWatchViewModel(); //// Create the tick marks (to be sized and positioned later). for (int i = 0; i < tickMarks.Length; i++) { tickMarks[i] = new BoxView { Color = Color.Black }; absoluteLayout.Children.Add(tickMarks[i]); } //Device.StartTimer(TimeSpan.FromSeconds(1.0 / 60), OnTimerTick); }
public StopWatchView() { InitializeComponent(); DataContext = new StopWatchViewModel(); }