ThemeableAttribute クラス
アセンブリ: System.Web (system.web.dll 内)

<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Property)> _ Public NotInheritable Class ThemeableAttribute Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property)] public sealed class ThemeableAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Class|AttributeTargets::Property)] public ref class ThemeableAttribute sealed : public Attribute

コントロールの開発者は ThemeableAttribute 属性を使用してコントロールの型およびコントロールのメンバを装飾し、テーマとコントロール スキンを反映できるかどうかを示します。既定では、コントロールによって公開されるすべてのプロパティにテーマを反映できます。ただし、一般的には、スタイルに関するプロパティにだけテーマが適用されるよう、スタイルに関係しないすべてのプロパティに明示的に Themeable(false) 属性を適用する必要があります。あるメンバを Themeable(false) 属性を使用して装飾すると、EnableTheming プロパティの値とは関係なく、そのメンバにはテーマを適用できなくなります。たとえば、ThemeableAttribute 属性をあるコントロールに適用して、false に設定すると、そのコントロールの EnableTheming プロパティを true に設定しても、そのコントロールにはテーマが反映されません。
ThemeableAttribute クラスでは、テーマをサポートするすべての型が含まれた静的な一覧が保持されます。また、この一覧は、静的メソッドである IsObjectThemeable および IsTypeThemeable が呼び出されるたびに参照されます。

ThemeableAttribute 属性をコントロールのメンバに適用する方法を次のコード例に示します。この例では、ThemeableAttribute をバインド コントロールに適用し、false を ThemeableAttribute コンストラクタに渡しています。これにより、DataSourceID メンバにテーマを適用できないことを示します (false をこのコンストラクタに渡すと、No フィールドに等しい ThemeableAttribute インスタンスになります)。
Imports System Imports System.Web.UI Imports System.Web.UI.WebControls Public Class SomeDataBoundControl Inherits DataBoundControl ' Implementation of a custom data source control. <Themeable(False)> _ <IDReferenceProperty()> _ Public Overrides Property DataSourceID() As String Get Return MyBase.DataSourceID End Get Set MyBase.DataSourceID = value End Set End Property End Class 'SomeDataBoundControl
namespace Samples.AspNet.CS.Controls { using System; using System.Web.UI; using System.Web.UI.WebControls; public class SomeDataBoundControl : DataBoundControl { // Implementation of a custom data source control. [Themeable(false) ] [IDReferenceProperty()] public override string DataSourceID { get { return base.DataSourceID; } set { base.DataSourceID = value; } } } }


System.Attribute
System.Web.UI.ThemeableAttribute


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- ThemeableAttribute クラスのページへのリンク