DirectionWindow.xaml.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Shapes;
  14. namespace AIRS
  15. {
  16. /// <summary>
  17. /// DirectionWindow.xaml 的交互逻辑
  18. /// </summary>
  19. public partial class DirectionWindow : Window
  20. {
  21. public DirectionWindow()
  22. {
  23. InitializeComponent();
  24. directionnum = 0;
  25. Uri uri100 = new Uri("img/u100.png", UriKind.RelativeOrAbsolute);
  26. Uri uri103 = new Uri("img/u103.png", UriKind.RelativeOrAbsolute);
  27. BitmapImage bi100 = new BitmapImage(uri100);
  28. BitmapImage bi103 = new BitmapImage(uri103);
  29. imgS.Source = bi100;
  30. imgH.Source = bi103;
  31. }
  32. public int directionnum=-1;
  33. private void Btn_CanelClick(object sender, RoutedEventArgs e)
  34. {
  35. this.DialogResult = false;
  36. }
  37. private void Btn_OKClick(object sender, RoutedEventArgs e)
  38. {
  39. if (directionnum != -1)
  40. {
  41. this.DialogResult = true;
  42. }
  43. else
  44. {
  45. MessageBox.Show("没选带状方向");
  46. }
  47. }
  48. private void Btn_SClick(object sender, RoutedEventArgs e)
  49. {
  50. directionnum = 0;
  51. Uri uri100 = new Uri("img/u100.png", UriKind.RelativeOrAbsolute);
  52. Uri uri103 = new Uri("img/u103.png", UriKind.RelativeOrAbsolute);
  53. BitmapImage bi100 = new BitmapImage(uri100);
  54. BitmapImage bi103 = new BitmapImage(uri103);
  55. imgS.Source = bi100;
  56. imgH.Source = bi103;
  57. }
  58. private void Btn_HClick(object sender, RoutedEventArgs e)
  59. {
  60. directionnum = 1;
  61. Uri uri100 = new Uri("img/u100.png", UriKind.RelativeOrAbsolute);
  62. Uri uri103 = new Uri("img/u103.png", UriKind.RelativeOrAbsolute);
  63. BitmapImage bi100 = new BitmapImage(uri100);
  64. BitmapImage bi103 = new BitmapImage(uri103);
  65. imgH.Source=bi100;
  66. imgS.Source = bi103;
  67. //Uri uri = new Uri("img/u100.png", UriKind.RelativeOrAbsolute);
  68. //BitmapImage bi = new BitmapImage();
  69. //bi.BeginInit();
  70. //bi.CacheOption = BitmapCacheOption.OnLoad;
  71. //bi.UriSource = uri;
  72. //bi.EndInit();
  73. }
  74. }
  75. }