public void OnBasketClickCommand() { var basketWindow = new Views.Controls.BasketWindow(); if (basketWindow.DataContext is Controls.BasketWindowViewModel viewModel) { viewModel.LoadBasket(BasketItems); } basketWindow.Owner = System.Windows.Application.Current.MainWindow; basketWindow.ShowDialog(); if (basketWindow.Tag is System.Collections.Generic.List <Models.BasketItem> lst) { BasketItems.Clear(); BasketItems.AddRange(lst); ItemsBasket_CollectionChanged(); } }