public Form Tabs(params model.TabCreationInfo[] newTabsToCreate)
        {
            var tc = new Avalonia.Controls.TabControl();

            foreach (var tabCreator in newTabsToCreate)
            {
                addTabToTabControl(tc, tabCreator);
            }

            AddRowToHost(tc, rowAutoHeight: false);

            return(this);
        }
        public Form Tabs(params InitializeTabDelegate[] tabs)
        {
            var tc = new Avalonia.Controls.TabControl();

            foreach (var newTabInitFunction in tabs)
            {
                var tabCreateInfo = new model.TabCreationInfo();
                newTabInitFunction(tabCreateInfo);

                addTabToTabControl(tc, tabCreateInfo);
            }

            AddRowToHost(tc, rowAutoHeight: false);

            return(this);
        }
Exemple #3
0
 public static Control TabControlTemplate(TabControl control)
 {
     return new Grid
     {
         ColumnDefinitions = new ColumnDefinitions
         {
             new ColumnDefinition(GridLength.Auto),
             new ColumnDefinition(new GridLength(1, GridUnitType.Star)),
         },
         Children = new Controls
         {
             new Border
             {
                 Width = 190,
                 Background = Brush.Parse("#1976D2"),
                 Child = new ScrollViewer
                 {
                     Content = new TabStrip
                     {
                         Name = "PART_TabStrip",
                         ItemsPanel = new FuncTemplate<IPanel>(() => new StackPanel { Orientation = Orientation.Vertical, Gap = 4 }),
                         Margin = new Thickness(0, 10, 0, 0),
                         MemberSelector = TabControl.HeaderSelector,
                         [!ItemsControl.ItemsProperty] = control[!ItemsControl.ItemsProperty],
                         [!!SelectingItemsControl.SelectedItemProperty] = control[!!SelectingItemsControl.SelectedItemProperty],
                     }
                 }
             },
             new Carousel
             {
                 Name = "PART_Content",
                 MemberSelector = TabControl.ContentSelector,
                 [~Carousel.TransitionProperty] = control[~TabControl.TransitionProperty],
                 [!Carousel.ItemsProperty] = control[!ItemsControl.ItemsProperty],
                 [!Carousel.SelectedItemProperty] = control[!SelectingItemsControl.SelectedItemProperty],
                 [Grid.ColumnProperty] = 1,
             }
         }
     };
 }
Exemple #4
0
        public static Window Create()
        {

            TabControl container;


            Window window = new Window
            {
                Title = "Avalonia Test Application",
                //Width = 900,
                //Height = 480,
                Content = (container = new TabControl
                {
                    Padding = new Thickness(5),
                    Items = new[]
                    {
                        ButtonsTab(),
                        TextTab(),
                        HtmlTab(),
                        ImagesTab(),
                        ListsTab(),
                        LayoutTab(),
                        AnimationsTab(),
                    },
                    Transition = new CrossFade(TimeSpan.FromSeconds(0.25)),
                    [Grid.RowProperty] = 1,
                    [Grid.ColumnSpanProperty] = 2,
                })

            };

            container.Classes.Add("container");
            
            window.Show();
            return window;
        }