private async void ServicePageViewModel_PropertyChanged()

in BluetoothLEExplorer/BluetoothLEExplorer/ViewModels/ServicePageViewModel.cs [271:341]


        private async void ServicePageViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Notify")
            {
                if (Notify == true)
                {
                    NotifyProgress = true;
                    bool success = await SelectedService.TurnOnAllNotifications();
                    NotifyProgress = false;
                    if (success == true)
                    {
                        NotifyError = false;
                    }
                    else
                    {
                        Notify = false;
                        NotifyError = true;
                    }
                }
                else
                {
                    NotifyProgress = true;
                    bool success = await SelectedService.TurnOffAllNotifications();
                    NotifyProgress = false;
                    if (success == true)
                    {
                        NotifyError = false;
                    }
                    else
                    {
                        NotifyError = true;
                        Notify = true;
                    }
                }
            }

            if (e.PropertyName == "Indicate")
            {
                if (Indicate == true)
                {
                    IndicateProgress = true;
                    bool success = await SelectedService.TurnOnAllIndications();
                    IndicateProgress = false;
                    if (success == true)
                    {
                        IndicateError = false;
                    }
                    else
                    {
                        Indicate = false;
                        IndicateError = true;
                    }
                }
                else
                {
                    IndicateProgress = true;
                    bool success = await SelectedService.TurnOffAllNotifications();
                    IndicateProgress = false;

                    if (success == true)
                    {
                        IndicateError = false;
                    }
                    else
                    {
                        IndicateError = true;
                        Indicate = true;
                    }
                }
            }
        }