This is in relation to this tutorial. This is used to close the workspace or tab
// workspaces have been declared, as is the _workspace = new Observe Collection & lt; Workspace Viewmodel & gt; (); _Workspace.ClothesChanged + = this.OnWorkspacesChanged; Zero on WorksspaceSank (Object Sender, Notification ChangedEventEurges E) {If (E. Newimes! = Null and a New Newt. Count! = 0) Forchha (Workspace Vivamodel Workspace e New Events) Workspace Request + this.OnWorkspaceRequestClose; If (E. Old Etams! = Null & amp; E. Old Items.Count! = 0) FORCHA (Workspace Visual Model Workspace E. Old ITS) Workspace. Request Clip - = this.OnWorkspaceRequestClose; }
What I can not understand is e. New ETams
and E. The old item may be
. Assume that new item
will contain new items added to the collection, will I attach the event handler? But then it will be singular, because I usually add 1 item at a time? So if that means all the items that will be present even after the change, then why do I need to add event handlers again?
The method is to handle an notification
event - add it ' For 'Move', 'Remove', 'Replacement' or 'Reset' action, that means the items are being added to / from the collection or being removed.
-
New item
is a list of invoked items -
oldname
is a replacement, Remove, or remove the verb is a list of affected objects.
In other words, when you add a viewodalal to the collection, the ' On Works SpacequakeConnect
' handler attached to the 'Request Code' event of 'new codeam' it happens.
If you add another Voododal (S), then the handler is connected to the new (S), but the items in the collection will not be affected ...
Incidentally , OnWorkspaceRequestClose event handler
Comments
Post a Comment