WPF(XAML, XBAP, .Net3.5)GUIプログラミング Part5at TECH
WPF(XAML, XBAP, .Net3.5)GUIプログラミング Part5 - 暇つぶし2ch204:デフォルトの名無しさん
10/01/26 22:47:28
補足、作法にのっとるなら依存関係プロパティ
public 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}"/>


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch