public LayoutPropertiesViewModel(Layout layout, LayoutUsersViewModel layoutUsersViewModel)
		{
			Title = "Свойства элемента: Шаблон интерфейса ОЗ";
			Layout = layout ?? new Layout();
			LayoutUsersViewModel = layoutUsersViewModel;
			LayoutUsersViewModel.Update(Layout);
			CopyProperties();
		}
Ejemplo n.º 2
0
		public void Update(Layout layout)
		{
			_locked = true;
			_layout = layout;
			if (_layout != null)
				for (int i = _layout.Users.Count - 1; i >= 0; i--)
					if (!_map.ContainsKey(_layout.Users[i]))
						_layout.Users.RemoveAt(i);
			foreach (var layoutUserViewModel in Users)
				layoutUserViewModel.IsActive = _layout != null && _layout.Users.Contains(layoutUserViewModel.User.UID);
			SelectedUser = Users.FirstOrDefault();
			_locked = false;
		}
Ejemplo n.º 3
0
		public void Update(Layout layout)
		{
			_layout = layout;
			var map = new Dictionary<Guid, int>();
			if (_layout != null)
				foreach (var layoutPart in _layout.Parts)
					if (map.ContainsKey(layoutPart.DescriptionUID))
						map[layoutPart.DescriptionUID]++;
					else
						map.Add(layoutPart.DescriptionUID, 1);
			foreach (var layoutPart in LayoutParts)
				if (map.ContainsKey(layoutPart.LayoutPartDescription.UID))
					layoutPart.Count = map[layoutPart.LayoutPartDescription.UID];
				else
					layoutPart.Count = 0;
			SelectedLayoutPart = LayoutParts.FirstOrDefault();
		}
Ejemplo n.º 4
0
		public LayoutViewModel(Layout layout)
		{
			Layout = layout;
		}
Ejemplo n.º 5
0
		public void Update(Layout layout)
		{
			using (new WaitWrapper())
			{
				if (_layout != null)
					SaveLayout();
				_layout = layout;
				_currentLayoutChanged = false;
				if (_layout != null && Manager != null)
				{
					var layoutParts = new ObservableCollection<LayoutPartViewModel>();
					foreach (var layoutPart in _layout.Parts)
						layoutParts.Add(new LayoutPartViewModel(layoutPart));
					LayoutParts = layoutParts;
					_loading = true;
					Manager.GridSplitterWidth = _layout.SplitterSize;
					Manager.GridSplitterHeight = _layout.SplitterSize;
					Manager.GridSplitterBackground = new SolidColorBrush(_layout.SplitterColor);
					Manager.BorderBrush = new SolidColorBrush(_layout.BorderColor);
					Manager.BorderThickness = new Thickness(_layout.BorderThickness);
					Manager.Background = new SolidColorBrush(_layout.BackgroundColor);
					Manager.Padding = new Thickness(_layout.Padding);
					Manager.Layout = new LayoutRoot();
					if (!string.IsNullOrEmpty(_layout.Content))
						using (var tr = new StringReader(_layout.Content))
							_serializer.Deserialize(tr);
					_loading = false;
					ActiveLayoutPart = LayoutParts.FirstOrDefault();
				}
			}
		}