Beispiel #1
0
        public NameCallingManagementViewModel(NameCallingMangementBussiness calling)
        {
            Calling     = new NameCallingViewModel(calling.NameCalling, calling.ClassSelecter);
            EditCalling = new EditNameCallingViewModel(calling.EditCalling);
            CallingFunc = 0;
            Msg         = new MessageViewModel(true);
            Msg.OnOperateEnableEvent(false, false);

            Calling.ErrOccuredEvent     += Msg.Enable;
            Calling.ShowInfoEvent       += Msg.Enable;
            EditCalling.ErrOccuredEvent += Msg.Enable;
        }
Beispiel #2
0
        public EditNameCallingViewModel(EditNameCallingBussiness nameCalling)
        {
            _nameCalling = nameCalling;
            _nameCalling.CallingsChangedEvent += callings =>
            {
                CallingCollection.Clear();
                if (callings != null)
                {
                    callings.ForEach(c => CallingCollection.Add(c.ClassName));
                }
                _callings       = callings;
                SelectedCalling = -1;
            };

            CallingCollection = new ObservableCollection <string>();
            Calling           = new NameCallingViewModel(nameCalling.Calling, nameCalling.ClassSelecter, false);
            Calling.NameCallingChangedEvent += (op, calling) =>
            {
                _nameCalling.OperateCalling(op, calling);
                _nameCalling.ChangeEditDate(ClassDate);
            };
            Calling.ErrOccuredEvent += (msg, level) => ErrOccuredEvent?.Invoke(msg);
        }