コード例 #1
0
        public MainViewDirver(dynamic mainView)
        {
            var w = new WindowControl(mainView);

            //指定のオブジェクトを起点とした
            //ロジカルツリー中にあるLhsというパスにバインドされている要素のコレクション
            //Identifyは一つだけであることを保障する
            //コレクションの要素が1以外だった場合は例外発生
            w.LogicalTree().ByBinding("Lhs").Identify();

            //ビジュアルツリーでは、こんな感じで書く
            w.VisualTree().ByBinding("Lhs").Identify();

            //データアイテムを指定して、さらに厳密な指定にできる
            var dataItem = new ExplicitVar(w.Dynamic().DataContext);

            w.LogicalTree().ByBinding("Lhs", dataItem).Identify();


            Lhs              = new WPFTextBox(w.LogicalTree().ByBinding("Lhs").Identify());
            CalculateTypes   = new WPFComboBox(w.LogicalTree().ByBinding("CalculateTypes").Identify());
            Rhs              = new WPFTextBox(w.LogicalTree().ByBinding("Rhs").Identify());
            CalculateCommand = new WPFButtonBase(w.LogicalTree().ByBinding("CalculateCommand").Identify());
            Answer           = w.LogicalTree().ByBinding("Answer").Identify().Dynamic();
        }
コード例 #2
0
 public static WPFDependencyObjectCollection ByBinding(this WPFDependencyObjectCollection collection, string path, ExplicitVar dataItem = null)
 {
     return(new WPFDependencyObjectCollection(collection.AppVar.App.Type(typeof(BindingSearchExtensions)).ByBindingCore(collection, dataItem, path)));
 }