private void contextMenuStrip1_Opened(object sender, EventArgs e) { if (tdm == TabDisplayMode.Expanded) // if in expanded, go to context menu to hold.. if in a mode such as ExpandedFixed, don't change { tdm = TabDisplayMode.ExpandedContextMenu; } }
private void ConfigureTabView() { this.SetBackgroundColor(Color.ParseColor("#037ef3")); var index = 0; foreach (var category in viewModel.Categories) { var tabViewItem = new SfTabItem { Title = category, IconFont = fontstring[index], FontIconStyle = Typeface.CreateFromAsset(appcontext.Assets, "TabIcons.ttf"), Content = ListViewCollection[index], SelectionColor = Color.White, TitleFontColor = Color.White, FontIconFontColor = Color.White, }; this.Items.Add(tabViewItem); index++; } this.SelectionIndicatorSettings = new SelectionIndicatorSettings() { Position = SelectionIndicatorPosition.Bottom, Color = Color.White }; this.selectionindicatorPosition = SelectionIndicatorPosition.Bottom; this.displayMode = TabDisplayMode.Text; this.OverflowMode = OverflowMode.Scroll; this.VisibleHeaderCount = 4; this.tabheaderPosition = TabHeaderPosition.Top; }
private async void RenderTabContent(object obj) { if (obj is int index) { TabHeaderMode = TabDisplayMode.ImageWithText; switch (index) { case 0: //Profile Tab if (!this.IsProfilePageRendered) { await ProfilePage.InitializeAsync(null); } break; case 1: //Job Tab if (!this.IsJobPageRendered) { await JobPage.InitializeAsync(null); } break; case 2: //Explore Tab if (!this.IsExplorePageRendered) { await ExplorePage.InitializeAsync(null); } break; } } }
private void contextMenuStrip1_Closed(object sender, ToolStripDropDownClosedEventArgs e) { if (tdm == TabDisplayMode.ExpandedContextMenu) // if in context menu, go back to expanded { tdm = TabDisplayMode.Expanded; } MouseLeavePanelObjects(sender, e); // same as a mouse leave on one of the controls }
public void ApplyChanges() { this.displayMode = this.DisplayMode; if (this.displayMode == TabDisplayMode.ImageWithText) this.TabHeight = 72; else this.TabHeight = 48; this.tabheaderPosition = this.TabHeaderPosition; this.selectionindicatorPosition = this.SelectionIndicatorSettings.Position; }
void AutoFadeInOutTick(object sender, EventArgs e) // hiding { autofadeinouttimer.Stop(); //System.Diagnostics.Debug.WriteLine("{0} {1} Fade {2}" , Environment.TickCount, Name, tobevisible); if (tdm != autofadetabmode) { tdm = autofadetabmode; Display(); } }
private void MouseLeavePanelObjects(object sender, EventArgs e) // get this when leaving a panel and going to the icons.. so fade out slowly so it can be cancelled { autofadeinouttimer.Stop(); if (tdm == TabDisplayMode.Expanded) // if in expanded { autofadetabmode = TabDisplayMode.Compressed; autofadeinouttimer.Interval = 750; autofadeinouttimer.Start(); //System.Diagnostics.Debug.WriteLine("{0} {1} Fade out", Environment.TickCount, Name); } }
private void MouseEnterPanelObjects(object sender, EventArgs e) { autofadeinouttimer.Stop(); if (tdm == TabDisplayMode.Compressed) // if in compressed.. { autofadetabmode = TabDisplayMode.Expanded; autofadeinouttimer.Interval = 350; autofadeinouttimer.Start(); //System.Diagnostics.Debug.WriteLine("{0} {1} Fade in", Environment.TickCount, Name); } }
private void drawnPanelListSelection_Click(object sender, EventArgs e) { autofadeinouttimer.Stop(); // in case we are in an autofade dropdown = new ExtListBoxForm("", true); dropdown.SelectionBackColor = this.DropDownBackgroundColor; dropdown.ForeColor = this.ForeColor; dropdown.BackColor = this.DropDownBorderColor; dropdown.BorderColor = this.DropDownBorderColor; dropdown.ScrollBarColor = this.DropDownScrollBarColor; dropdown.ScrollBarButtonColor = this.DropDownScrollBarButtonColor; dropdown.MouseOverBackgroundColor = this.DropDownMouseOverBackgroundColor; dropdown.ItemSeperatorColor = this.DropDownItemSeperatorColor; dropdown.ItemHeight = ImageList[0].Size.Height + 2; dropdown.Items = TextList.ToList(); dropdown.ItemSeperators = ListSelectionItemSeparators; dropdown.ImageItems = ImageList.ToList(); dropdown.FlatStyle = FlatStyle.Popup; dropdown.Activated += (s, ea) => { Point location = panelListSelection.PointToScreen(new Point(0, 0)); dropdown.Location = dropdown.PositionWithinScreen(location.X + panelListSelection.Width, location.Y); this.Invalidate(true); }; dropdown.SelectedIndexChanged += (s, ea) => { tdm = TabDisplayMode.Expanded; // deactivate drop down.. leave in expanded mode ChangePanel(dropdown.SelectedIndex); }; dropdown.Deactivate += (s, ea) => // will also be called on selected index because we have auto close on (in constructor) { tdm = TabDisplayMode.Expanded; // deactivate drop down.. leave in expanded mode MouseLeavePanelObjects(sender, e); // same as a mouse leave on one of the controls }; dropdown.Size = new Size(DropDownWidth, DropDownHeight); dropdown.Show(this.FindForm()); tdm = TabDisplayMode.ExpandedInList; // hold display in here during list presentation }
private void ChangeStripMode(StripModeType mt) { stripmode = mt; tdm = stripmode == StripModeType.StripTopOpen ? TabDisplayMode.ExpandedFixed : TabDisplayMode.Compressed; Display(); }