public PlanPropertyBindingViewModel(PlanElementBindingItem planElementBindingItem) { Title = "Выбор привязки"; PlanElementBindingItem = planElementBindingItem; GlobalVariables = ClientManager.SystemConfiguration.AutomationConfiguration.GlobalVariables; SelectedGlobalVariable = GlobalVariables.FirstOrDefault(x => x.Uid == planElementBindingItem.GlobalVariableUID); }
protected virtual void CopyProperties() { ElementBase.Copy(this.ElementRectangle, this); StrokeThickness = ElementRectangle.BorderThickness; BackgroundColor = ElementRectangle.BackgroundColor.ToWindowsColor(); BorderColor = ElementRectangle.BorderColor.ToWindowsColor(); PlanElementBindingItems = new List<PlanElementBindingItem>(); if (ElementRectangle.PlanElementBindingItems != null && ElementRectangle.PlanElementBindingItems.Count > 0) foreach (var planElementBindingItem in ElementRectangle.PlanElementBindingItems) { var planElementBindingItemClone = new PlanElementBindingItem() { PropertyName = planElementBindingItem.PropertyName, GlobalVariableUID = planElementBindingItem.GlobalVariableUID }; PlanElementBindingItems.Add(planElementBindingItemClone); } }