LoginView.OnViewChanged(EventArgs) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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.