UserControl1.xaml.cs
1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using OS.Spin.ViewModle.Models;
using System.Windows.Controls;
namespace OS.Spin.View.MainWindowControls
{
/// <summary>
/// UserControl1.xaml 的交互逻辑
/// </summary>
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
//Binding binding = new Binding()
//{
// // 数据源
// Source = LableText,
// // 需绑定的数据源属性名
// Path = new PropertyPath("runtimes"),
// // 绑定模式
// Mode = BindingMode.TwoWay,
// UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
//};
// 连接数据源与绑定目标
// BindingOperations.SetBinding(textData, Label.ContentProperty, binding);
textData.DataContext = LableText;
}
private WinData _lableText = new WinData();
//封装属性
public WinData LableText
{
get { return _lableText; }
set
{
_lableText = value;
}
}
}
}