Beispiel #1
0
        private async void RemoveProfile(object sender, RoutedEventArgs e)
        {
            if (!GetSelectedItem(out var profileItem))
            {
                return;
            }
            var dialog = new BoolDialog("Remove profile", "Are you sure you want to remove: " + profileItem.Profile.Title + "?");
            var result = (bool?)await DialogHost.Show(dialog, "RootDialog");

            if (result == null || !result.Value)
            {
                return;
            }

            profileItem.Profile.Remove();
            ReloadProfileTree();
        }
        public async void RemoveMapping(MappingViewModel mappingViewModel)
        {
            if (mappingViewModel.Mapping.DeviceBindings.Count > 0)
            {
                var dialog = new BoolDialog("Remove mapping", "Are you sure you want to remove the mapping: " + mappingViewModel.Mapping.Title + "?");
                var result = (bool?)await DialogHost.Show(dialog, ProfileDialogIdentifier);

                if (result == null || !result.Value)
                {
                    return;
                }
            }

            if (Profile.RemoveMapping(mappingViewModel.Mapping))
            {
                MappingsList.Remove(mappingViewModel);
            }
        }