Exemple #1
0
        public ProcessContainerViewModel(uint index)
        {
            Index     = index;
            Process   = new ProcessViewModel(Index);
            Processes = new ProcessViewModel[] { Process };

            SetProcessStatusCountCommand = new RelayCommand(obj =>
            {
                if (int.TryParse(obj?.ToString(), out int count))
                {
                    SetProcessStatusCount(count);
                }
            },
                                                            obj =>
            {
                if (obj is null)
                {
                    return(false);
                }
                if (!int.TryParse(obj.ToString(), out int count))
                {
                    return(false);
                }
                return(CanSetProcessStatusCount(count));
            });

            SetArcProcessCountCommand = new RelayCommand(obj =>
            {
                if (int.TryParse(obj?.ToString(), out int count))
                {
                    SetArcProcessCount(count);
                }
            },
                                                         obj =>
            {
                if (obj is null)
                {
                    return(false);
                }
                if (!int.TryParse(obj.ToString(), out int count))
                {
                    return(false);
                }
                return(CanSetArcProcessCount(count));
            });

            SaveCommand      = new RelayCommand(obj => Save(), obj => CanSave());
            GraphShowCommand = new RelayCommand(obj => GraphShow(), obj => CanGraphShow());

            DisplayName = Process.Sign;

            SetProcessStatusCount(4);
            SetArcProcessCount(7);
        }
Exemple #2
0
 public ProcessStatusViewModel(ProcessViewModel process, uint index)
 {
     this.process = process;
     Index        = index;
     Sign         = $"S{FootnotesHelper.Parse(process.Index)}{FootnotesHelper.Parse(Index)}";
 }