public void AddFrameInfo(FrameInfo info) { _frameInfo = info; Add(_frameInfo); }
private void OpenTab(object source, TimeLine.FocusFrameEventArgs args) { Data.Frame frame = args.Frame; foreach (var tab in frameTabs.Items) { if (tab is CloseableTabItem) { CloseableTabItem item = (CloseableTabItem)tab; if (item.DataContext.Equals(frame)) { frameTabs.SelectedItem = item; return; } } } CloseableTabItem tabItem = new CloseableTabItem() { Header = "Loading...", DataContext = frame }; FrameInfo info = new FrameInfo() { Height = Double.NaN, Width = Double.NaN, DataContext = null }; info.DataContextChanged += new DependencyPropertyChangedEventHandler((object sender, DependencyPropertyChangedEventArgs e) => {tabItem.Header = frame.Description;}); info.SelectedTreeNodeChanged += new SelectedTreeNodeChangedHandler(FrameInfo_OnSelectedTreeNodeChanged); info.SetFrame(frame); tabItem.Add(info); frameTabs.Items.Add(tabItem); frameTabs.SelectedItem = tabItem; }
private void OpenTab(object source, TimeLine.FocusFrameEventArgs args) { Durable focusRange = null; if (args.Node != null) { focusRange = args.Node.Entry; } else if (args.Tick != null) { focusRange = new Durable(args.Tick.Start, args.Tick.Start + 1); } else if (args.Frame is EventFrame) { focusRange = (args.Frame as EventFrame).Header; } Data.Frame frame = args.Frame; foreach (var tab in frameTabs.Items) { if (tab is TabItem) { TabItem item = (TabItem)tab; if (item.DataContext.Equals(frame)) { FrameInfo frameInfo = item.Content as FrameInfo; if (frameInfo != null) { frameInfo.FocusOnNode(focusRange); } return; } } } CloseableTabItem tabItem = new CloseableTabItem() { Header = "Loading...", DataContext = frame, CloseButtonEnabled = true }; FrameInfo info = new FrameInfo(timeLine.Frames) { Height = Double.NaN, Width = Double.NaN, DataContext = null }; info.DataContextChanged += new DependencyPropertyChangedEventHandler((object sender, DependencyPropertyChangedEventArgs e) => { tabItem.Header = frame.Description; }); info.SelectedTreeNodeChanged += new SelectedTreeNodeChangedHandler(FrameInfo_OnSelectedTreeNodeChanged); info.SetFrame(frame, focusRange); tabItem.AddFrameInfo(info); frameTabs.Items.Add(tabItem); frameTabs.SelectedItem = tabItem; info.FocusOnNode(focusRange); /* * if (!string.IsNullOrEmpty(currFiltredText)) * { * info.SummaryTable.FilterText.SetFilterText(currFiltredText); * } */ }