步步为盈
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.

86 lines
2.1 KiB

using BBWY.Client.Models;
using BBWY.Client.Models.APIModel.Response.PackTask;
using MathNet.Numerics;
using System;
using System.Collections.Generic;
using System.ComponentModel;
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 BBWY.Client.Views.PackTask
{
/// <summary>
/// SetCerControl.xaml 的交互逻辑
/// </summary>
public partial class SetCerControl : UserControl,INotifyPropertyChanged
{
public SetCerControl()
{
InitializeComponent();
}
//CertificateModel
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;
//control.DataContext = newValue;
//control.OnPropertyChanged(e);
}
}
}
}