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();
 }
예제 #2
0
 public DataViewModel()
 {
     myInstance    = this;
     localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
     localFolder   = Windows.Storage.ApplicationData.Current.LocalFolder;
     composite     = (Windows.Storage.ApplicationDataCompositeValue)localSettings.Values["DataStoreViewModel"];
     LoadLocalSettings();
 }
예제 #3
0
 /// <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"];
 }
예제 #4
0
 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;
         }
     }
 }
예제 #5
0
 public WebHandler()
 {
     this.httpClient = new HttpClient();;
     ViewModel       = DataViewModel.getInstance();
 }