using cfs_tracker.Services; using cfs_tracker.ViewModels; using System.Diagnostics; namespace cfs_tracker.Views; public partial class YearPage : ContentPage { private readonly YearViewModel _viewModel; public YearViewModel ViewModel => _viewModel; public YearPage(YearViewModel viewModel) { InitializeComponent(); BindingContext = _viewModel = viewModel; } protected override async void OnAppearing() { base.OnAppearing(); try { await _viewModel.RefreshAsync(); } catch (Exception ex) { Debug.WriteLine("YearPage crash:"); Debug.WriteLine(ex.ToString()); await DisplayAlertAsync( LocalizationService.Translate("Common_Error"), ex.ToString(), LocalizationService.Translate("Common_OK")); } } }