LoginView.OnViewChanged(EventArgs) Método
Definição
Gera o evento ViewChanged após o controle LoginView mudar as exibições.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)
Parâmetros
Comentários
Quando o LoginView controle alterna as exibições, ele remove os controles do modelo anterior e cria novos controles filho a partir do novo modelo.When the LoginView control switches views, it removes the controls from the previous template and creates new child controls from the new template. O OnViewChanged método é chamado depois que os novos controles filho são criados.The OnViewChanged method is called after the new child controls are created.
Use o OnViewChanged método para executar qualquer processamento, como associação de dados, necessário para inicializar os controles na nova exibição.Use the OnViewChanged method to perform any processing, such as data binding, necessary to initialize the controls on the new view.
A geração de um evento invoca o manipulador de eventos por meio de um delegado.Raising an event invokes the event handler through a delegate. Para obter mais informações, consulte manipulando e gerando eventos.For more information, see Handling and Raising Events.
O OnViewChanged método também permite que classes derivadas manipulem o evento sem anexar um delegado.The OnViewChanged method also allows derived classes to handle the event without attaching a delegate. Essa é a técnica preferida para manipular o evento em uma classe derivada.This is the preferred technique for handling the event in a derived class.
Notas aos Herdeiros
Ao substituir OnViewChanged(EventArgs) em uma classe derivada, não se esqueça de chamar o método da classe base OnViewChanged(EventArgs) para que os delegados registrados recebam o evento.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.