public void OpenAttributeTable() { if (MapView.Active.GetSelectedLayers().Count() > 0) { foreach (MapMember mapMember in MapView.Active.GetSelectedLayers()) { if (!TableControlContentFactory.IsMapMemberSupported(mapMember)) { continue; } string layerName = mapMember.Name; if (!TabItems.Select(n => n.TableName).Contains(layerName)) { TabItems.Add(new TabItemViewModel(mapMember, this.Content)); TabControlSelectedIndex = TabItems.Count() - 1; } else { int tabIndex = 0; foreach (var item in TabItems) { if (((TabItemViewModel)item).TableName == layerName) { break; } tabIndex++; } TabControlSelectedIndex = tabIndex; } } } SetTabControlVisibility(); }
private TabItem CreateTabItem(string name) { return(new TabItem { Header = name, Name = "tab" + TabItems.Count().ToString() }); }
public void Render() { lock (SyncRoot) if (_instance == null) { _instance = this; } Rendering.Raise(this, EventArgs.Empty); if (!TabItems.Any()) { return; } if (string.IsNullOrEmpty(Text)) { Text = "Go to..."; } PaneManager.Instance.Clear(); var tabs = TabItems.Select(item => CompactFactory.GetNativeObject <TabItem>(item, item.Title)).ToList(); for (int i = 0; i < tabs.Count; i++) { var tab = tabs[i]; if (tab == null) { continue; } tab.View = this; tab.Index = i; MenuItems.Add(tab); var context = new iApp.AppNavigationContext { ActivePane = Pane.Master, ActiveTab = i }; PaneManager.Instance.AddStack(new HistoryStack { Context = context }, context); } var cxt = new iApp.AppNavigationContext { ActivePane = Pane.Popover, }; PaneManager.Instance.AddStack(new HistoryStack { Context = cxt }, cxt); if (PaneManager.Instance.CurrentTab > TabItems.Count() || PaneManager.Instance.CurrentTab < 0) { PaneManager.Instance.CurrentTab = 0; } CompactFactory.Navigate(TabItems.ElementAt(PaneManager.Instance.CurrentTab).NavigationLink, this); }
public static void OpenNewTab(Actor actor) { int existsActorTabIndex = GetTabIndex(actor); if (existsActorTabIndex == -1) { var newTabItem = new TabItem() { Header = actor.ShortName, Content = new ActorTab(new ActorTabViewModel(actor)) }; TabItems.Add(newTabItem); SelectedTabItemIndex = TabItems.Count() - 1; } else { SelectedTabItemIndex = existsActorTabIndex; } }
public void Render() { Clear(); this.RaiseEvent(nameof(Rendering), EventArgs.Empty); DroidFactory.Tabs = this; AddAll(TabItems.Select(t => t.Title).ToList()); var actionBar = DroidFactory.MainActivity.ActionBar; if (!TabItems.Any()) { return; } HeaderColor = iApp.Instance.Style.HeaderColor; actionBar.Title = null; actionBar.Subtitle = null; actionBar.NavigationMode = ActionBarNavigationMode.List; actionBar.SetListNavigationCallbacks(this, this); actionBar.SetSelectedNavigationItem(PaneManager.Instance.CurrentTab > TabItems.Count() - 1 ? 0 : PaneManager.Instance.CurrentTab); }