public void OnCopyHyperLink_Click(object sender, RoutedEventArgs e) { System.Windows.Controls.MenuItem mi = ((System.Windows.Controls.MenuItem)sender); System.Windows.Controls.ContextMenu cm = mi.CommandParameter as System.Windows.Controls.ContextMenu; System.Windows.Controls.TextBlock txt = cm.PlacementTarget as System.Windows.Controls.TextBlock; System.Windows.Controls.TextBlock lnk = txt.FindName("txtInstallDir") as System.Windows.Controls.TextBlock; Clipboard.SetText(lnk.Text); }
public void DependencyObjectFindNameTest () { TextBlock b = new TextBlock (); CrossThreadTest (() => { b.FindName ("t"); }); }