private void _conversationWindow_NeedsSizeChange(object sender, ConversationWindowNeedsSizeChangeEventArgs e) { Size windowSize = new Size(); windowSize.Height = e.RecommendedWindowHeight; windowSize.Width = e.RecommendedWindowWidth; ResizeWindow resize = new ResizeWindow(SetWindowSize); Dispatcher.Invoke(resize, new object[] { windowSize }); }
/// <summary> /// 会话容器尺寸调整 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected static void window_NeedsSizeChange(object sender, ConversationWindowNeedsSizeChangeEventArgs e) { try { } catch (Exception ex) { LogManage.WriteLog(typeof(LyncHelper), ex); } }
/// <summary> /// The ConversationWindow.NeedsSizeChanged event fires when the docked conversation window has added a new /// visual element (such as video, a participant list, desktop sharing, etc), and if it were not docked, the /// window would have automatically grown in size to accommodate this new element. We must respond to this /// event within 5 seconds by increasing the size of the conversation windows first direct ancestor (the /// ParentWindow handle to which it is docked). Max, min, and recommended size information for the /// ConversationWindow is made available in this event, and cannot be be accessed outside the event, so we /// capture it here before propagating the event to our MainWindow where the containing panel can be adjusted. /// </summary> void HandleNeedsSizeChange(object sender, ConversationWindowNeedsSizeChangeEventArgs e) { MaxSize = new Size(e.MaximumWindowWidth, e.MaximumWindowHeight); MinSize = new Size(e.MinimumWindowWidth, e.MinimumWindowHeight); RecommendedSize = new Size(e.RecommendedWindowWidth, e.RecommendedWindowHeight); var conversationWindow = sender as ConversationWindow; if (ConversationWindowNeedsSizeChangedEvent != null && conversationWindow != null) { ConversationWindowNeedsSizeChangedEvent(this, null); } }