예제 #1
0
 /// <summary>
 /// Overrides this method if want to handle behavior when the application is launched.
 /// If base.OnCreated() is not called, the event 'Created' will not be emitted.
 /// </summary>
 protected override void OnCreate()
 {
     base.OnCreate();
     Xamarin.Forms.Application xamarinApp = new Xamarin.Forms.Application();
     TSystem.Display.StateChanged += Display_StateChanged;
     xamarinApp.MainPage           = new WeatherWatchPage();
     _viewModel = (WeatherWatchPageModel)xamarinApp.MainPage.BindingContext;
     LoadWatchface(xamarinApp);
 }
예제 #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="_vm">WeatherWatchPageModel</param>
        public LocationService(WeatherWatchPageModel _vm)
        {
            _viewModel = _vm;
            Information.TryGetValue("http://tizen.org/feature/location", out LocationSupported);
            LocationEnabled = false;

            if (LocationSupported)
            {
                SubscribeUserPemission();
                RequestPermission();
            }
        }
예제 #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="_vm">WeatherWatchPageModel</param>
        public NetworkService(WeatherWatchPageModel _vm)
        {
            _viewModel = _vm;

            Information.TryGetValue("http://tizen.org/feature/network.wifi", out isWiFiSupported);
            Information.TryGetValue("http://tizen.org/feature/network.telephony", out isTelephonySupported);
            Information.TryGetValue("http://tizen.org/feature/network.tethering.bluetooth", out isBTTetheringSupported);
            Information.TryGetValue("http://tizen.org/feature/network.ethernet", out isEthernetSupported);
            Console.WriteLine("Network feature : wifi : " + isWiFiSupported);
            Console.WriteLine("Network feature : telephony : " + isTelephonySupported);
            Console.WriteLine("Network feature : tethering.bluetooth : " + isBTTetheringSupported);
            Console.WriteLine("Network feature : network.ethernet : " + isEthernetSupported);

            ConnectionItem connection = ConnectionManager.CurrentConnection;

            Console.WriteLine("connection type : " + connection.Type + ", State: " + connection.State);
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="_vm">WeatherWatchPageModel</param>
 public ForecastService(WeatherWatchPageModel _vm)
 {
     _viewModel = _vm;
 }
예제 #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="_vm">WeatherWatchPageModel</param>
 public BatteryInfoService(WeatherWatchPageModel _vm)
 {
     _viewModel = _vm;
     Update(Battery.Percent);
 }