Beispiel #1
0
 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();
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 public List <StoredTabItem> ToStoredObject()
 {
     return(TabItems.Select(tab => new StoredTabItem(tab.Id, tab.Text)).ToList());
 }