public PassCardTemplatePropertiesViewModel(PassCardTemplate passCardTemplate)
		{
			Title = "Свойства элемента: План";
			if (passCardTemplate == null)
			{
				passCardTemplate = new PassCardTemplate();
				var width = RegistrySettingsHelper.GetDouble("Administrator.PassCardTemplate.DefaultWidth");
				var height = RegistrySettingsHelper.GetDouble("Administrator.PassCardTemplate.DefaultHeight");
				var color = RegistrySettingsHelper.GetColor("Administrator.PassCardTemplate.DefaultColor");
				if (width != 0)
					passCardTemplate.Width = width;
				if (height != 0)
					passCardTemplate.Height = height;
				passCardTemplate.BackgroundColor = color;
			}
			PassCardTemplate = passCardTemplate;
			ImagePropertiesViewModel = new ImagePropertiesViewModel(PassCardTemplate);
			CopyProperties();
		}
		public void Initialize(PassCardTemplate passCardTemplate)
		{
			PassCardTemplate = passCardTemplate;
			IsNotEmpty = PassCardTemplate != null;
			using (new TimeCounter("\tPassCardDesignerViewModel.Initialize: {0}"))
			using (new WaitWrapper())
			{
				using (new TimeCounter("\t\tDesignerCanvas.Initialize: {0}"))
					((DesignerCanvas)DesignerCanvas).Initialize(PassCardTemplate);
				if (PassCardTemplate != null)
				{
					using (new TimeCounter("\t\tDesignerItem.Create: {0}"))
					{
						foreach (var elementBase in EnumerateElements())
							DesignerCanvas.Create(elementBase);
						DesignerCanvas.UpdateZIndex();
					}
					using (new TimeCounter("\t\tPassCardDesignerViewModel.OnUpdated: {0}"))
						Update();
				}
			}
			ResetHistory();
		}
		public PassCardTemplateViewModel(PassCardTemplate passCardTemplate)
		{
			PassCardTemplate = passCardTemplate;
		}
Example #4
0
		public void Initialize(PassCardTemplate passCardTemplate)
		{
			PassCardTemplate = passCardTemplate;
			Initialize();
		}