internal void Gridload(int count) { tabcontrol.Items.Clear(); Gridcollection.Clear(); sheetvalue = 1; for (int i = 0; i < count; i++) { SfCellGrid cellgrid = new SfCellGrid(); //cellgrid.Loaded += cellgrid_Loaded; cellgrid.RowCount = 1000; cellgrid.ColumnCount = 1000; cellgrid.DefaultColumnWidth = 64; cellgrid.DefaultRowHeight = 20; cellgrid.Model.TableStyle.CellType = "FormulaCell"; SfTabItem item = new SfTabItem(); cellgrid.Name = "Sheet" + (sheetvalue++); item.Content = cellgrid; item.Header = cellgrid.Name; item.Foreground = new SolidColorBrush(Colors.Black); item.FontSize = 16; item.Height = 40; tabcontrol.Items.Add(item); Gridcollection.Add(cellgrid); } tabcontrol.SelectedIndex = 0; }
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 void categoryselector_SelectionChanged(object sender, SelectionChangedEventArgs e) { #region To clear previous tab items for (int i = 0; i < tabcontrol.Items.Count; i++) { SfTabItem item = tabcontrol.Items[i] as SfTabItem; item.Content = null; } tabcontrol.Items.Clear(); #endregion foreach (var item in this.sourcelistbox.Items) { var info = item as SampleInfo; SfTabItem tabItem = new SfTabItem(); tabItem.Header = info.Header; tabItem.Content = info.SampleView; tabItem.Tag = info.Tag; this.tabcontrol.Items.Add(tabItem); } #region To Select default Items if (tabcontrol.Items.Count > 0) { tabcontrol.SelectedIndex = 0; } #endregion }
internal async void LoadExcel(StorageFile file) { tabcontrol.Items.Clear(); Gridcollection.Clear(); var engine = new ExcelEngine(); IWorkbook book = await engine.Excel.Workbooks.OpenAsync(file); for (int i = 0; i < book.Worksheets.Count; i++) { SfCellGrid cellgrid = new SfCellGrid(); cellgrid.RowCount = 1000; cellgrid.ColumnCount = 1000; cellgrid.DefaultColumnWidth = 64; cellgrid.DefaultRowHeight = 20; cellgrid.Model.TableStyle.CellType = "FormulaCell"; ExcelImportExtension.ImportFromExcel(cellgrid, book.Worksheets[i], null); cellgrid.RowCount = cellgrid.RowCount < 100 ? 100 : cellgrid.RowCount; cellgrid.ColumnCount = cellgrid.ColumnCount < 100 ? 100 : cellgrid.ColumnCount; SfTabItem item = new SfTabItem(); item.Content = cellgrid; item.Header = book.Worksheets[i].Name; item.Foreground = new SolidColorBrush(Colors.Black); item.FontSize = 16; item.Height = 40; tabcontrol.Items.Add(item); Gridcollection.Add(cellgrid); } tabcontrol.SelectedIndex = 0; }
public void SetContent() { //Create Dictonary (color, url) IDictionary <string[], string[]> RssSource = new Dictionary <string[], string[]>(); RssSource.Add(ColorItems, RssItems); { //Process Auto generate tabitem if (RssSource.Count != 0) { int i = 0; foreach (var itemRss in RssItems) { var NamePath = itemRss.Substring(8); int index = NamePath.IndexOf('.'); if (index > 0) { var pieces = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(NamePath.Substring(0, index).ToLower()); TabItemContents content = new TabItemContents(itemRss); TabItemHeaders headers = new TabItemHeaders(pieces, ColorItems.GetValue(i).ToString()); tabItem = new SfTabItem { HeaderContent = headers.Content, Content = content.Content FontIconFontFamily = "Arial", FontIconFontSize = 100 }; i += 1; Tabitems.Add(tabItem); } } } } } }
public CustomView() { InitializeComponent(); this.BindingContext = new ViewModelCustomTab(); if (Device.RuntimePlatform == "iOS") { this.ReadCountLabel.WidthRequest = this.ReadCountLabel.HeightRequest = 20; } SfTabItem item = new SfTabItem(); this.refreshButton.TextColor = Color.Transparent; this.refreshButton.Clicked += RefreshButton_Clicked; this.uwprefreshIndicator.VerticalOptions = LayoutOptions.End; if (Device.RuntimePlatform == Device.UWP) { this.uwprefreshIndicator.IsVisible = true; this.uwprefreshIndicator.IsRunning = true; this.refreshIndicator.IsVisible = false; this.refreshIndicator.IsRunning = false; } else { this.uwprefreshIndicator.IsVisible = false; this.uwprefreshIndicator.IsRunning = false; this.refreshIndicator.IsVisible = true; this.refreshIndicator.IsRunning = true; } Device.StartTimer(TimeSpan.FromMilliseconds(5000), () => { if (Device.RuntimePlatform != Device.UWP) { this.refreshIndicator.IsVisible = false; this.refreshIndicator.IsRunning = false; } else { this.uwprefreshIndicator.IsVisible = false; this.uwprefreshIndicator.IsRunning = false; } this.refreshButton.TextColor = Color.FromHex("#FF00AFF0"); return(false); }); tabGesture = new TapGestureRecognizer(); tabGesture.Tapped += TabGesture_Tapped; ContactsHeader.GestureRecognizers.Add(tabGesture); ChatsHeader.GestureRecognizers.Add(tabGesture); }
public NestedTab() { InitializeComponent(); this.BindingContext = new ViewModel(); this.simTab.SelectionIndicatorSettings = new SelectionIndicatorSettings() { Position = SelectionIndicatorPosition.Fill, Color = Color.FromHex("#FF00AFF0") }; this.ContactTab1.SelectionIndicatorSettings = this.ContactTab2.SelectionIndicatorSettings = this.CallsTab1.SelectionIndicatorSettings = this.CallTab2.SelectionIndicatorSettings = new SelectionIndicatorSettings() { Position = SelectionIndicatorPosition.Top }; SfTabItem item = new SfTabItem(); //item.Title }
protected override void OnApplyTemplate() { editorPage = (CustomizationDemo)this.DataContext; AddStartTimeMonth = GetTemplateChild("addstartmonth") as SfDateTimeCombo; AddStartTimeTime = GetTemplateChild("addstarttime") as SfDateTimeCombo; AddEndTimeMonth = GetTemplateChild("addendmonth") as SfDateTimeCombo; AddEndTimeTime = GetTemplateChild("addendtime") as SfDateTimeCombo; EditStartTimeMonth = GetTemplateChild("editstartmonth") as SfDateTimeCombo; EditStartTimeTime = GetTemplateChild("editstarttime") as SfDateTimeCombo; EditEndTimeMonth = GetTemplateChild("editendmonth") as SfDateTimeCombo; EditEndTimeTime = GetTemplateChild("editendtime") as SfDateTimeCombo; Subject = GetTemplateChild("sub") as TextBox; Notes = GetTemplateChild("notes") as TextBox; grid = GetTemplateChild("mainGrid") as Grid; Location = GetTemplateChild("where") as SfTextBoxExt; Close = GetTemplateChild("close") as Button; Save = GetTemplateChild("save") as Button; Reminder = GetTemplateChild("reminder") as ComboBox; Delete = GetTemplateChild("delete") as Button; eventDetails = GetTemplateChild("eventDetails") as SfTabItem; timeDetails = GetTemplateChild("timeDetails") as SfTabItem; startDateTabControl = GetTemplateChild("StartDateTabControl") as SfTabControl; ShowMorePanel = GetTemplateChild("showmorepanel") as StackPanel; this.Visibility = Visibility.Collapsed; Scroll1 = GetTemplateChild("scroll1") as ScrollViewer; AddReminder = GetTemplateChild("addreminder") as ComboBox; AppType = GetTemplateChild("AppType") as ComboBox; AddAppType = GetTemplateChild("AddAppType") as ComboBox; Close.Click += Close_Click; Save.Click += Save_Click; Delete.Click += Delete_Click; AddReminder.ItemsSource = Reminder.ItemsSource = Enum.GetValues(typeof(ReminderTimeType)); AddReminder.SelectedIndex = Reminder.SelectedIndex = 0; AppType.ItemsSource = AddAppType.ItemsSource = Enum.GetValues(typeof(Appointment.AppointmentTypes)); AppType.SelectedIndex = AddAppType.SelectedIndex = 0; this.DataContext = editorPage.AddDataContext; this.Visibility = Visibility.Collapsed; base.OnApplyTemplate(); }
private Syncfusion.XForms.TabView.SfTabView GetTabView() { var _tabView = new Syncfusion.XForms.TabView.SfTabView(); _tabView.DisplayMode = TabDisplayMode.ImageWithText; _tabView.OverflowMode = OverflowMode.Scroll; _tabView.TabHeaderBackgroundColor = Color.FromHex("#2196F3"); _tabView.OverflowButtonSettings = new OverflowButtonSettings() { TitleFontColor = Color.White }; _tabView.VisibleHeaderCount = 4; if (Device.RuntimePlatform == "iOS") { _tabView.TabHeight = 60; } var index = 0; var iconList = new[] { "A", "C", "F", "H", "K" }; foreach (var category in viewModel.Categories) { var tabViewItem = new SfTabItem { Title = category, IconFont = iconList[index], Content = ListViewCollection[index], SelectionColor = Color.White, TitleFontColor = Color.LightBlue, FontIconFontColor = Color.LightBlue, TitleFontSize = Device.Idiom == TargetIdiom.Tablet ? 16 : 12 }; if (Device.RuntimePlatform == "iOS") { tabViewItem.FontIconFontFamily = "TabIcons"; } else if (Device.RuntimePlatform == "Android") { tabViewItem.FontIconFontFamily = "TabIcons.ttf"; } else if (Device.RuntimePlatform == "UWP") { #if COMMONSB tabViewItem.FontIconFontFamily = "/Assets/Fonts/TabIcons.ttf#TabIcons"; #else if (Core.SampleBrowser.IsIndividualSB) { tabViewItem.FontIconFontFamily = "/Assets/Fonts/TabIcons.ttf#TabIcons"; } else { tabViewItem.FontIconFontFamily = $"ms-appx:///SampleBrowser.SfTabView.UWP/Assets/Fonts/TabIcons.ttf#TabIcons"; //@"SampleBrowser.SfTabView.UWP\Assets\Fonts\TabIcons.ttf#TabIcons"; } #endif } _tabView.Items.Add(tabViewItem); index++; } _tabView.SelectionIndicatorSettings = new SelectionIndicatorSettings() { Position = SelectionIndicatorPosition.Bottom, Color = Color.White }; _tabView.TabHeaderPosition = TabHeaderPosition.Top; return(_tabView); }
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; } }
private async Task NavigationToPanel(Task<IEnumerable<FlightDataEntitiesRT.Charts.ChartPanel>> task, PanelChangedWrap wrapPanel) { string panelID = string.Empty; FlightAnalysisViewModel viewModel = new FlightAnalysisViewModel() { CurrentStartSecond = ApplicationContext.Instance.CurrentFlight.StartSecond, CurrentEndSecond = ApplicationContext.Instance.CurrentFlight.EndSecond }; if (wrapPanel != null) { panelID = wrapPanel.SelectedPanel.PanelID; } else { viewModel.CurrentStartSecond = 0; viewModel.CurrentEndSecond = ApplicationContext.Instance.CurrentFlight.EndSecond; } //要么是没有选择ID的,那就是第一个Panel var panels2 = await task; System.Diagnostics.Debug.WriteLine(string.Format("Flight Analysis Model Created:{0}", DateTime.Now)); this.tabHost.Items.Clear(); //create tabs if (panels2 != null && panels2.Count() > 0) { foreach (var pan in panels2) { var content = new AircraftDataAnalysisWinRT.MyControl.FAChart() { DataContext = viewModel, ViewModel = viewModel, }; content.FlightAnalysisSubNavigationRequested += content_FlightAnalysisSubNavigationRequested; SfTabItem item = new SfTabItem() { Header = pan.PanelName, Content = content, //new ScrollViewer() //{ // HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled, // HorizontalScrollMode = ScrollMode.Disabled, // VerticalScrollBarVisibility = ScrollBarVisibility.Auto, // VerticalScrollMode = ScrollMode.Auto, // Content = //} }; item.DoubleTapped += item_DoubleTapped; item.Name = pan.PanelID; this.tabHost.Items.Add(item); } } //开始注意消息循环了,最后才绑定viewModel; //m_viewModel = viewModel; if (string.IsNullOrEmpty(panelID)) { System.Diagnostics.Debug.Assert(panels2 != null && panels2.Count() > 0 && panels2.First() != null); panelID = panels2.First().PanelID; } //如果还是空,则直接Return if (string.IsNullOrEmpty(panelID)) return; m_viewModel = viewModel; SetSelectedPanel(panelID); //m_viewModel.RefreshAndRetriveData(); //this.chartTest.SubViewModel = new FlightAnalysisSubViewModel() = m_viewModel; return; //debug //TODO: rebuild bindingPanel /* this.cbPanelSelect.ItemsSource = panels2; int index = this.GetPanelSelectedIndex(panels2, panelID); m_switcher = true; this.cbPanelSelect.SelectedIndex = index; m_switcher = false; viewModel.CurrentPanel = panels2.ElementAt(index); m_viewModel = viewModel;*/ //this.grdCtrl.ViewModel = m_viewModel; //this.grdCtrl.ReBindColumns(); BindDataCore(); }
/// <summary> /// Inflates the views. /// N.B. The MapsMainPage will be added as soon as Xamarin fixes issue where /// GooglePlay services v42 works with the latest version of xamarin forms /// </summary> public void InflateViews() { GmsDirection.Init("AIzaSyCjMY_194mgeHLsyhlPre7kZ-UVXHCCt0o"); SfTabItem mnday = new SfTabItem(); mnday.Content = new Monday(); mnday.Title = "Monday"; mnday.TitleFontColor = Color.Black; mnday.Content.BackgroundColor = Color.WhiteSmoke; SfTabItem tues = new SfTabItem(); tues.Title = "Tuesday"; tues.TitleFontColor = Color.Black; tues.Content = new Tuesday(); tues.Content.BackgroundColor = Color.WhiteSmoke; SfTabItem wed = new SfTabItem(); wed.Title = "Wednesday"; wed.TitleFontColor = Color.Black; wed.Content = new Wednesday(); wed.Content.BackgroundColor = Color.WhiteSmoke; SfTabItem thurs = new SfTabItem(); thurs.Title = "Thursday"; thurs.TitleFontColor = Color.Black; thurs.Content = new Thursday(); thurs.Content.BackgroundColor = Color.WhiteSmoke; SfTabItem fri = new SfTabItem(); fri.Title = "Friday"; fri.TitleFontColor = Color.Black; fri.Content = new Friday(); fri.Content.BackgroundColor = Color.WhiteSmoke; SfTabItem daySummary = new SfTabItem(); daySummary.Title = "Day Summary"; daySummary.TitleFontColor = Color.Black; daySummary.Content = new DaySummary(); SfTabItem addTimetable = new SfTabItem(); addTimetable.Title = "Add Timetable"; addTimetable.TitleFontColor = Color.Black; addTimetable.Content = new AddTimetable(); SfTabItem Main = new SfTabItem(); Main.Title = "Menu"; Main.TitleFontColor = Color.Black; Main.Content = new SfTabView { DisplayMode = TabDisplayMode.ImageWithText, VisibleHeaderCount = 2, BackgroundColor = Color.White, EnableSwiping = true, Items = new TabItemCollection { daySummary, addTimetable }, }; Grid main = new Grid { BackgroundColor = Color.White }; main.Children.Add(new SfTabView() { DisplayMode = TabDisplayMode.ImageWithText, EnableSwiping = true, BackgroundColor = Color.WhiteSmoke, Items = new TabItemCollection { Main, mnday, tues, wed, thurs, fri } }); Content = main; }