-
Notifications
You must be signed in to change notification settings - Fork 500
/
Copy pathPage.xaml.cs
37 lines (33 loc) · 1001 Bytes
/
Page.xaml.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Shapes;
//additional using statements
using Windows.UI.Xaml.Data;
namespace BindingInCode
{
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
//<SnippetBindingObject>
// Create the source string.
string s = "Hello";
// Create the binding description.
Binding b = new Binding();
b.Mode = BindingMode.OneTime;
b.Source = s;
// Attach the binding to the target.
TextBlock MyText = new TextBlock();
MyText.SetBinding(TextBlock.TextProperty, b);
//</SnippetBindingObject>
}
}
}