private void Sessions_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (AvSession1 != null && e.OldItems != null) { foreach (Session session in e.OldItems) { if (AvSession1 == session) { AvSession1 = null; } } } if (AvSession1 == null && e.NewItems != null) { foreach (Session session in e.NewItems) { if (session.SessionType == SessionType.AvSession) { AvSession1 = session as IAvSession; } } } if (e.OldItems != null && e.Action != NotifyCollectionChangedAction.Move) { foreach (Session session in e.OldItems) { session.UccSession = null; } } }
public AvChat(IAvSession session) { this.Session = session; this.Closed += Window_Closed; InitializeComponent(); Title = Title.Replace("AssemblyTitle", AssemblyInfo.AssemblyTitle); }
private void OnVideoSessionChanged(IAvSession newSession) { Child = (newSession != null) ? newSession.VideoWindow : null; if (Child != null) { var videoHost = Child as VideoWindowHost; videoHost.Margin = VideoMargin; videoHost.IsVideo2Visible = ViewLocalVideo; videoHost.VideoSize = VideoSize; PropertyChangedEventManager.AddListener(videoHost, this, string.Empty); } }