public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var controlFactory = new GuiControlFactory(_guiSkinService.Skin);
            var style          = (GuiControlStyle)_styleConverter.ReadJson(reader, objectType, existingValue, serializer);
            var skin           = (string)style[_styleProperty];
            var control        = controlFactory.Create(style.TargetType, skin);

            object childControls;

            if (style.TryGetValue(nameof(GuiControl.Controls), out childControls))
            {
                var controlCollection = childControls as GuiControlCollection;

                if (controlCollection != null)
                {
                    foreach (var child in controlCollection)
                    {
                        control.Controls.Add(child);
                    }
                }
            }

            style.Apply(control);
            return(control);
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var skin     = _guiSkinService.Skin;
            var style    = (GuiControlStyle)_styleConverter.ReadJson(reader, objectType, existingValue, serializer);
            var template = GetControlTemplate(style);
            var control  = skin.Create(style.TargetType, template);

            object childControls;

            if (style.TryGetValue(nameof(GuiControl.Controls), out childControls))
            {
                var controlCollection = childControls as GuiControlCollection;

                if (controlCollection != null)
                {
                    foreach (var child in controlCollection)
                    {
                        control.Controls.Add(child);
                    }
                }
            }

            style.Apply(control);
            return(control);
        }