|
|
|
using EyesAndEars.UWP.ViewModels;
|
|
|
|
using EyesAndEars.UWP.Services;
|
|
|
|
using Windows.UI.Xaml;
|
|
|
|
using Windows.UI.Xaml.Controls;
|
|
|
|
using EyesAndEars.UWP.Models;
|
|
|
|
using System;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
|
|
|
|
|
|
|
|
namespace EyesAndEars.UWP
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
|
|
|
/// </summary>
|
|
|
|
public sealed partial class MainPage : Page
|
|
|
|
{
|
|
|
|
private MainPageVM _vm = new MainPageVM();
|
|
|
|
public MainPage()
|
|
|
|
{
|
|
|
|
this.InitializeComponent();
|
|
|
|
IntialiseDataContextAsync();
|
|
|
|
// Need to set a refresh timer so it updates every 1 second or so...
|
|
|
|
}
|
|
|
|
|
|
|
|
private void IntialiseDataContextAsync() {
|
|
|
|
try {
|
|
|
|
// The Update features are not yet working...
|
|
|
|
_vm.FactoryDevice1 = DataServices.UpdateFactoryDevice(1).Result;
|
|
|
|
_vm.FactoryDevice2 = DataServices.UpdateFactoryDevice(2).Result;
|
|
|
|
_vm.FactoryDevice3 = DataServices.UpdateFactoryDevice(3).Result;
|
|
|
|
_vm.GalleryDevice1 = DataServices.UpdateGalleryDevice(4).Result;
|
|
|
|
_vm.GalleryDevice2 = DataServices.UpdateGalleryDevice(5).Result;
|
|
|
|
_vm.GalleryDevice3 = DataServices.UpdateGalleryDevice(6).Result;
|
|
|
|
DataContext = _vm;
|
|
|
|
}
|
|
|
|
catch (Exception) {
|
|
|
|
_vm = DataServices.CreateFallBackViewModel();
|
|
|
|
DataContext = _vm;
|
|
|
|
//throw;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private async void RefreshButton_Click(object sender, RoutedEventArgs e) {
|
|
|
|
// GET THE INITIALISATION WORKING FIRST AND THE DEFAULT CYCLE...
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private void SaveURLButton_Click(object sender, RoutedEventArgs e) {
|
|
|
|
// WORK ON THIS WENT YOU HAVE A LIVE SYSTEM WORKING WITH KNOWABLE DEFAULTS.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|