WPF(XAML, XBAP, .Net3.5)GUIプログラミング Part5
■ このスレッドは過去ログ倉庫に格納されています
0204デフォルトの名無しさん
2010/01/26(火) 22:47:28public class Hoge : DependencyObject {
public DependencyProperty IDProperty = DependencyProperty.Register("ID", typeof(int), typeof(Hoge));
public DependencyProperty DataProperty = DependencyProperty.Register("Data", typeof(string), typeof(Hoge));
public int ID {
get { return (int)this.GetValue(IDProperty); }
set { this.SetValue(IDProperty, value); }
}
public string Data {
get { return (string)this.GetValue(DataProperty); }
set { this.SetValue(DataProperty, value); }
}}
これでBindingが使えるようになる。
<d:Hoge ID="0" Data="{Binding Source=button1, XPath=Content}"/>
■ このスレッドは過去ログ倉庫に格納されています