using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using Navigator.Services;
using Navigator.Views;
using MarketData.Service;
using Navigator.Utils;

namespace Navigator
{
    public partial class App : Application
    {

        public App()
        {
          InitializeComponent();
          DependencyService.Register<MockDataStore>();
          if(!DesignMode.IsDesignModeEnabled)
          {
            if(MarketDataServiceClient.IsWiFiNetwork())MarketDataServiceClient.GetInstance().SetUrl(AppSettingsManager.Settings["Service_Local"],AppSettingsManager.Settings["ServiceUser"]);
            else MarketDataServiceClient.GetInstance().SetUrl(AppSettingsManager.Settings["Service_Network"],AppSettingsManager.Settings["ServiceUser"]);
          }
          MainPage = new MainPage();
        }

        protected override void OnStart()
        {
        }

        protected override void OnSleep()
        {
        }

        protected override void OnResume()
        {
        }
    }
}
