using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; namespace AIRS { /// /// DirectionWindow.xaml 的交互逻辑 /// public partial class DirectionWindow : Window { public DirectionWindow() { InitializeComponent(); directionnum = 0; Uri uri100 = new Uri("img/u100.png", UriKind.RelativeOrAbsolute); Uri uri103 = new Uri("img/u103.png", UriKind.RelativeOrAbsolute); BitmapImage bi100 = new BitmapImage(uri100); BitmapImage bi103 = new BitmapImage(uri103); imgS.Source = bi100; imgH.Source = bi103; } public int directionnum=-1; private void Btn_CanelClick(object sender, RoutedEventArgs e) { this.DialogResult = false; } private void Btn_OKClick(object sender, RoutedEventArgs e) { if (directionnum != -1) { this.DialogResult = true; } else { MessageBox.Show("没选带状方向"); } } private void Btn_SClick(object sender, RoutedEventArgs e) { directionnum = 0; Uri uri100 = new Uri("img/u100.png", UriKind.RelativeOrAbsolute); Uri uri103 = new Uri("img/u103.png", UriKind.RelativeOrAbsolute); BitmapImage bi100 = new BitmapImage(uri100); BitmapImage bi103 = new BitmapImage(uri103); imgS.Source = bi100; imgH.Source = bi103; } private void Btn_HClick(object sender, RoutedEventArgs e) { directionnum = 1; Uri uri100 = new Uri("img/u100.png", UriKind.RelativeOrAbsolute); Uri uri103 = new Uri("img/u103.png", UriKind.RelativeOrAbsolute); BitmapImage bi100 = new BitmapImage(uri100); BitmapImage bi103 = new BitmapImage(uri103); imgH.Source=bi100; imgS.Source = bi103; //Uri uri = new Uri("img/u100.png", UriKind.RelativeOrAbsolute); //BitmapImage bi = new BitmapImage(); //bi.BeginInit(); //bi.CacheOption = BitmapCacheOption.OnLoad; //bi.UriSource = uri; //bi.EndInit(); } } }