private void Deserialize()
        {
            //ensure thread safety
            lock (syncRoot)
            {
                if (!string.IsNullOrEmpty(this.partiallyLoadedXmlData))
                {
                    XmlStyleSheet xmlStyleSheet = new XmlStyleSheet();
                    using (TextReader textReader = new StringReader(this.partiallyLoadedXmlData))
                    {
                        using (XmlReader reader = XmlReader.Create(textReader))
                        {
                            StyleXmlSerializer ser = new StyleXmlSerializer(false);
                            ser.PropertiesProvider = this.propertiesProvider;

                            ser.ReadObjectElement(reader, xmlStyleSheet);
                        }
                    }

                    this.partiallyLoadedXmlData = null;

                    base.PropertySettingGroups.Clear();
                    xmlStyleSheet.DeserializePropertySettingGroups(base.PropertySettingGroups);
                }
                else if (loadedXmlStyleSheet != null)
                {
                    base.PropertySettingGroups.Clear();
                    loadedXmlStyleSheet.DeserializePropertySettingGroups(base.PropertySettingGroups);
                    this.loadedXmlStyleSheet = null;
                }

                this.loaded = true;

                if (this.LoadedCompletely != null)
                {
                    this.LoadedCompletely(this, EventArgs.Empty);

                    //this event occurs only once in the lifetime of the object, so remove the event handlers
                    this.LoadedCompletely = null;
                }
            }
        }