using System; using System.Collections.Generic; using System.Collections.ObjectModel; 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.Navigation; using System.Windows.Shapes; using XHandler.Class; using XHandler.Class.DataEx; using XHandler.Controls; using XImagingXhandler.XDAL; namespace XHandler.View.Consumables { /// /// 试剂槽设置页面 /// public partial class ThroughSetting : UserControl { public Labware labware { get; set; } public ThroughSetting() { InitializeComponent(); } public ThroughSetting(Labware l) { InitializeComponent(); labware = l; DataContext = labware; } private void AddGapLabware(int gap) { gridGapLabware.Children.Clear(); GapLabware labware = new GapLabware() { Width = 200, GapWidth = 15, LabwareGap = gap, HorizontalAlignment = HorizontalAlignment.Left, }; gridGapLabware.Children.Add(labware); } private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (labware == null) return; if (Convert.ToDouble(textboxBottomPartHeight.Text.Trim()) > 0) { checkboxThroughBottom.IsChecked = true; } btnLeftSideColor.RGB = labware.labware_color_lside; // 左侧 btnWideColor.RGB = labware.labware_color_front; // 前侧 btnTopColor.RGB = labware.labware_color_top; // 顶面 btnLineColor.RGB = labware.labware_color_line; // 边框线 } private void CheckBox_Checked(object sender, RoutedEventArgs e) { CheckBox btn = (CheckBox)sender; int nGap = 0; if (checkboxWN.IsChecked == true) { nGap = nGap | GapLabware.WN; } if (checkboxWS.IsChecked == true) { nGap = nGap | GapLabware.WS; } if (checkboxEN.IsChecked == true) { nGap = nGap | GapLabware.EN; } if (checkboxES.IsChecked == true) { nGap = nGap | GapLabware.ES; } AddGapLabware(nGap); } #region 宽边颜色 private void btnWideColor_SelectedColorChangedEvent(object sender, EventArgs e) { if (labware == null) { return; } labware.labware_color_front = btnWideColor.RGB; } #endregion #region 窄边颜色 private void btnLeftSideColor_SelectedColorChangedEvent(object sender, EventArgs e) { if (labware == null) { return; } labware.labware_color_lside = btnLeftSideColor.RGB; } #endregion #region 顶部颜色 private void btnTopColor_SelectedColorChangedEvent(object sender, EventArgs e) { if (labware == null) { return; } labware.labware_color_top = btnTopColor.RGB; } #endregion #region 边线颜色 private void btnLineColor_SelectedColorChangedEvent(object sender, EventArgs e) { if (labware == null) { return; } labware.labware_color_line = btnLineColor.RGB; } #endregion private void checkboxThroughBottom_Checked(object sender, RoutedEventArgs e) { if (checkboxThroughBottom.IsChecked == true) { textblockBottomPartHeight.Visibility = Visibility.Visible; textboxBottomPartHeight.Visibility = Visibility.Visible; imageBottomPartHeight.Visibility = Visibility.Visible; } else { textblockBottomPartHeight.Visibility = Visibility.Collapsed; textboxBottomPartHeight.Visibility = Visibility.Collapsed; imageBottomPartHeight.Visibility = Visibility.Collapsed; } } } }