Recent Posts
C++ | 19 sec ago
None | 28 sec ago
C | 31 sec ago
None | 45 sec ago
None | 45 sec ago
Diff | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Anonymous on the 9th of Feb 2010 07:27:30 PM
Download |
Raw |
Embed |
Report
using System;
using System.Windows;
using System.Windows.Data;
namespace dp_test
{
class A : DependencyObject
{
public int Val
{
get { return (int)GetValue(ValProperty); }
set { SetValue(ValProperty, value); }
}
public static readonly DependencyProperty ValProperty =
DependencyProperty.
Register("Val",
typeof(int),
typeof(A
),
null);
}
class B : DependencyObject
{
public int Val
{
get { return (int)GetValue(ValProperty); }
set { SetValue(ValProperty, value); }
}
public static readonly DependencyProperty ValProperty =
DependencyProperty.
Register("Val",
typeof(int),
typeof(B
),
null);
}
class Program
{
static void Main(string[] args)
{
Binding binding
= new Binding
("Val");
binding.Source = bbb;
BindingOperations.SetBinding(aaa, A.ValProperty, binding);
bbb.Val = 7;
Console.WriteLine("A = " + aaa.Val + ", B = " + bbb.Val);
}
}
}
Submit a correction or amendment below.
Make A New Post