Table of Contents

Class ModeSwitch

Namespace
InSite.UI.Layout.Admin
Assembly
InSite.UI.dll
public class ModeSwitch : UserControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IFilterResolutionService, IAttributeAccessor, INamingContainer, IUserControlDesignerAccessor
Inheritance
ModeSwitch
Implements
Inherited Members

Remarks

Alan wants a Dark theme mode, starting with header navigation. Dark mode now implemented for the Admin header only, and can be more fully implemented in the next release. Note the standard convention is for Light mode to be the default.

Constructors

ModeSwitch()

public ModeSwitch()

Fields

offIcon

offIcon control.

protected HtmlGenericControl offIcon

Field Value

HtmlGenericControl

Remarks

Auto-generated field. To modify move field declaration from designer file to code-behind file.

onIcon

onIcon control.

protected HtmlGenericControl onIcon

Field Value

HtmlGenericControl

Remarks

Auto-generated field. To modify move field declaration from designer file to code-behind file.

themeMode

themeMode control.

protected HtmlInputCheckBox themeMode

Field Value

HtmlInputCheckBox

Remarks

Auto-generated field. To modify move field declaration from designer file to code-behind file.

Properties

CurrentMode

public string CurrentMode { get; set; }

Property Value

string

IconOff

public string IconOff { get; set; }

Property Value

string

IconOn

public string IconOn { get; set; }

Property Value

string

IsChecked

Gets whether checkbox is currently checked

public bool IsChecked { get; set; }

Property Value

bool

Methods

ClearState()

Clears current state and removes the cookie

public void ClearState()

GetCurrentThemeMode()

Gets the current theme mode from the current request

public static string GetCurrentThemeMode()

Returns

string

Page_Load(object, EventArgs)

protected void Page_Load(object sender, EventArgs e)

Parameters

sender object
e EventArgs

Page_PreRender(object, EventArgs)

protected void Page_PreRender(object sender, EventArgs e)

Parameters

sender object
e EventArgs

RefreshStateFromCookie()

Refreshes the mode from the cookie (useful if cookie is modified externally)

public void RefreshStateFromCookie()

ThemeMode_ServerChange(object, EventArgs)

Handles the checkbox state change event

protected void ThemeMode_ServerChange(object sender, EventArgs e)

Parameters

sender object
e EventArgs