private void PrevChart_OnClick(object sender, RoutedEventArgs e) { EmdViewModel vm = DataContext as EmdViewModel; if (vm != null) { vm.OnPrevChartPressed(); } }
private async void NextChart_OnClick(object sender, RoutedEventArgs e) { EmdViewModel vm = DataContext as EmdViewModel; if (vm != null) { await vm.OnNextChartPressed((enabled) => { btnNextChart.IsEnabled = enabled; btnPrevChart.IsEnabled = enabled; }); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); int?channelNo = e.Parameter as int?; if (channelNo != null) { var viewModel = new EmdViewModel((int)channelNo); DataContext = viewModel; viewModel.Initialize(); } }