Edit

Share via


LoginView.OnViewChanged(EventArgs) Method

Definition

Raises the ViewChanged event after the LoginView control switches views.

protected:
 virtual void OnViewChanged(EventArgs ^ e);
protected virtual void OnViewChanged (EventArgs e);
abstract member OnViewChanged : EventArgs -> unit
override this.OnViewChanged : EventArgs -> unit
Protected Overridable Sub OnViewChanged (e As EventArgs)

Parameters

e
EventArgs

An EventArgs object that contains the event data.

Remarks

When the LoginView control switches views, it removes the controls from the previous template and creates new child controls from the new template. The OnViewChanged method is called after the new child controls are created.

Use the OnViewChanged method to perform any processing, such as data binding, necessary to initialize the controls on the new view.

Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising Events.

The OnViewChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors

When overriding OnViewChanged(EventArgs) in a derived class, be sure to call the base class' OnViewChanged(EventArgs) method so that registered delegates receive the event.

Applies to

See also