public NamenUndFarbenViewModel() { Colors = TagManagement.AllColors.Select(c => c.Value).ToList(); var refreshTags = new Action(() => { Name0 = TagManagement.Instance.Value.Tags[0].Name; Name1 = TagManagement.Instance.Value.Tags[1].Name; Name2 = TagManagement.Instance.Value.Tags[2].Name; Name3 = TagManagement.Instance.Value.Tags[3].Name; Name4 = TagManagement.Instance.Value.Tags[4].Name; Name5 = TagManagement.Instance.Value.Tags[5].Name; Color0 = TagManagement.Instance.Value.Tags[0].Color; Color1 = TagManagement.Instance.Value.Tags[1].Color; Color2 = TagManagement.Instance.Value.Tags[2].Color; Color3 = TagManagement.Instance.Value.Tags[3].Color; Color4 = TagManagement.Instance.Value.Tags[4].Color; Color5 = TagManagement.Instance.Value.Tags[5].Color; QrCodeVisible0 = TagManagement.Instance.Value.Tags[0].QrCodeVisible == Visibility.Visible; QrCodeVisible1 = TagManagement.Instance.Value.Tags[1].QrCodeVisible == Visibility.Visible; QrCodeVisible2 = TagManagement.Instance.Value.Tags[2].QrCodeVisible == Visibility.Visible; QrCodeVisible3 = TagManagement.Instance.Value.Tags[3].QrCodeVisible == Visibility.Visible; QrCodeVisible4 = TagManagement.Instance.Value.Tags[4].QrCodeVisible == Visibility.Visible; QrCodeVisible5 = TagManagement.Instance.Value.Tags[5].QrCodeVisible == Visibility.Visible; }); refreshTags(); TagManagement.Instance.Value.OnTagsChanged += refreshTags; Close = new Command(o => { WindowVisible = Visibility.Collapsed; }); Save = new Command(o => { TagManagement.Instance.Value.Update(new Dictionary<long, TagManagement.Data> { { 0, new TagManagement.Data { Name = Name0, Color = Color0, QrCodeVisible = QrCodeVisible0 ? Visibility.Visible : Visibility.Collapsed } }, { 1, new TagManagement.Data { Name = Name1, Color = Color1, QrCodeVisible = QrCodeVisible1 ? Visibility.Visible : Visibility.Collapsed } }, { 2, new TagManagement.Data { Name = Name2, Color = Color2, QrCodeVisible = QrCodeVisible2 ? Visibility.Visible : Visibility.Collapsed } }, { 3, new TagManagement.Data { Name = Name3, Color = Color3, QrCodeVisible = QrCodeVisible3 ? Visibility.Visible : Visibility.Collapsed } }, { 4, new TagManagement.Data { Name = Name4, Color = Color4, QrCodeVisible = QrCodeVisible4 ? Visibility.Visible : Visibility.Collapsed } }, { 5, new TagManagement.Data { Name = Name5, Color = Color5, QrCodeVisible = QrCodeVisible5 ? Visibility.Visible : Visibility.Collapsed } }, }); }); }
public KonsoleViewModel() { Close = new Command(o => { WindowVisible = Visibility.Collapsed; }); KonsoleItems = new ObservableCollection<string>(); RemoteZentrale.Instance.Value.OnLog += Value_OnLog; }
public TagVisualModel() { MasterMenuVisible = Visibility.Collapsed; NamenUndFarben = new Command(o => { TagManagement.Instance.Value.RaiseShowNamenUndFarben(); }); Konsole = new Command(o => { TagManagement.Instance.Value.RaiseShowKonsole(); }); }