I started using the RadStyleSheetManager and realized that it is more of a pain to use then not use since there is no proxy version. So I created a custom StyleSheetManagerProxy control that can be used in combination with the RadStyleSheetManagerProxy similar to the RadScriptManager and ScriptManagerProxy.
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.PersistenceModeAttribute
Namespace CustomControls
<ParseChildren(True)>
<PersistChildren(False)>
Public Class StyleSheetManagerProxy
Inherits Control
#Region "Events"
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
Dim rssm As RadStyleSheetManager = RadStyleSheetManager.GetCurrent(Me.Page)
If rssm IsNot Nothing Then Me.StyleSheets.ToList().ForEach(Sub(i) rssm.StyleSheets.Add(i))
MyBase.OnLoad(e)
End Sub
#End Region
#Region "Properties"
Private m_StyleSheets As StyleSheetReferenceCollection
<PersistenceMode(PersistenceMode.InnerProperty)>
<DefaultValue(CType(Nothing, String))>
<MergableProperty(False)>
Public ReadOnly Property StyleSheets As StyleSheetReferenceCollection
Get
If m_StyleSheets Is Nothing Then m_StyleSheets = New StyleSheetReferenceCollection()
Return m_StyleSheets
End Get
End Property
#End Region
End Class
End Namespace
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.PersistenceModeAttribute
Namespace CustomControls
<ParseChildren(True)>
<PersistChildren(False)>
Public Class StyleSheetManagerProxy
Inherits Control
#Region "Events"
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
Dim rssm As RadStyleSheetManager = RadStyleSheetManager.GetCurrent(Me.Page)
If rssm IsNot Nothing Then Me.StyleSheets.ToList().ForEach(Sub(i) rssm.StyleSheets.Add(i))
MyBase.OnLoad(e)
End Sub
#End Region
#Region "Properties"
Private m_StyleSheets As StyleSheetReferenceCollection
<PersistenceMode(PersistenceMode.InnerProperty)>
<DefaultValue(CType(Nothing, String))>
<MergableProperty(False)>
Public ReadOnly Property StyleSheets As StyleSheetReferenceCollection
Get
If m_StyleSheets Is Nothing Then m_StyleSheets = New StyleSheetReferenceCollection()
Return m_StyleSheets
End Get
End Property
#End Region
End Class
End Namespace