Class ModeSwitch
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
Remarks
Auto-generated field. To modify move field declaration from designer file to code-behind file.
onIcon
onIcon control.
protected HtmlGenericControl onIcon
Field Value
Remarks
Auto-generated field. To modify move field declaration from designer file to code-behind file.
themeMode
themeMode control.
protected HtmlInputCheckBox themeMode
Field Value
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
IconOff
public string IconOff { get; set; }
Property Value
IconOn
public string IconOn { get; set; }
Property Value
IsChecked
Gets whether checkbox is currently checked
public bool IsChecked { get; set; }
Property Value
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
Page_Load(object, EventArgs)
protected void Page_Load(object sender, EventArgs e)
Parameters
Page_PreRender(object, EventArgs)
protected void Page_PreRender(object sender, EventArgs e)
Parameters
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)