private void AddLogo() { Dictionary <string, int> viewAndDoors = new Dictionary <string, int>() { { "ViewA", ListColorVMA.ToList().FindAll(x => x is VMSchemeElement).FindAll(x => (x as VMSchemeElement)?.Name.IndexOf("Дверь") > -1).Count }, { "ViewB", ListColorVMB.ToList().FindAll(x => x is VMSchemeElement).FindAll(x => (x as VMSchemeElement)?.Name.IndexOf("Дверь") > -1).Count }, { "ViewV", ListColorVMV.ToList().FindAll(x => x is VMSchemeElement).FindAll(x => (x as VMSchemeElement)?.Name.IndexOf("Дверь") > -1).Count }, { "ViewG", ListColorVMG.ToList().FindAll(x => x is VMSchemeElement).FindAll(x => (x as VMSchemeElement)?.Name.IndexOf("Дверь") > -1).Count } }; VMSelectLogo vmSelectLogo = new VMSelectLogo(viewAndDoors); SelectLogo slg = new SelectLogo(vmSelectLogo); slg.Closing += Slg_Closing; vmSelectLogo.ToastNotificationTools.Dispatcher = slg.Dispatcher; slg.ShowDialog(); LogoVM lg = vmSelectLogo.GetLogo(); vmSelectLogo.ListLogo.Clear(); if (lg == null) { return; } PaintLogo(lg); //vmSelectLogo.SelectedItemLogo }
public SelectLogo(VMSelectLogo vm) { InitializeComponent(); this.DataContext = vm; if (vm.CloseAction == null) { vm.CloseAction = new Action(this.Close); } }