Exemplo n.º 1
0
        private void DeleteSelectedPinButton_Click(object sender, RoutedEventArgs e)
        {
            // delete the selected pin. Don't close the overlay
            if (_view == null || _storage == null)
            {
                return;
            }
            if (existingPinList?.SelectedItem == null)
            {
                return;
            }

            if (!(existingPinList?.SelectedItem is ListViewItem item))
            {
                return;
            }
            if (!(item.Tag is InfoPin pin))
            {
                return;
            }

            _storage.RemovePin(pin.Id);
            ThreadPool.QueueUserWorkItem(x => { ReloadPins(); });
        }