Пример #1
0
        private async void Email_Notification_Switch_StateChanged(object sender, SwitchStateChangedEventArgs e)
        {
            var user  = App.IoCContainer.GetInstance <IUserManagementService>();
            var value = await user.SetEmaileNotificationSettings((bool)e.NewValue);

            Application.Current.Properties["EmailNotifications"] = value;
        }
Пример #2
0
        private async void AllAppSwitch_StateChanged(object sender, SwitchStateChangedEventArgs e)
        {
            if (!setAllAppsSwitchState)
            {
                return;
            }
            else
            {
                if (allAppSwitch.IsOn == null)
                {
                    allAppSwitch.IsOn = oldValue;
                }
            }
            await Task.Delay(1);

            if (this.allAppSwitch.IsOn == true)
            {
                foreach (var appModel in this.ListCollection)
                {
                    appModel.CanNotify = true;
                }
            }
            else if (this.allAppSwitch.IsOn == false)
            {
                foreach (var appModel in this.ListCollection)
                {
                    appModel.CanNotify = false;
                }
            }
            oldValue = this.allAppSwitch.IsOn;
        }
Пример #3
0
 public void ChangeSchedule(object sender, SwitchStateChangedEventArgs e)
 {
     if (e.NewValue != null)
     {
         ScheduleType = (bool)e.NewValue ? ScheduleView.DayView : ScheduleView.TimelineView;
     }
 }
Пример #4
0
        private async void Set_Anonomous_Switch_StateChanged(object sender, SwitchStateChangedEventArgs e)
        {
            var user  = App.IoCContainer.GetInstance <IUserManagementService>();
            var value = await user.ToggleAnonymousUser((bool)e.NewValue);

            CrossToastPopUp.Current.ShowToastMessage($"Anonymity set to: {value}");
            Application.Current.Properties["Anonymity"] = e.NewValue;
        }
Пример #5
0
        private void Allow_Notification_Switch_StateChanged(object sender, SwitchStateChangedEventArgs e)
        {
            var val = (bool)e.NewValue;

            if (val == false)
            {
                Email_Notification_Switch.IsOn = true;
            }
            App.Current.Properties["Allow_Notifications"] = val;
        }
Пример #6
0
 private void SfSwitch_StateChanged_3(object sender, SwitchStateChangedEventArgs e)
 {
     if (this.ModeSwitch.IsOn == true)
     {
         this.ModeLabel.Text = "Night mode enabled";
     }
     else
     {
         this.ModeLabel.Text = "Day mode enabled";
     }
 }
Пример #7
0
 // ==========================================================================================
 // beep state changed to ON/OFF
 //
 // The toggle will start the beep for every simulated Compression
 // ==========================================================================================
 private void SfSwitch_beepStateChanged(object sender, SwitchStateChangedEventArgs e)
 {
   if (e.NewValue == true)
   {
     Alles.BeepAllowed = true;
   }
   else
   {
     Alles.BeepAllowed = false;
   }
 }
Пример #8
0
        private void ChartSwitch_Changed(object sender, SwitchStateChangedEventArgs e)
        {
            SfSwitch tempSwitch = (SfSwitch)sender;
            bool     state      = (bool)tempSwitch.IsOn;

            if (state)
            {
                Xamarin.Essentials.Preferences.Set("chartType", 1);
            }
            else
            {
                Xamarin.Essentials.Preferences.Set("chartType", 0);
            }
        }
Пример #9
0
        private void SfSwitch_OnStateChanged(object sender, SwitchStateChangedEventArgs e)
        {
            var backgroundLocationService = App.IoCContainer.GetInstance <IBackgroundLocationService>();

            if (e.NewValue == true)
            {
                CrossSecureStorage.Current.SetValue("Location", "true");
                backgroundLocationService.Start_Tracking();
            }
            else
            {
                backgroundLocationService.Stop_Tracking();
                CrossSecureStorage.Current.SetValue("Location", "false");
            }
        }
Пример #10
0
        private void SfSwitch_OnStateChanged(object sender, SwitchStateChangedEventArgs e)
        {
            string Value = string.Empty;

            if (e.NewValue == true)
            {
                Value = "ON";
            }
            else
            {
                Value = "OFF";
            }

            //DisplayAlert("Message", "Data sync has been turned " + Value, "OK");
        }
Пример #11
0
        private async void SfSwitch_StateChanged(object sender, SwitchStateChangedEventArgs e)
        {
            setAllAppsSwitchState = false;
            bool hasTrue = false;

            bool hasFalse = false;

            foreach (var appModel in this.ListCollection)
            {
                if (appModel.CanNotify == true)
                {
                    hasTrue = true;
                }
                if (appModel.CanNotify == false)
                {
                    hasFalse = true;
                }
            }

            if (hasFalse && hasTrue)
            {
                this.allAppSwitch.AllowIndeterminateState = true;
                this.allAppSwitch.IsOn = null;
            }
            else if (hasFalse && !hasTrue)
            {
                this.allAppSwitch.AllowIndeterminateState = false;
                this.allAppSwitch.IsOn = false;
            }
            else if (!hasFalse && hasTrue)
            {
                this.allAppSwitch.AllowIndeterminateState = false;
                this.allAppSwitch.IsOn = true;
            }
            await Task.Delay(250);

            setAllAppsSwitchState = true;
        }
Пример #12
0
 private void SfSwitch_StateChanged_2(object sender, SwitchStateChangedEventArgs e)
 {
     this.OffStateLabel.Text = GetLabel(this.OffStateSwitch.IsOn);
     setStates(false, this.OffStateSwitch.IsOn);
 }
Пример #13
0
 private void SfSwitch_StateChanged_1(object sender, SwitchStateChangedEventArgs e)
 {
     this.IndeterminateStateLabel.Text = GetLabel(this.IndeterminateStateSwitch.IsOn);
     setStates(null, this.IndeterminateStateSwitch.IsOn);
 }
Пример #14
0
 private void SfSwitch_OnStateChanged(object sender, SwitchStateChangedEventArgs e)
 {
     //DisplayAlert("Message", "SUCCESS", "OK");
 }