コード例 #1
0
        public void SetStepChecked(object UserControlViewModel)
        {
            var item = SopList.FirstOrDefault(x => x.SOPItems.Any(y => y.UserControlModel.Any(z => z == UserControlViewModel)));

            if (item == null)
            {
                return;
            }
            item.ImgCheckedSource = "images/true.png";
            item.IsChecked        = true;
        }
コード例 #2
0
        private void AddNewSOP(List <MessageTypeSOPDTO> List)
        {
            if (List == null || List.Count == 0)
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    if (SopList.Count > 0)
                    {
                        IsExpanded = true;
                        IsEnabled  = true;
                    }
                    else
                    {
                        IsExpanded = false;
                        IsEnabled  = false;
                    }
                });

                return;
            }

            Application.Current.Dispatcher.Invoke(() =>
            {
                int count = SopList.Count;

                for (int i = 0; i < count; i++)
                {
                    SopList.RemoveAt(0);
                }
            });


            foreach (var item in List)
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    var sop = new MessageTypeSOPParentModel
                    {
                        IsChecked        = false,
                        BorderBackground = "#252525",
                        ImgCheckedSource = "images/false.png",
                        RankForeground   = "#FFFFFF",
                        MessageTypeId    = item.MessageTypeId,
                        MessageTypeName  = item.MessageTypeName,
                        Rank             = item.Rank,
                        SOPContent       = item.SOPContent,
                        SOPId            = item.SOPId,
                        IsParent         = true,
                        IsExpanded       = false,
                        SOPItems         = new List <MessageTypeSOPModel> {
                            new MessageTypeSOPModel {
                                BorderBackground = "#252525",
                                IsParent         = false,

                                UserControlDetailsControl     = item.SOPDetailsControlName,
                                DetailsUserControlMessageType = item.SOPDetailsDataMessageType,
                                DetailsMessageXSLT            = item.SOPDetailsXSLT,
                                ListMessageXSLT            = item.SOPListXSLT,
                                ListUserControlMessageType = item.SOPListDataMessageType
                            }
                        }
                    };

                    if (!string.IsNullOrEmpty(item.SOPControlName) && sop.SOPItems.Count > 0)
                    {
                        sop.SOPItems[0].UserControlModel = new List <object> {
                            GetUserControlObject(item.SOPControlName, item.SOPListDataMessageType, item.SOPListXSLT)
                        };
                    }
                    SopList.Add(sop);
                });
            }


            Application.Current.Dispatcher.Invoke(() =>
            {
                if (SopList.Count > 0)
                {
                    IsExpanded = true;
                    IsEnabled  = true;
                }
                else
                {
                    IsExpanded = false;
                    IsEnabled  = false;
                }
            });

            var handler = LoadSteps;

            if (handler != null)
            {
                handler(this, new CanvasEventArgs());
            }
        }
コード例 #3
0
 public bool IsAllStepsChecked()
 {
     return(SopList.All(x => x.IsChecked));
 }