【发布时间】:2020-03-23 20:03:16
【问题描述】:
我对 MVVM 有点陌生,我必须说这并不容易...... 正如主题所说,要使用从字典中填充的 ToggleButtons 填充 StackPanel。 有人可以让我的方向正确吗?
你好,Fonzie
public class Soort
{
public int ID;
public Boolean Pressed;
public string shortTitle;
public string Title;
public SolidColorBrush BorderColor;
public SolidColorBrush BackgroundColor;
public int DefaultTime;
}
public static Dictionary<int, Soort> dSoorten = new Dictionary<int, Soort>();
【问题讨论】:
-
使用 ItemsControl。从这里开始阅读:Data Templating Overview.
标签: c# wpf mvvm binding togglebutton