public MainWindow() { InitializeComponent(); watcher = new Watcher(); watcher.Add(new Request("c:\\", true)); watcher.OnAddedAsync += async(f, t) => { Application.Current.Dispatcher.BeginInvoke( DispatcherPriority.Background, new Action(() => { ListBoxItem item = new ListBoxItem(); item.Content = f.FileSystemInfo.FullName; LB.Items.Add(item); })); }; watcher.Start(); }
private void AWatcher(object sender, RoutedEventArgs e) { Watcher w = new Watcher(); ((MainWindow)Application.Current.MainWindow).Content = w; }
//Kembali ke page Watcher private void backTo(object sender, RoutedEventArgs e) { Watcher p = new Watcher(); ((MainWindow)Application.Current.MainWindow).Content = p; }