知りたい人のために説明すると、これは自己安定化アルゴリズムのツールのコンテキストにあります。
次のように定義されたいくつかのクラス 、、Algorithm
、Rule
、Predicate
があるとします。Action
Graph
Node
using System;
using System.Collections.Generic;
using System.Text;
namespace SMP {
class Algorithm {
public List<Rule> Rules { get; set; }
public Algorithm() {
Rules = new List<Rule>();
}
}
class Rule {
public Predicate Predicate { get; set; }
public Action Action { get; set; }
}
class Predicate {
public string Description { get; set; }
public string Name { get; set; }
public string Expression { get; set; }
}
class Action {
public string Description { get; set; }
public string Name { get; set; }
public string Expression { get; set; }
}
}
一部の要素ごとにとListView
を表示する 2 列を接続したいと思います。Predicate.Name
Action.Name
Algorithm.Rules
この投稿で使用している次の変数名に注意してください。
ListView algorithm_view;
Algorithm algorithm
を使用してインスタンスDataContext
にを設定する必要があることはわかっていますが、このようなコレクションのバインドを XAML で表現する方法がわかりません。algorithm_view
Algorithm
algorithm_view.DataContext = algorithm
イメージしやすいように、インターフェースのスクリーンショットを次に示します。