public SettingsTableViewModel(Sett settings) { SettingsViewModel[] temp = new SettingsViewModel[settings.items.Count]; string[] keys = new string[settings.items.Count]; settings.items.Keys.CopyTo(keys, 0); for (int i = 0; i < settings.items.Count; i++) { temp[i] = new SettingsViewModel(settings.items[keys[i]]); } Items = temp; }
public StationSetup() { InitializeComponent(); Sett s = new Sett(); s.items = new Dictionary <string, SettingsItem>(); foreach (KeyValuePair <string, SettingsItem> pair in Sett.Instance.items) { s.items.Add(pair.Key, pair.Value); } viewModel = new SetupViewModel(s); this.DataContext = viewModel; }
public SetupViewModel(Sett initSettings) { settings = initSettings; }