/// <summary> /// Constructor of Geofence page /// </summary> public GeofenceSettingsPage() { _oSelectedGeofenceCommand = null; InitializeComponent(); App.ShowToast(AppResources.title_add_location); swEnableGeofence.IsToggled = App.AppSettings.GeofenceEnabled; swEnableGeofence.Toggled += (sender, args) => { App.AppSettings.GeofenceEnabled = swEnableGeofence.IsToggled; if (swEnableGeofence.IsToggled) { if (!ValidateGeofenceSupported()) { swEnableGeofence.IsToggled = false; } } }; _oListSource = App.AppSettings.GeofenceCommands; if (_oListSource != null) { listView.ItemsSource = _oListSource; } }
/// <summary> /// Connect device to Geofence Command /// </summary> private async void btnConnect_Clicked(object sender, EventArgs e) { _oSelectedGeofenceCommand = (Models.GeofenceModel)((TintedCachedImage)sender).BindingContext; var oSwitchPopup = new SwitchPopup(); oSwitchPopup.DeviceSelectedMethod += DelegateMethod; await PopupNavigation.Instance.PushAsync(oSwitchPopup); }