private async void BtnUpdate_Click(object sender, RoutedEventArgs e) { if (LvAll.SelectedItem != null) { var p = await AdminInterface.GetAsync((LvAll.SelectedItem as PictureInfo).Id); var update = new UpdatePicture(AdminInterface) { Picture = p }; update.ShowDialog(); } else { popup = ConfigurePopup.Configure(popup, "Select an item first!", BtnListAll, PlacementMode.Bottom); popup.IsOpen = true; return; } }