public SearchCategoryView() { InitializeComponent(); DataContextChanged += (sender, args) => { var viewModel = args.NewValue as CategoriesViewModel; if (viewModel != null) { viewModel.Closed += () => _dialog?.Close(); viewModel.SelectedSearchResults = SearchResultsList.SelectedItems as ObservableCollection <object>; } PopupContent.DataContext = args.NewValue; }; }
public void Close() { _dialog?.Close(); }