You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
132 lines
4.0 KiB
C#
132 lines
4.0 KiB
C#
using CommonFunc;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
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;
|
|
|
|
namespace XGL.UControl
|
|
{
|
|
/// <summary>
|
|
/// UCMix.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class UCMix : UserControl
|
|
{
|
|
public UCMix()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
#region 缓存区域缓存数量
|
|
/// <summary>
|
|
/// 缓存区域缓存数量
|
|
/// </summary>
|
|
public string TotalNum
|
|
{
|
|
get
|
|
{
|
|
return (string)GetValue(TotalNumProperty);
|
|
}
|
|
set
|
|
{
|
|
SetValue(TotalNumProperty, value);
|
|
}
|
|
}
|
|
|
|
public static DependencyProperty TotalNumProperty =
|
|
DependencyProperty.Register("TotalNum", typeof(string), typeof(UCMix), new PropertyMetadata("", new PropertyChangedCallback(TotalNumPropertyChanged))); //属性默认值
|
|
|
|
private static void TotalNumPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
var control = d as UCMix;
|
|
control.txtTotal.Text = e.NewValue.ToString();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MethodInfo method = (MethodInfo)MethodBase.GetCurrentMethod();
|
|
Common.Log.Error(method.DeclaringType.FullName + "-" + method.Name + "\r\n" + ex.Message + "\r\n" + ex.StackTrace);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 产品型号
|
|
/// <summary>
|
|
/// 产品型号
|
|
/// </summary>
|
|
public string ProdDesc
|
|
{
|
|
get
|
|
{
|
|
return (string)GetValue(ProdDescProperty);
|
|
}
|
|
set
|
|
{
|
|
SetValue(ProdDescProperty, value);
|
|
}
|
|
}
|
|
|
|
public static DependencyProperty ProdDescProperty =
|
|
DependencyProperty.Register("ProdDesc", typeof(string), typeof(UCMix), new PropertyMetadata("", new PropertyChangedCallback(ProdDescPropertyChanged))); //属性默认值
|
|
|
|
private static void ProdDescPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
var control = d as UCMix;
|
|
control.lblProd1.Content = e.NewValue.ToString();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MethodInfo method = (MethodInfo)MethodBase.GetCurrentMethod();
|
|
Common.Log.Error(method.DeclaringType.FullName + "-" + method.Name + "\r\n" + ex.Message + "\r\n" + ex.StackTrace);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 产品型号2
|
|
/// <summary>
|
|
/// 产品型号
|
|
/// </summary>
|
|
public string ProdDesc2
|
|
{
|
|
get
|
|
{
|
|
return (string)GetValue(ProdDesc2Property);
|
|
}
|
|
set
|
|
{
|
|
SetValue(ProdDesc2Property, value);
|
|
}
|
|
}
|
|
|
|
public static DependencyProperty ProdDesc2Property =
|
|
DependencyProperty.Register("ProdDesc", typeof(string), typeof(UCMix), new PropertyMetadata("", new PropertyChangedCallback(ProdDesc2PropertyChanged))); //属性默认值
|
|
|
|
private static void ProdDesc2PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
var control = d as UCMix;
|
|
control.lblProd2.Content = e.NewValue.ToString();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MethodInfo method = (MethodInfo)MethodBase.GetCurrentMethod();
|
|
Common.Log.Error(method.DeclaringType.FullName + "-" + method.Name + "\r\n" + ex.Message + "\r\n" + ex.StackTrace);
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|