FilesViewerWindow.xaml 的交互逻辑
Inheritance: MahApps.Metro.Controls.MetroWindow
Esempio n. 1
0
 public async void SearchText(string text)
 {
     var items = await this.SearchByEveryThingAsync(text);
     var dlg = new FilesViewerWindow(new FilesViewerViewModel());
     dlg.ViewModel.FilesView.Collection.AddRange(items.Select(z => new FileItemViewModel(z)));
     dlg.ShowDialog();
 }
 private async void SearchOnEverything_OnClick(object sender, RoutedEventArgs e)
 {
     var entity = ((FrameworkElement)sender).DataContext as EntityViewModel;
     if (entity == null || entity.Source.Format == null) return;
     var items = await entity.SearchByEveryThingAsync();
     var dlg = new FilesViewerWindow(new FilesViewerViewModel());
     dlg.ViewModel.FilesView.Collection.AddRange(items.Select(z => new FileItemViewModel(z)));
     dlg.ShowDialog();
 }