Ejemplo n.º 1
0
        public void RemoveSelectedTabClick(object obj)
        {
            // Debugger.Launch();
            // WebBrowser.Navigate("about:blank");
            if (WebBrowser != null)
            {
                WebBrowser.Dispose();
            }

            GC.Collect();
            TabItemCollection.Remove(this);

            if (TabItemCollection.Where(x => x.CloseButtonVisibility == Visibility.Visible).Count() == 0)
            {
                AddNewTabClick(this);
                Model.SelectedIndex = 0;
                ShowAddNewTabIfNeeded();
            }
            else
            {
                Model.SelectedIndex = Model.TabItemCollection.Count - 2;
            }

            ShowAddNewTabIfNeeded();
        }
Ejemplo n.º 2
0
 public void CloseItem(ITabItem item)
 {
     if (_lDocDict.ContainsKey(item))
     {
         item.FloatClosed -= OnTabFloatClosed;
         LayoutDocument ldoc = _lDocDict[item];
         _lDocDict.Remove(item);
         TabItemCollection.Remove(item);
         if (item.IsFloat)
         {
             LayoutFloatingWindowControl fwctrl = item.FloatControl;
             fwctrl.Close();
             item.IsFloat = false;
         }
         else
         {
             Children.Remove(ldoc);
         }
         if (item is LadderDiagramViewModel)
         {
             IEnumerable <MainTabDiagramItem> fit = DiagramCollection.Where(
                 (MainTabDiagramItem _mtditem) => { return(_mtditem.LDVM_ladder == item); });
             MainTabDiagramItem mtditem = null;
             if (fit.Count() > 0)
             {
                 mtditem = fit.First();
                 DiagramCollection.Remove(mtditem);
             }
         }
         CloseTabItem(this, new RoutedEventArgs());
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Edits the value of the specified object using the specified service provider and context.
        /// </summary>
        /// <param name="context">A type descriptor context that can be used to gain additional context information.</param>
        /// <param name="provider">A service provider object through which editing services may be obtained.</param>
        /// <param name="value">The object to edit the value of.</param>
        /// <returns>The new value of the object. If the value of the object hasn't changed, this should return the same object it was passed.</returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            TabItemCollection col     = (TabItemCollection)value;
            int      oldSelectedIndex = -1;
            TabStrip parent           = null;

            if (col.Count > 0)
            {
                parent = (TabStrip)col[0].Parent;
                if (parent != null)
                {
                    oldSelectedIndex = parent.SelectedIndex;
                }
            }

            object newValue = base.EditValue(context, provider, value);

            if ((parent != null) && (oldSelectedIndex > 0) && (oldSelectedIndex < col.NumTabs))
            {
                // Editing the collection clears out the selected index to its default value
                // Reset it if it is a valid non-default value
                parent.SelectedIndex = oldSelectedIndex;
                IDesignerHost host = (IDesignerHost)provider.GetService(typeof(IDesignerHost));
                if (host != null)
                {
                    IDesigner designer = host.GetDesigner(parent);
                    if ((designer != null) && (designer is ControlDesigner))
                    {
                        ((ControlDesigner)designer).UpdateDesignTimeHtml();
                    }
                }
            }

            return(newValue);
        }
        private void CreateTabView()
        {
            SfTabView tabView  = new SfTabView();
            var       TabItems = new TabItemCollection();

            TabItems.Add(new SfTabItem()
            {
                Title = "Tab 1", Content = new Datagrid()
            });
            TabItems.Add(new SfTabItem()
            {
                Title = "Tab 2", Content = new TreeView()
            });
            TabItems.Add(new SfTabItem()
            {
                Title = "Tab 3", Content = new TabContent()
            });
            TabItems.Add(new SfTabItem()
            {
                Title = "Tab 4", Content = new StackLayout {
                    BackgroundColor = Color.LightGreen
                }
            });
            TabItems.Add(new SfTabItem()
            {
                Title = "Tab 5", Content = new StackLayout {
                    BackgroundColor = Color.LightSkyBlue
                }
            });
            tabView.Items = TabItems;
            stack.Children.Add(tabView);
        }
Ejemplo n.º 5
0
        private void HandleSelected(object obj)
        {
            //Raise event selected and pass color to TabHeader
            var index  = TabItemIndex;
            var colors = ColorItems.GetValue(index).ToString();
            EventHandler <string> handler = SelectedItemEvent;

            handler?.Invoke(this, colors);

            //get property element in list header
            TabItemCollection tabItems = (obj as SfTabView).Items;

            foreach (var item in tabItems)
            {
                int selectedIndex = tabItems.IndexOf(item);

                if (selectedIndex == index)
                {
                    var converter = new ColorTypeConverter();
                    ((item.HeaderContent as StackLayout).Children[0] as PancakeView).Margin  = new Thickness(0, 5, 0, 0);
                    ((item.HeaderContent as StackLayout).Children[0] as PancakeView).Padding = new Thickness(0, 0, 0, -1);
                }
                else
                {
                    ((item.HeaderContent as StackLayout).Children[0] as PancakeView).Margin  = new Thickness(0, 10, 0, 0);
                    ((item.HeaderContent as StackLayout).Children[0] as PancakeView).Padding = new Thickness(0, 0, 0, -6);
                }
            }
        }
Ejemplo n.º 6
0
        internal void SetItems()
        {
            Items = new TabItemCollection();

            Profile_page page1 = new Profile_page();
            //  Questions_Select_layout page2 = new Questions_Select_layout();


            Learning_Demo       page3 = new Learning_Demo();
            Side_Learn_type_one page4 = new Side_Learn_type_one();

            Present_page page2 = new Present_page();

            Items.Add(new SfTabItem {
                Content = page1.Content, Title = "Profile"
            });
            Items.Add(new SfTabItem {
                Content = page2.Content, Title = "Context"
            });
            Items.Add(new SfTabItem {
                Content = page3.Content, Title = "Test"
            });
            Items.Add(new SfTabItem {
                Content = page4.Content, Title = "Settings"
            });
        }
Ejemplo n.º 7
0
        public void AddNewTabForUrl(string url, bool focusOnNewTab, Action <TabItem> callback = null)
        {
            if (!string.IsNullOrWhiteSpace(url))
            {
                int _tabElements = TabItemCollection.Count;

                TabItem newTab = new TabItem(Model, resolver);
                newTab.SearchBar.Address = url;

                newTab.CloseButtonVisibility = Visibility.Visible;

                int count = TabItemCollection.Where(x => x.CloseButtonVisibility == Visibility.Visible).Count();

                if (count > 0)
                {
                    if (count >= MAX_TAB_COUNT)
                    {
                        var tab = TabItemCollection.LastOrDefault(x => x.CloseButtonVisibility == Visibility.Visible);
                        tab.SearchBar.Address = url;
                        tab.SearchBar.Navigate();
                    }
                    else
                    {
                        TabItemCollection.Insert(count, newTab);
                    }
                }
                else
                {
                    TabItemCollection.Insert(0, newTab);
                }

                if (focusOnNewTab)
                {
                    if (TabItemCollection.Count > 1)
                    {
                        bool isNewButtonVisible = TabItemCollection.Any(x => x.NewTabButtonVisibility);
                        if (isNewButtonVisible)
                        {
                            Model.SelectedIndex = TabItemCollection.Count - 2;
                        }
                        else
                        {
                            Model.SelectedIndex = TabItemCollection.Count - 1;
                        }
                    }
                    else
                    {
                        Model.SelectedIndex = 0;
                    }
                }

                if (callback != null)
                {
                    callback(newTab);
                }
            }

            ShowAddNewTabIfNeeded();
        }
 public MainViewModel(IMaskingCreationViewModelFactory maskingCreationViewModelFactory, IEnumerable <ITabBehavior> tabBehaviors)
 {
     foreach (var tabBehavior in tabBehaviors)
     {
         TabItemCollection.Add(maskingCreationViewModelFactory.Create(tabBehavior));
     }
     SelectedTabItem = TabItemCollection.FirstOrDefault();
 }
Ejemplo n.º 9
0
        public void ShowItem(ITabItem item)
        {
            //bool isnew = false;
            LayoutDocument ldoc = null;

            if (item is FuncBlockViewModel)
            {
                FuncBlockViewModel fbvmodel = (FuncBlockViewModel)item;
                fbvmodel.CodeTextBox.Focus();
            }
            if (item.IsFloat)
            {
                LayoutFloatingWindowControl fwctrl = item.FloatControl;
                fwctrl.Focus();
                return;
            }
            if (!TabItemCollection.Contains(item))
            {
                TabItemCollection.Add(item);
                item.FloatClosed += OnTabFloatClosed;
                ldoc              = new LayoutDocument();
                ldoc.Title        = item.TabHeader;
                if (item is LadderDiagramViewModel)
                {
                    IEnumerable <MainTabDiagramItem> fit = DiagramCollection.Where(
                        (MainTabDiagramItem _mtditem) => { return(_mtditem.LDVM_ladder == item); });
                    MainTabDiagramItem mtditem = null;
                    if (fit.Count() == 0)
                    {
                        mtditem = new MainTabDiagramItem((IProgram)item, ViewMode);
                        DiagramCollection.Add(mtditem);
                    }
                    else
                    {
                        mtditem = fit.First();
                    }
                    ldoc.Content = mtditem;
                }
                else
                {
                    ldoc.Content = item;
                }
                ldoc.IsActiveChanged += OnActiveChanged;
                Children.Add(ldoc);
                _lDocDict.Add(item, ldoc);
                //isnew = true;
            }
            else
            {
                ldoc = _lDocDict[item];
            }
            int ldocid = Children.IndexOf(ldoc);

            SelectedItem         = item;
            SelectedContentIndex = ldocid;
        }
Ejemplo n.º 10
0
        public TabViewViewModel()
        {
            Tabitems = new TabItemCollection();
            CheckConnected();
            CrossConnectivity.Current.ConnectivityChanged += Current_ConnectivityChanged;
            SelectionChangeCommand = new Command(HandleSelected);
            var setting = new HomeSettingViewModel();

            setting.UpdateStateStorage();
        }
Ejemplo n.º 11
0
        public static TabItemCollection GetDisplayFilter(Control item)
        {
            var collection = (TabItemCollection)item.GetValue(DisplayFilterProperty);

            if (collection == null)
            {
                collection = new TabItemCollection();
                item.SetValue(DisplayFilterProperty, collection);
            }
            return(collection);
        }
Ejemplo n.º 12
0
 public void AddNewTabEmpty(object obj)
 {
     if (TabItemCollection.Where(x => x.NewTabButtonVisibility == true).Count() == 0)
     {
         TabItem newTab = new TabItem(Model, resolver);
         newTab.SearchBar.Title = (string)System.Windows.Application.Current.FindResource(NewTabMessage);
         HideAllHompageContainerItems();
         NewTabButtonVisibility = true;
         TabItemCollection.Add(newTab);
     }
     ShowAddNewTabIfNeeded();
 }
        public OrderInfoViewModel(Tables table = null)

        {
            this.Table = table;

            // Order = table.Orders.FirstOrDefault();
            Sekces           = new ObservableCollection <Sekce>();
            Orders           = new ObservableCollection <Orders>();
            Items            = new TabItemCollection();
            Polozkas         = new ObservableCollection <Items>();
            OrderDetails     = new ObservableCollection <OrderDetail>();
            LoadItemsCommand = new Xamarin.Forms.Command(async() => await GetOrderDetail());   //Přiřadíme příkazu metodu a určíme jeho aynchronní provedení
        }
Ejemplo n.º 14
0
 protected override void OnChildrenCollectionChanged()
 {
     base.OnChildrenCollectionChanged();
     foreach (ITabItem tab in TabItemCollection)
     {
         if (tab.IsFloat)
         {
             continue;
         }
         if (!_lDocDict.ContainsKey(tab))
         {
             continue;
         }
         LayoutDocument ldoc = _lDocDict[tab];
         if (!Children.Contains(ldoc))
         {
             CloseItem(tab);
             return;
         }
     }
     foreach (var child in Children)
     {
         ITabItem tab = null;
         if (child.Content is MainTabDiagramItem)
         {
             tab = ((MainTabDiagramItem)(child.Content)).LDVM_ladder;
         }
         else if (child.Content is ITabItem)
         {
             tab = (ITabItem)(child.Content);
         }
         if (tab != null && !TabItemCollection.Contains(tab))
         {
             TabItemCollection.Add(tab);
             _lDocDict.Add(tab, (LayoutDocument)child);
         }
         if (child.IconSource == null && child.Content is MainTabDiagramItem)
         {
             child.ImageSource = IconManager.RoutineImage;
         }
         else if (child.IconSource == null && child.Content is FuncBlockViewModel)
         {
             child.ImageSource = IconManager.FuncImage;
         }
         else if (child.IconSource == null && child.Content is ModbusTableViewModel)
         {
             child.ImageSource = IconManager.ModbusImage;
         }
     }
 }
Ejemplo n.º 15
0
 public void Reset()
 {
     foreach (ITabItem item in TabItemCollection)
     {
         if (item.IsFloat)
         {
             LayoutFloatingWindowControl fwctrl = item.FloatControl;
             fwctrl.Close();
         }
     }
     TabItemCollection.Clear();
     DiagramCollection.Clear();
     _lDocDict.Clear();
     Children.Clear();
 }
 public void RemoveFromFavoriteListClick(object obj)
 {
     if (obj != null)
     {
         var favorite = PBData.GetFavorites().Where(x => x.Url == obj.ToString()).FirstOrDefault();
         if (favorite != null)
         {
             this.PBData.RemoveFromFavorites(favorite);
             var tabItem = TabItemCollection.Where(x => x.SearchBar.Address == favorite.Url).FirstOrDefault();
             if (tabItem != null)
             {
                 tabItem.SearchBar.SetFavoriteIconVisibility(false);
             }
         }
         this.LoadSecureBrowserFavoriteList();
     }
 }
Ejemplo n.º 17
0
        public void ShowAddNewTabIfNeeded()
        {
            int count = TabItemCollection.Where(x => x.NewTabButtonVisibility == true).Count();

            if (count == 0)
            {
                if (TabItemCollection.Count < MAX_TAB_COUNT)
                {
                    TabItem item = new TabItem(Model, resolver);
                    TabItemCollection.Add(item);
                }
            }

            if (TabItemCollection.Count > MAX_TAB_COUNT)
            {
                var tab = TabItemCollection.FirstOrDefault(x => x.NewTabButtonVisibility);
                TabItemCollection.Remove(tab);
            }
        }
        internal void SetItems()
        {
            Items = new TabItemCollection();
            TabViewItemPage1 page1 = new TabViewItemPage1();
            TabViewItemPage2 page2 = new TabViewItemPage2();
            TabViewItemPage3 page3 = new TabViewItemPage3();
            TabViewItemPage4 page4 = new TabViewItemPage4();

            Items.Add(new SfTabItem {
                Content = page1.Content, Title = "Page1"
            });
            Items.Add(new SfTabItem {
                Content = page2.Content, Title = "Page2"
            });
            Items.Add(new SfTabItem {
                Content = page3.Content, Title = "Page3"
            });
            Items.Add(new SfTabItem {
                Content = page4.Content, Title = "Page4"
            });
        }
Ejemplo n.º 19
0
 private void OnTabFloatClosed(object sender, RoutedEventArgs e)
 {
     if (sender is MainTabDiagramItem)
     {
         MainTabDiagramItem mtditem = (MainTabDiagramItem)sender;
         mtditem.IsFloat = false;
         //mtditem.FloatClosed -= OnTabFloatClosed;
         DiagramCollection.Remove(mtditem);
         TabItemCollection.Remove(mtditem.LDVM_ladder);
         _lDocDict.Remove(mtditem.LDVM_ladder);
     }
     else
     {
         ITabItem titem = (ITabItem)sender;
         titem.IsFloat = false;
         //titem.FloatClosed -= OnTabFloatClosed;
         TabItemCollection.Remove(titem);
         _lDocDict.Remove(titem);
     }
     FloatingWinClosed(this, null);
 }
 public void OpenInCurrentTabClick(object obj)
 {
     if (obj != null)
     {
         var favorite = PBData.GetFavorites().Where(x => x.Url == obj.ToString()).FirstOrDefault();
         if (favorite != null && this.SelectedTabItem != null)
         {
             this.SelectedTabItem.ShowOrHideFavoriteListClick(null);
             this.SelectedTabItem.WebBrowser.Navigate(favorite.Url);
         }
         else if (favorite != null)
         {
             TabItem defaultItem = new TabItem(this, resolver);
             defaultItem.SearchBar.Address = favorite.Url;
             TabItemCollection.Add(defaultItem);
         }
     }
     else
     {
         this.SelectedTabItem.ShowOrHideFavoriteListClick(null);
     }
 }
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            if (IsNewInstance)
            {
                page1 = new LabResultPage();
                page2 = new RadioResultPage();

                //var loader = await MaterialDialog.Instance.LoadingDialogAsync("loading...");
                await page1.Initilize();

                await page2.Initilize();

                //await loader.DismissAsync();

                //var customTab = new SJMC.CustomControl.CustomTabItem();
                //customTab.Content = page1;
                //var customTab2 = new SJMC.CustomControl.CustomTabItem();
                //customTab.Content = page2;

                var tabItems = new TabItemCollection
                {
                    new SfTabItem()
                    {
                        Title   = "Calls",
                        Content = page1
                    },
                    new SfTabItem()
                    {
                        Title   = "Favorites",
                        Content = page2
                    },
                };
                MyTab.Items = tabItems;
                viewModel.Initilize(_index);

                IsNewInstance = false;
            }
        }
Ejemplo n.º 22
0
        public void AddNewTabClick(object obj)
        {
            TabItem newTab = new TabItem(Model, resolver);

            newTab.SearchBar.Title = (string)System.Windows.Application.Current.FindResource(NewTabMessage);
            var startPage = this.Model.PBData.GetPrivateSetting(DefaultProperties.Settings_StartPageUrl);

            if (!string.IsNullOrWhiteSpace(startPage))
            {
                newTab.SearchBar.Address = startPage;
            }
            newTab.CloseButtonVisibility = Visibility.Visible;

            int count = TabItemCollection.Where(x => x.CloseButtonVisibility == Visibility.Visible).Count();

            if (count > 0)
            {
                if (!(TabItemCollection.Count > MAX_TAB_COUNT))
                {
                    TabItemCollection.Insert(count, newTab);
                }
            }
            else
            {
                TabItemCollection.Insert(0, newTab);
            }

            if (!(obj is TabItem))
            {
                Model.SelectedIndex = Model.TabItemCollection.Count - 2;
            }
            if (TabItemCollection.Count == 2)
            {
                Model.SelectedIndex = 0;
            }

            ShowAddNewTabIfNeeded();
        }
Ejemplo n.º 23
0
        internal void SetTabItems()
        {
            TabItems = new TabItemCollection();
            SymptomsPage   page1 = new SymptomsPage();
            PreventionPage page2 = new PreventionPage();

            TabItems.Add(new SfTabItem
            {
                Content        = page1.Content,
                Title          = "Sintomas",
                TitleFontSize  = 20,
                SelectionColor = Color.FromHex("#3F94B5"),
                TitleFontColor = Color.FromHex("#99A6C0"),
            });
            TabItems.Add(new SfTabItem
            {
                Content        = page2.Content,
                Title          = "Prevenção",
                TitleFontSize  = 20,
                SelectionColor = Color.FromHex("#3F94B5"),
                TitleFontColor = Color.FromHex("#99A6C0"),
            });
        }
Ejemplo n.º 24
0
        public MainViewModel()
        {
            TabItems      = new TabItemCollection();
            StatusUser    = "******";
            StatusNetWork = "IP:" + GetIp();
            CurrentTime   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + DateTime.Now.ToString("dddd", new System.Globalization.CultureInfo("zh-cn"));
            Version       = "主程序版本:" + Assembly.GetExecutingAssembly().GetName().Version; //Application.ResourceAssembly.GetName().Version;

            InputData();
            TreeNodes = GetChildNodes(Guid.Parse("D7AFCF4C-4DE4-4319-9C22-672569B4860F"), Nodes);// Nodes是我已经获得的一组节点

            CloseTabCommand = new RelayCommand <string>(o => CloseTab(o), o => CanCloseTab(o));
            SelectedTreeItemChangedCommand = new RelayCommand <TreeNode>(o => SelectedTreeItemChanged(o), o => CanSelectedTreeItemChanged(o));

            var tabItem = new TabItemModel(WebUtility.HtmlDecode("&#xe605;"), "主页", "/Pages/Home.xaml", CloseTabCommand, Visibility.Collapsed);

            TabItems.Add(tabItem);
            SelectedTabItem = tabItem;

            //_timer = new DispatcherTimer();
            //_timer.Tick += OnTimerTick;
            //_timer.Interval = new TimeSpan(0, 0, 1);
            //_timer.Start();
        }
        void InitializeTabView()
        {
            TabItemCollection collection = new TabItemCollection();

            tabView = new SfTabView();
            tabView.TabHeaderBackgroundColor = UIColor.Clear;
            tabView.BackgroundColor          = UIColor.FromRGB(48, 146, 246); //UIColor.White;//UIColor.FromRGB(48, 146, 246);
            tabView.TabHeaderBackgroundColor = UIColor.FromRGB(48, 146, 246); //UIColor.White;//UIColor.FromRGB(48, 146, 246);
            tabView.Frame = new CGRect(0, 0, this.Frame.Width, this.Frame.Height);

            SfTabItem furnitureTab = new SfTabItem();

            furnitureTab.Title             = "Furniture";
            furnitureTab.IconFont          = "A";
            furnitureTab.Content           = InitializeTabContent("Furniture", 5);
            furnitureTab.TitleFontColor    = UIColor.White;
            furnitureTab.FontIconFontColor = UIColor.White;
            furnitureTab.SelectionColor    = UIColor.White;
            furnitureTab.FontIconFont      = UIFont.FromName("TabIcons", 20);
            collection.Add(furnitureTab);

            SfTabItem clothingTab = new SfTabItem();

            clothingTab.IconFont          = "C";
            clothingTab.Title             = "Clothing";
            clothingTab.Content           = InitializeTabContent("Clothing", 5);
            clothingTab.TitleFontColor    = UIColor.White;
            clothingTab.FontIconFontColor = UIColor.White;
            clothingTab.SelectionColor    = UIColor.White;
            clothingTab.FontIconFont      = UIFont.FromName("TabIcons", 20);
            collection.Add(clothingTab);

            SfTabItem shoesTab = new SfTabItem();

            shoesTab.IconFont          = "F";
            shoesTab.Title             = "Shoes";
            shoesTab.Content           = InitializeTabContent("Shoes", 5);
            shoesTab.TitleFontColor    = UIColor.White;
            shoesTab.FontIconFontColor = UIColor.White;
            shoesTab.SelectionColor    = UIColor.White;
            shoesTab.FontIconFont      = UIFont.FromName("TabIcons", 20);
            collection.Add(shoesTab);

            SfTabItem fruitsTab = new SfTabItem();

            fruitsTab.IconFont          = "H";
            fruitsTab.Title             = "Fruits";
            fruitsTab.Content           = InitializeTabContent("Fruits", 5);
            fruitsTab.TitleFontColor    = UIColor.White;
            fruitsTab.FontIconFontColor = UIColor.White;
            fruitsTab.SelectionColor    = UIColor.White;
            fruitsTab.FontIconFont      = UIFont.FromName("TabIcons", 20);
            collection.Add(fruitsTab);

            SfTabItem toysTab = new SfTabItem();

            toysTab.Title             = "Toys";
            toysTab.IconFont          = "K";
            toysTab.Content           = InitializeTabContent("Toys", 5);
            toysTab.TitleFontColor    = UIColor.White;
            toysTab.FontIconFontColor = UIColor.White;
            toysTab.SelectionColor    = UIColor.White;
            toysTab.FontIconFont      = UIFont.FromName("TabIcons", 20);
            collection.Add(toysTab);

            tabView.Items = collection;
            Add(tabView);

            tabView.SelectionIndicatorSettings.Color = UIColor.White;
            tabView.TabHeight = 60;

            if ((UIDevice.CurrentDevice).UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                tabView.TabWidth = 150;
            }
        }
Ejemplo n.º 26
0
 /// <summary>
 /// Initializes a new instance of a TabStrip.
 /// </summary>
 public TabStrip()
     : base()
 {
     _Items = new TabItemCollection(this);
     _CachedSelectedIndex = NotSet;
     _OldMultiPageIndex = -1;
     _TabDefaultStyle = new CssCollection();
     _TabHoverStyle = new CssCollection();
     _TabSelectedStyle = new CssCollection();
     _SepDefaultStyle = new CssCollection();
     _SepHoverStyle = new CssCollection();
     _SepSelectedStyle = new CssCollection();
 }
        private void ItemOpenHomepageItemClick(object obj)
        {
            try
            {
                //SecureBrowserItem s = (SecureBrowserItem)HomepageItems.FirstOrDefault(x => x.Id == _itemId);
                if (obj != null)
                {
                    string _itemId = obj as string;
                    foreach (SecureBrowserItem s in HomepageItems)
                    {
                        if (s.Id == _itemId)
                        {
                            if (s != null)
                            {
                                if (this.SelectedTabItem != null)
                                {
                                    string     uri  = null;
                                    SecureItem item = PBData.GetSecureItemById(_itemId);
                                    if (item != null)
                                    {
                                        uri = item.Site.Uri;
                                    }
                                    else
                                    {
                                        Site siteItem = PBData.GetSiteById(_itemId);
                                        uri = siteItem.Uri;
                                    }

                                    if (uri != null)
                                    {
                                        this.SelectedTabItem.ShowOrHideHomepageClick(null);

                                        resolver.GetInstanceOf <IInAppAnalytics>().Get <Events.InAppBrowser, bool>().Log(true);

                                        if (item != null)
                                        {
                                            _pbExtSecureBrowserBridge.OneClickLogin(_itemId, true, TabItemCollection.ToList().FindIndex(p => p.TabId == SelectedTabItem.TabId));
                                        }
                                        else
                                        {
                                            this.SelectedTabItem.WebBrowser.Navigate(uri);
                                        }
                                    }
                                }
                                else
                                {
                                    SecureItem item = PBData.GetSecureItemById(_itemId);
                                    if (item != null)
                                    {
                                        TabItem defaultItem = new TabItem(this, resolver);
                                        String  siteUri     = item.Site.Uri;
                                        defaultItem.SearchBar.Address = siteUri;
                                        TabItemCollection.Add(defaultItem);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
            }
        }