public RateHistory() { this.InitializeComponent(); this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled; ViewModel = DataViewModel.getInstance(); webHandler = new WebHandler(); FromDatePicker.MinYear = new DateTime(2002, 01, 01); FromDatePicker.MaxYear = DateTime.Today; ToDatePicker.MaxYear = DateTime.Today; if (ViewModel.FromRateHistoryDate != null) { FromDatePicker.SelectedDate = ViewModel.FromRateHistoryDate; ToDatePicker.IsEnabled = true; if (ViewModel.ToRateHistoryDate != null) { ToDatePicker.SelectedDate = ViewModel.ToRateHistoryDate; DownloadDataButton.IsEnabled = true; if (ViewModel.HistoryOfCurrency != null) { loadChartData(); } } } lineChart.LegendItems.Clear(); }
public DataViewModel() { myInstance = this; localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; composite = (Windows.Storage.ApplicationDataCompositeValue)localSettings.Values["DataStoreViewModel"]; LoadLocalSettings(); }
/// <summary> /// Inicjuje pojedynczy obiekt aplikacji. Jest to pierwszy wiersz napisanego kodu /// wykonywanego i jest logicznym odpowiednikiem metod main() lub WinMain(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += OnSuspending; this.ViewModel = new DataViewModel(); localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; composite = (Windows.Storage.ApplicationDataCompositeValue)localSettings.Values["DataStoreViewModel"]; }
public MainPage() { this.InitializeComponent(); this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled; ViewModel = DataViewModel.getInstance(); webHandler = new WebHandler(); if (ViewModel.Dates == null) { DownloadDates(); } else { if (DatesListView != null) { DatesListView.SelectedIndex = ViewModel.CurrentDateSelection; } } }
public WebHandler() { this.httpClient = new HttpClient();; ViewModel = DataViewModel.getInstance(); }