using System; using System.Collections.Generic; using System.Linq; using System.Text; 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.Navigation; using System.Windows.Shapes; using System.Net; using FLY.Thick.Blowing.Client; using FLY.Thick.Base.Client; using ThickTcpUiInWindow; using System.ComponentModel; using FLY.Thick.Blowing.IService; using System.Collections.ObjectModel; using FObjBase; namespace FLY.Thick.Blowing.UI.Fix.Client { /// /// Page_Blowing.xaml 的交互逻辑 /// public partial class PgBlowing : Page { PgBlowingVm viewModel; public PgBlowing() { InitializeComponent(); } public void Init(IPEndPoint serverep) { viewModel = new PgBlowingVm(); viewModel.Init(serverep); this.grid_blowing.DataContext = viewModel.mRenZiJiaService; this.grid_bDetect.DataContext = viewModel.mBDetect; this.grid_viewModel.DataContext = viewModel; } private void Page_Loaded(object sender, RoutedEventArgs e) { } private void Page_Unloaded(object sender, RoutedEventArgs e) { //viewModel.Dispose(); } private void button_apply_click(object sender, RoutedEventArgs e) { viewModel.Apply(); } private void button_cal_click(object sender, RoutedEventArgs e) { //TODO PgBlowingExt p = new PgBlowingExt(); p.Init(viewModel.mRenZiJiaService, viewModel.mBDetect); NavigationService.Navigate(p); } private void button_download_Click(object sender, RoutedEventArgs e) { //if (IsBufListLoading) // return; viewModel.Download(); } private void BackButtonClick(object sender, RoutedEventArgs e) { viewModel.Dispose(); } } public class BoltLengthMultiConverter : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { //FilmVelocity //RenZiJiaPeriod //NBolts if (values.Count() != 3) { return null; } if ((values[0] is double) && (values[1] is TimeSpan) && (values[2] is int)) { double FilmVelocity = (double)values[0]; TimeSpan RenZiJiaPeriod = (TimeSpan)values[1]; int NBolts = (int)values[2]; return RenZiJiaPeriod.TotalMinutes / NBolts * FilmVelocity; } return null; } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } }