Esempio n. 1
0
 private Tabs()
 {
     Tab tab = new Tab { Name = "Index", Id = Guid.NewGuid(), HorizontalAlignment = HorizontalAlignment.Stretch };
     itemTabs.Add(tab);
     //            itemTabs.Add(new Tab() { Name = "Detail", Id = Guid.NewGuid(), HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch });
     Current = tab;
 }
Esempio n. 2
0
 /// <summary>
 /// select UIElement by current tab
 /// </summary>
 /// <param name="current"></param>
 public void SelectIndexByTab(Tab current)
 {
     for (int i = 0; i < _modelContainer.Children.Count; i++)
     {
         Viewport2DVisual3D newSelectedModel = (Viewport2DVisual3D)_modelContainer.Children[i];
         ListBoxItem item = (ListBoxItem)newSelectedModel.GetValue(LinkedElementProperty);
         if (current.Id == ((Tab)item.Content).Id)
         {
             SelectedIndex = i;
             return;
         }
     }
 }
Esempio n. 3
0
 /// <summary>
 /// raise event when close button pressed
 /// </summary>
 public void RaiseTabClosedEvent(Tab tab)
 {
     if (TabClosed != null)
         TabClosed(tab);
 }
Esempio n. 4
0
 /// <summary>
 /// raise event when mouse enter on current element 
 /// </summary>
 public void RaiseCloseButtonHideEvent(Tab tab)
 {
     if (CurrentElementMouseLeaved != null)
         CurrentElementMouseLeaved(tab);
 }
Esempio n. 5
0
 /// <summary>
 /// raise event when mouse enter on current element 
 /// </summary>
 public void RaiseCurrentElementMouseEnterEvent(Tab tab)
 {
     if (CurrentElementMouseEntered != null)
         CurrentElementMouseEntered(tab);
 }
Esempio n. 6
0
 /// <summary>
 /// show current tab
 /// </summary>
 /// <param name="tab"></param>
 public void RaiseTabLoadedEvent(Tab tab)
 {
     if (TabLoaded != null)
     {
         if (tab != null)
             TabLoaded(tab);
     }
 }
Esempio n. 7
0
 /// <summary>
 /// closes a tab
 /// </summary>
 /// <param name="tab"></param>
 public void Close(Tab tab)
 {
     //if more then one tab
     if (itemTabs.Count > 1)
     {
         //close and remove
         this.RaiseTabClosing(tab);
         tab.Close();
         itemTabs.Remove(tab);
         //set current the first
         Current = itemTabs[0];
         tab = null;
     }
     //othewise do nothing as the last tab can't be closed
 }
Esempio n. 8
0
 public void RaiseTabClosing(Tab tab)
 {
     if (TabClosing != null)
         TabClosing(tab);
 }
Esempio n. 9
0
 public void RaiseChangedTab(Tab fromTab, Tab toTab)
 {
     if (ChangedTab != null)
         ChangedTab(fromTab, toTab);
 }
Esempio n. 10
0
 /// <summary>
 /// opens a new tab avigating at uri, and displaying the image
 /// </summary>
 /// <param name="uri"></param>
 /// <param name="propertyBag"></param>
 /// <param name="img"></param>
 /// <param name="name"></param>
 public void NewTab(string uri, IDictionary propertyBag, byte[] img, string name)
 {
     Tab oldTab = Current;
     Current.Hide();
     Tab tab = new Tab { HorizontalAlignment = HorizontalAlignment.Stretch, TabName = name, Image = img, Uri = uri };
     itemTabs.Add(tab);
     Current = tab;
     try
     {
         if (propertyBag == null) tab.Navigate(uri);
         else tab.Navigate(uri, propertyBag);
         tab.Focus();
     }
     catch (Exception e)
     {
         RoLog.Instance.WriteToLog(e.ToString(), TracedAttribute.ERROR);
         tab.Close();
         Current = oldTab;
         throw;
     }
     Current.Show();
 }
Esempio n. 11
0
 private void ShowCloseButton(Tab tab)
 {
     if (Tabs.Instance.ItemTabs.Count > 1)
         btnCloseApp.Visibility = Visibility.Visible;
 }
Esempio n. 12
0
 private void HideCloseButton(Tab tab)
 {
     if (!btnCloseApp.IsMouseOver)
         btnCloseApp.Visibility = Visibility.Collapsed;
 }
Esempio n. 13
0
 private void elementFlow_TabClosed(Tab tab)
 {
     Tabs.Instance.Close(tab);
 }
Esempio n. 14
0
        private void elementFlow_TabLoaded(Tab tab)
        {
            Tabs.Instance.Current = tab;
//            menu.Visibility = Tabs.Instance.Current.MenuVisible;
        }