You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.4 KiB
83 lines
2.4 KiB
2 years ago
|
using BBWYB.Client.Models.PackPurchaseTask;
|
||
|
using BBWYB.Client.Models;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.ComponentModel;
|
||
|
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;
|
||
|
|
||
|
namespace BBWYB.Client.Views.PackPurchaseTask
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// SetCerControl.xaml 的交互逻辑
|
||
|
/// </summary>
|
||
|
public partial class SetCerControl : UserControl
|
||
|
{
|
||
|
public SetCerControl()
|
||
|
{
|
||
|
InitializeComponent();
|
||
|
}
|
||
|
|
||
|
public CertificateModel model
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
return (CertificateModel)GetValue(modelProperty);
|
||
|
|
||
|
}
|
||
|
set
|
||
|
{
|
||
|
SetValue(modelProperty, value);
|
||
|
NotifyPropertyChanged("CertificateModel");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
public static readonly DependencyProperty modelProperty =
|
||
|
DependencyProperty.Register("model", typeof(CertificateModel), typeof(SetCerControl), new PropertyMetadata(ChangedProperty));
|
||
|
|
||
|
public event PropertyChangedEventHandler PropertyChanged;
|
||
|
protected virtual void NotifyPropertyChanged(string propertyName)
|
||
|
{
|
||
|
if (this.PropertyChanged != null)
|
||
|
{
|
||
|
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
private static void ChangedProperty(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||
|
{
|
||
|
var control = d as SetCerControl;
|
||
|
var newValue = e.NewValue as CertificateModel;
|
||
|
if (control != null && newValue != null)
|
||
|
{
|
||
|
control.model = newValue;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void RadioButton_Checked(object sender, RoutedEventArgs e)
|
||
|
{
|
||
|
var rabtn = sender as RadioButton;
|
||
|
if (rabtn != null && rabtn.CommandParameter != null)
|
||
|
{
|
||
|
var labModel = Enum.Parse<CertificateLabelModel>(rabtn.CommandParameter.ToString());
|
||
|
model.LabelModel = labModel;
|
||
|
model.IsLogo = labModel == CertificateLabelModel.标准有3c ? 1 : 0;
|
||
|
}
|
||
|
|
||
|
var data = e.Source as string;
|
||
|
}
|
||
|
}
|
||
|
}
|