private void U_Click(object sender, RoutedEventArgs e) { Model.IconButton2 b = (Model.IconButton2)sender; string fullname = b.Text2 + @"\" + b.Text; App.PPtWatcher.OpenFile(fullname); }
private void App_Inventories_AddItem(string obj) { Dispatcher.Invoke(() => { FileInfo f = new FileInfo(obj); Model.IconButton2 u = new Model.IconButton2 { Icon = "\xe8ae", Text = f.Name, Text2 = f.DirectoryName }; u.Click += U_Click; StackPanel.Children.Add(u); }); }