Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <TextBlock>
  2. <Hyperlink Click="openFile_Click">Open File</Hyperlink>
  3. </TextBlock>
  4.  
  5. var appPath = System.AppDomain.CurrentDomain.BaseDirectory;
  6.  
  7. private void openFile_Click(object sender, RoutedEventArgs e)
  8. {
  9. System.Diagnostics.Process.Start(appPath + "myFile.txt");
  10. }
  11.  
  12. <TextBlock>
  13. <Hyperlink Click="Hyperlink_Click">Click Me..!!</Hyperlink>
  14. </TextBlock>
  15.  
  16. private void Hyperlink_Click(object sender, RoutedEventArgs e)
  17. {
  18. System.Diagnostics.Process.Start("filePath");
  19. }
  20.  
  21. System.Diagnostics.Process.Start("..\..\ABC.txt");
  22.  
  23. System.Diagnostics.Process.Start("ABC.txt");
  24.  
  25. <TextBlock>
  26. <Hyperlink Command="{Binding CommandPath}" CommandParameter=" {Binding Path=RecordID}">
  27. <TextBlock Text="Open File" />
  28. </Hyperlink>
  29. </TextBlock>
  30.  
  31. public ICommand CommandPath { get { return new DelegateCommand(HyperlinkClick); } }
  32.  
  33.  
  34. private void HyperlinkClick()
  35. {
  36. Process.Start(@"notepad.exe", @"C:TEST_FILE.txt");
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement