/// <summary> /// Selects the tab. /// </summary> /// <param name="activeTab">The active tab.</param> /// <param name="highligthOnly">if set to <c>true</c> [highligth only].</param> /// <exception cref="System.Exception">Unknown TabType</exception> public void SelectTab(TabType activeTab, bool highligthOnly = false) { ActiveTab = activeTab; if (highligthOnly) { this.Log().Debug("OnTabSelected (highligthOnly) => {0}", activeTab); return; } this.Log().Debug("OnTabSelected => {0}", activeTab); Tuple <IRoutableViewModel, IRoutingParams> tabViewModel = null; var app = Locator.CurrentMutable.GetService <IApp>(); var viewModelPool = app.AppModel.ViewModelPool; //TODO: OnTabSelected-logic in RootViewModel if (!viewModelPool.ContainsKey(activeTab.ToString())) { this.Log().Debug("OnTabSelected => New TabViewModel {0}", activeTab); if (activeTab == TabType.WatchList) { tabViewModel = Tuple.Create(new WatchListViewModel(app.AppModel) as IRoutableViewModel, new CustomRoutingParams { ReuseExistingView = true } as IRoutingParams); viewModelPool.Add(activeTab.ToString(), tabViewModel); } else if (activeTab == TabType.Search) { tabViewModel = Tuple.Create(new SearchViewModel(app.AppModel) as IRoutableViewModel, new CustomRoutingParams { ReuseExistingView = true } as IRoutingParams); viewModelPool.Add(activeTab.ToString(), tabViewModel); } else if (activeTab == TabType.Settings) { tabViewModel = Tuple.Create(new SettingsViewModel(app.AppModel) as IRoutableViewModel, new CustomRoutingParams { ReuseExistingView = true } as IRoutingParams); viewModelPool.Add(activeTab.ToString(), tabViewModel); } else { throw new Exception("Unknown TabType"); } } else { this.Log().Debug("OnTabSelected => Reuse TabViewModel {0}", activeTab); tabViewModel = viewModelPool[activeTab.ToString()]; } app.Navigate(tabViewModel.Item1, tabViewModel.Item2); }
/// <summary> /// Selects the tab. /// </summary> /// <param name="activeTab">The active tab.</param> /// <param name="highligthOnly">if set to <c>true</c> [highligth only].</param> /// <exception cref="System.Exception">Unknown TabType</exception> public void SelectTab(TabType activeTab, bool highligthOnly = false) { ActiveTab = activeTab; if (highligthOnly) { this.Log().Debug("OnTabSelected (highligthOnly) => {0}", activeTab); return; } this.Log().Debug("OnTabSelected => {0}", activeTab); Tuple<IRoutableViewModel, IRoutingParams> tabViewModel = null; var app = Locator.CurrentMutable.GetService<IApp>(); var viewModelPool = app.AppModel.ViewModelPool; //TODO: OnTabSelected-logic in RootViewModel if (!viewModelPool.ContainsKey(activeTab.ToString())) { this.Log().Debug("OnTabSelected => New TabViewModel {0}", activeTab); if (activeTab == TabType.WatchList) { tabViewModel = Tuple.Create(new WatchListViewModel(app.AppModel) as IRoutableViewModel, new CustomRoutingParams { ReuseExistingView = true } as IRoutingParams); viewModelPool.Add(activeTab.ToString(), tabViewModel); } else if (activeTab == TabType.Search) { tabViewModel = Tuple.Create(new SearchViewModel(app.AppModel) as IRoutableViewModel, new CustomRoutingParams { ReuseExistingView = true } as IRoutingParams); viewModelPool.Add(activeTab.ToString(), tabViewModel); } else if (activeTab == TabType.Settings) { tabViewModel = Tuple.Create(new SettingsViewModel(app.AppModel) as IRoutableViewModel, new CustomRoutingParams { ReuseExistingView = true } as IRoutingParams); viewModelPool.Add(activeTab.ToString(), tabViewModel); } else { throw new Exception("Unknown TabType"); } } else { this.Log().Debug("OnTabSelected => Reuse TabViewModel {0}", activeTab); tabViewModel = viewModelPool[activeTab.ToString()]; } app.Navigate(tabViewModel.Item1, tabViewModel.Item2); }
public ObservableCollection <SocialUser> GetLeftMessengerListData(string userId, TabType tabType, string pageid) { SqLiteHelper sql = new SqLiteHelper(); ObservableCollection <SocialUser> userListInfo = new ObservableCollection <SocialUser>(); //string query = string.Format("select FacebookId,DisplayName,ImageUrl,NavigationUrl from FacebookUsers where Parent_User_Id='{0}' and JobType={1} ", userId, (int)tabType); string query = "select FacebookId,DisplayName,ImageUrl,NavigationUrl,PageId from FacebookUsers where Parent_User_Id='" + userId + "' and JobType='" + (int)tabType + "' and PageId='" + pageid + "'"; var dt = sql.GetDataTable(query); foreach (DataRow item in dt.Rows) { string inboxUserId = Convert.ToString(item["FacebookId"]); string inboxUserName = Convert.ToString(item["DisplayName"]); string inboxUserImage = Convert.ToString(item["ImageUrl"]); string inboxNavigationUrl = Convert.ToString(item["NavigationUrl"]); string pageId = Convert.ToString(item["PageId"]); //if (!UserListInfo.Any(m => m.InboxUserName.Equals(M_inboxUserName))) if (!userListInfo.Any(m => m.InboxUserId.Equals(inboxUserId))) { userListInfo.Add(new SocialUser() { InboxUserId = inboxUserId, InboxUserName = inboxUserName, InboxUserImage = inboxUserImage, InboxNavigationUrl = inboxNavigationUrl, MessageUserType = tabType.ToString(), PageId = pageId }); } } return(userListInfo); }
public SocialTabViewModel(TabType tabType, SocialUser loginUser) { LoginUser = loginUser; TabType = tabType.ToString(); SendMessageCommand = new DelegateCommand(SendMessageCommandHandler, null); SelectedUsers = new ObservableCollection <SocialUser>(); SendMessageInstaCommand = new DelegateCommand(SendMessageInstaCommandhandlar, null); SendimageFBCommand = new DelegateCommand(SendimageFBCommandHandler, null); SendFbCommentCommand = new DelegateCommand(SendFbCommentCommandHandler, null); _onlineFetcher = new OnlineFetcher(); _dbHelper = new DbHelper(); }
/// <summary> /// Returns HTML representation of the component. /// </summary> /// <returns>HTML representation of the component.</returns> public override string ToHtmlString() { var tabTitles = new TagBuilder("ul"); tabTitles.AddCssClass("nav"); tabTitles.AddCssClass(TabType.ToString()); tabTitles.Attributes.Add("role", "tablist"); if (_isJustify) { tabTitles.AddCssClass("nav-justified"); } foreach (var tabPanel in TabPanels) { if (tabPanel.TitleValue != null) { tabTitles.InnerHtml += tabPanel.TitleValue.ToHtmlString(); } } var tabContent = new TagBuilder("div"); tabContent.AddCssClass("tab-content"); foreach (var tabPanel in TabPanels) { if (tabPanel.ContentValue != null) { tabContent.InnerHtml += tabPanel.ContentValue.ToHtmlString(); } } if (_placementType == YimaTabListPlacementType.Bottom) { AddChild(tabContent.ToString(), int.MinValue); AddChild(tabTitles.ToString(), int.MinValue + 1); } else { AddChild(tabTitles.ToString(), int.MinValue); AddChild(tabContent.ToString(), int.MinValue + 1); } return(base.ToHtmlString()); }
/// <summary> /// Initialize tab header with default values from resources /// </summary> private void InitTabHeader() { if (TabType != TabTypes.CUSTOM) { string tabHeader = Log9KResources.ResourceManager.GetString(TabType.ToString()); if (tabHeader != null) { TabHeader = tabHeader; } else { TabHeader = TabTypeString; } } else { TabHeader = CustomTabType; } }
private double calcMouseY(TabType tabType, double yOffset) { int RandomOffSet = ran.Next(-7, 7); if (tabType == TabType.PremiumStash || tabType == TabType.NormalStash) { return(NormalY + yOffset * NormalOffsetY + RandomOffSet); } else if (tabType == TabType.QuadStash) { return(QuadY + yOffset * QuadOffsetY + RandomOffSet); } else if (tabType == TabType.Inventory) { return(InventoryY + yOffset * InventoryOffsetY + RandomOffSet); } else { throw new Exception("Can't remove items from tabtype " + tabType.ToString()); } }