public ObservableCollectionMapper(ConstructModel constructModel, GetEntity getEntity, UpdateModel updateModel, Comparison <TViewModel> comparison)
 {
     this.constructModel = constructModel;
     this.getEntity      = getEntity;
     this.updateModel    = updateModel;
     this.comparison     = comparison;
 }
예제 #2
0
        private void SetPosition()
        {
            VisibilityList.Clear();


            for (int i = 0; i < deptList.Count; i++)
            {
                var menu = new ConstructModel();

                menu.ShowVisibility = Convert.ToBoolean(deptList[i].Visibility);


                VisibilityList.Add(menu);
            }
        }
예제 #3
0
        public ConstructViewModel(IRegionManager regionManager, IEventAggregator ea)
        {
            _regionManager    = regionManager;
            _ea               = ea;
            deptList          = ConstructModel.XmlParser();
            RetrunViewCommand = new DelegateCommand <object>(RetrunView);
            var dept      = new string[] { "주민", "지적", "인감" };
            var deptIndex = 0;

            for (int i = 0; i < deptList.Count; i++)
            {
                var user = new NameCard();
                user.Name = deptList[i].Name;
                user.Team = deptList[i].Team;
                user.Work = deptList[i].Work;
                user.Tel  = deptList[i].Tel;

                user.ImagePath = System.IO.Path.GetFullPath($"D:\\images\\Construct\\{i}.jpg");

                user.DeptIndex = i;
                user.Dept      = deptList[i].Dept;

                user.OnClick += User_OnClick;
                UserList.Add(user);
            }

            SelectCommand = new DelegateCommand <string>(x =>
            {
                //_ea.GetEvent<VideoTimerResetEvent>().Publish(Message);

                var n = int.Parse(x);
                foreach (var item in UserList)
                {
                    item.IsSelected = item.DeptIndex == n;
                }
            });

            PopupCloseCommand = new DelegateCommand(() =>
            {
                //_ea.GetEvent<VideoTimerResetEvent>().Publish(Message);

                ShowPopup    = Visibility.Collapsed;
                SelectedItem = null;
            });

            SetPosition();
        }