Esempio n. 1
0
 public MainViewModel()
 {
     Elements                  = new ObservableCollection <ControlElementViewModel>();
     AddElementCommand         = new RelayCommand <Object>(AddCommandExecute);
     ExecuteCommand            = new RelayCommand <Object>(ExecuteCommandExecute);
     SortElementsCommand       = new RelayCommand <Object>(SortElementsCommandExecute);
     ActiveSumControlViewModel = new SumControlViewModel(DateTime.Now, true);
     IsSumPopUpOpen            = false;
     Elements.Add(GetNewElement());
 }
        private void OpenSumCommandExecute(string obj)
        {
            var isIn = String.IsNullOrEmpty(obj) ? false : obj.ToLower() == "true";
            SumControlViewModel vm = new SumControlViewModel(Date, isIn);

            vm.OnClose += (r) =>
            {
                if (isIn)
                {
                    InValue = r;
                }
                else
                {
                    OutValue = r;
                }
                CloseSumPopUp?.Invoke(r);
            };
            OpenSumPopUp?.Invoke(vm);
        }