WeakEventManager.DeliverEvent(Object, 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.
Delivers the event being managed to each listener.
protected:
void DeliverEvent(System::Object ^ sender, EventArgs ^ args);
protected void DeliverEvent (object sender, EventArgs args);
member this.DeliverEvent : obj * EventArgs -> unit
Protected Sub DeliverEvent (sender As Object, args As EventArgs)
Parameters
- sender
- Object
The object on which the event is being handled.
Remarks
Call the DeliverEvent method from within the event handlers that are added or removed by the StartListening and StopListening implementations of subclasses.
If you call the ProtectedAddListener method in your AddListener
implementation of your class, the list of listeners receiving the event is kept in an underlying collection. (AddListener
is not part of an interface or class contract. AddListener
is the suggested name for the method of your manager class that calls ProtectedAddListener and adds weak event pattern listeners for the event.)
ProtectedAddListener adds listeners to a single list. If your manager implementation maintains more than one list of listeners per event, do not use DeliverEvent or ProtectedAddListener. Instead, your implementation should create its own WeakEventManager.ListenerList instances, AddListener
should add listeners to the appropriate list, and events should be delivered to the appropriate listener list by calling DeliverEventToList.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기