Пример #1
0
        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;
        }
Пример #2
0
        private void OpenTab(object source, TimeLine.FocusFrameEventArgs args)
        {
            Durable focusRange = null;

            if (args.Node != null)
            {
                focusRange = args.Node.Entry;
            }
            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;
                        frameTabs.SelectedItem = tab;
                        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);
 *                      }
 */
        }
Пример #3
0
		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;
		}