public CustomPanelToolViewModel(ServiceManager services, CustomPanelInstanceData panelData) : this(services) { m_panelInstanceData = panelData; m_updatingSerializationId = true; this.SerializationId = "ToolCustomPanel|" + CreateSpecificSerializationId(); m_updatingSerializationId = false; this.Title = this.CreateTitle(); panelData.PropertyChanged += PanelData_PropertyChanged; this.UpdateFromBindingState(); }
internal void CreateInstanceDataFromSerializationId(string id) { var parts = id.Split('|'); System.Diagnostics.Debug.Assert(parts.Length >= 2 && parts.Length <= 3); if (parts.Length > 2) { m_panelInstanceData = m_services.Get <ICustomPanelManager>().CreateObjectPanel(parts[1], parts[2]); } else { m_panelInstanceData = m_services.Get <ICustomPanelManager>().CreateStaticPanel(parts[1]); } m_panelInstanceData.PropertyChanged += PanelData_PropertyChanged; this.UpdateFromBindingState(); }