Type.registerNamespace("SitefinityWebApp.Controls");
     
     
    SitefinityWebApp.Controls.CustomWidgetDesigner = function (element) {
     
        this._templatesSelector = null;
        
        /* Calls the base constructor */
         
        SitefinityWebApp.Controls.CustomWidgetDesigner.initializeBase(this, [element]);
    }
     
    
    SitefinityWebApp.Controls.CustomWidgetDesigner.prototype = {
        /* --------------------------------- set up and tear down --------------------------------- */
        initialize: function () {
            /* Here you can attach to events or do other initialization */
          
            SitefinityWebApp.Controls.CustomWidgetDesigner.callBaseMethod(this, 'initialize');
     
        },
        dispose: function () {
            /* this is the place to unbind/dispose the event handlers created in the initialize method */
     
            SitefinityWebApp.Controls.CustomWidgetDesigner.callBaseMethod(this, 'dispose');
        },
     
        /* --------------------------------- public methods ---------------------------------- */
     
        /* Called when the designer window gets opened and here is place to "bind" your designer to the control properties */
        refreshUI: function () {
            var controlData = this._propertyEditor.get_control(); /* JavaScript clone of your control - all the control properties will be properties of the controlData too */
     
            /* RefreshUI Message */
            this.get_templatesSelector().refreshUI();
        },
     
        /* Called when the "Save" button is clicked. Here you can transfer the settings from the designer to the control */
        applyChanges: function () {
            var controlData = this._propertyEditor.get_control();
     
            /* ApplyChanges Message */
            this.get_templatesSelector().applyChanges();
        },
     
     
        /* --------------------------------- properties -------------------------------------- */
        get_templatesSelector: function () { return this._templatesSelector; },
        set_templatesSelector: function (value) { this._templatesSelector = value; }
    }
     
    SitefinityWebApp.Controls.CustomWidgetDesigner.registerClass('SitefinityWebApp.Controls.CustomWidgetDesigner', Telerik.Sitefinity.Web.UI.ControlDesign.ControlDesignerBase);