C# Class Microsoft.Phone.Controls.ToggleSwitch

Inheritance: System.Windows.Controls.ContentControl
Show file Open project: nokiadatagathering/WP7-Official Class Usage Examples

Public Properties

Property Type Description
HeaderProperty System.Windows.DependencyProperty
HeaderTemplateProperty System.Windows.DependencyProperty
IsCheckedProperty System.Windows.DependencyProperty
SwitchForegroundProperty System.Windows.DependencyProperty

Private Properties

Property Type Description
ChangeVisualState void
OnChecked void
OnClick void
OnIndeterminate void
OnIsCheckedChanged void
OnUnchecked void
SetDefaultContent void

Public Methods

Method Description
OnApplyTemplate ( ) : void

Gets all the template parts and initializes the corresponding state.

ToString ( ) : string

Returns a T:System.String that represents the current T:System.Object .

ToggleSwitch ( ) : System

Initializes a new instance of the ToggleSwitch class.

Protected Methods

Method Description
OnContentChanged ( object oldContent, object newContent ) : void

Makes the content an "Off" or "On" string to match the state if the content is set to null in the design tool.

Private Methods

Method Description
ChangeVisualState ( bool useTransitions ) : void

Change the visual state.

OnChecked ( object sender, RoutedEventArgs e ) : void

Mirrors the E:System.Windows.Controls.Primitives.ToggleButton.Checked event.

OnClick ( object sender, RoutedEventArgs e ) : void

Mirrors the E:System.Windows.Controls.Primitives.ToggleButton.Click event.

OnIndeterminate ( object sender, RoutedEventArgs e ) : void

Mirrors the E:System.Windows.Controls.Primitives.ToggleButton.Indeterminate event.

OnIsCheckedChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Invoked when the IsChecked DependencyProperty is changed.

OnUnchecked ( object sender, RoutedEventArgs e ) : void

Mirrors the E:System.Windows.Controls.Primitives.ToggleButton.Unchecked event.

SetDefaultContent ( ) : void

Makes the content an "Off" or "On" string to match the state.

Method Details

OnApplyTemplate() public method

Gets all the template parts and initializes the corresponding state.
public OnApplyTemplate ( ) : void
return void

OnContentChanged() protected method

Makes the content an "Off" or "On" string to match the state if the content is set to null in the design tool.
protected OnContentChanged ( object oldContent, object newContent ) : void
oldContent object The old content.
newContent object The new content.
return void

ToString() public method

Returns a T:System.String that represents the current T:System.Object .
public ToString ( ) : string
return string

ToggleSwitch() public method

Initializes a new instance of the ToggleSwitch class.
public ToggleSwitch ( ) : System
return System

Property Details

HeaderProperty public static property

Identifies the Header DependencyProperty.
public static DependencyProperty,System.Windows HeaderProperty
return System.Windows.DependencyProperty

HeaderTemplateProperty public static property

Identifies the HeaderTemplate DependencyProperty.
public static DependencyProperty,System.Windows HeaderTemplateProperty
return System.Windows.DependencyProperty

IsCheckedProperty public static property

Identifies the IsChecked DependencyProperty.
public static DependencyProperty,System.Windows IsCheckedProperty
return System.Windows.DependencyProperty

SwitchForegroundProperty public static property

Identifies the SwitchForeground DependencyProperty.
public static DependencyProperty,System.Windows SwitchForegroundProperty
return System.Windows.DependencyProperty