// Called by View Service when a new view element is created private void ViewCreated(object sender, ViewCreatedEventArgs e) { if (e.View != null) { ModelItem modelItem = e.View.ModelItem; object addedObject = modelItem.GetCurrentValue(); // Create a mapping between SourceLocation and this View Element SourceLocation sourceLocation = this.GetSourceLocationFromModelItemInstance(addedObject); if (sourceLocation == null) { // The current view element has not been saved yet to the Xaml file sourceLocation = GenerateUnresolvedLocation(); this.instanceToSourceLocationMapping.Add(addedObject, sourceLocation); } this.modelItemToSourceLocation[modelItem] = sourceLocation; this.sourceLocationToModelItem[sourceLocation] = modelItem; BreakpointTypes breakpointType; // check if it's in the transient breakpoint list. if (this.transientBreakpoints.TryGetValue(modelItem, out breakpointType)) { this.transientBreakpoints.Remove(modelItem); SetBreakpointType(modelItem, breakpointType); } else { TryActivateUnmappedBreakpoint(sourceLocation, modelItem); } } }
private void Application_ViewCreated(object sender, ViewCreatedEventArgs e) { ObjectView objectView = e.View as ObjectView; if ((objectView != null) && (objectView.ObjectTypeInfo.Type == typeof(SFITrackNum))) { objectView.ObjectSpace.Committing += ObjectSpace_Committing; if (objectView is ListView) { ((NonPersistentObjectSpace)objectView.ObjectSpace).ObjectsGetting += TrackNumInfoWinController_ObjectsGetting; ((ListView)objectView).CollectionSource.ResetCollection(); } } }
void Server_OnJoinedChannel(Channel c) { window.Dispatcher.Invoke(DispatcherPriority.Input, (ThreadStart)(() => { try { ChannelView cv = new ChannelView(c, window); ViewCreatedEventArgs e = new ViewCreatedEventArgs(); e.View = cv; ChannelViewCreated((object)this, e); } catch (Exception ex) { Trace.WriteLine("exex: " + ex); } })); }
private void Application_ViewCreated(object sender, ViewCreatedEventArgs e) { openedViews.Add(e.View.Id); }