public static bool Open(Window owner, ref Filter obj) { Window win = new FilterWindow() { DataContext = obj, Owner = owner, }; win.ShowDialog(); return(win.DialogResult == true ? true : false); }
private void OnShowFilter(object sender, RoutedEventArgs _) { CollectionViewSource src = (CollectionViewSource)Resources["entries"]; bool ok = FilterWindow.Open(this, ref filter); src.View.Filter = null; if (ok) { src.View.Filter = filter.Keep; } }