<UserControl
    x:Class="Semi.Avalonia.Demo.Views.MainView"
    xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:pages="using:Semi.Avalonia.Demo.Pages"
    xmlns:views="clr-namespace:Semi.Avalonia.Demo.Views"
    d:DesignHeight="450"
    d:DesignWidth="800"
    x:CompileBindings="True"
    x:DataType="views:MainViewModel"
    mc:Ignorable="d">
    <Grid RowDefinitions="Auto, *">
        <Border
            Grid.Row="0"
            Margin="8"
            Padding="12,4"
            Theme="{DynamicResource CardBorder}">
            <Panel>
                <StackPanel Orientation="Horizontal" Spacing="8">
                    <ToggleSwitch
                        Name="ExpandButton"
                        Theme="{DynamicResource IconBorderlessToggleSwitch}"
                        Content="{StaticResource SemiIconSidebar}" />
                    <SelectableTextBlock
                        VerticalAlignment="Center"
                        Classes="H6"
                        Text="Semi Avalonia"
                        Theme="{DynamicResource TitleSelectableTextBlock}" />
                    <SelectableTextBlock
                        VerticalAlignment="Center"
                        Text="/" />
                    <SelectableTextBlock
                        VerticalAlignment="Center"
                        Classes="Secondary"
                        Text="{ReflectionBinding #tab.SelectedItem.Header}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button
                        Theme="{DynamicResource IconBorderlessButton}"
                        Command="{Binding OpenUrlCommand}"
                        CommandParameter="{Binding DocumentationUrl}"
                        Content="{StaticResource SemiIconGlobe}" />

                    <Button
                        Theme="{DynamicResource IconBorderlessButton}"
                        Command="{Binding OpenUrlCommand}"
                        CommandParameter="{Binding RepoUrl}"
                        Content="{StaticResource SemiIconGithubLogo}" />

                    <ToggleSwitch
                        Theme="{DynamicResource IconBorderlessToggleSwitch}"
                        Command="{Binding ToggleThemeCommand}"
                        OnContent="{StaticResource SemiIconMoon}"
                        OffContent="{StaticResource SemiIconSun}" />

                    <Button
                        Theme="{DynamicResource IconBorderlessButton}"
                        Content="{StaticResource SemiIconMenu}">
                        <Button.Flyout>
                            <MenuFlyout Placement="Bottom" ItemsSource="{Binding MenuItems}" />
                        </Button.Flyout>
                        <Button.Styles>
                            <Style Selector="MenuItem" x:DataType="views:MenuItemViewModel">
                                <Setter Property="Header" Value="{Binding Header}" />
                                <Setter Property="ItemsSource" Value="{Binding Items}" />
                                <Setter Property="Command" Value="{Binding Command}" />
                                <Setter Property="CommandParameter" Value="{Binding CommandParameter}" />
                            </Style>
                        </Button.Styles>
                    </Button>
                </StackPanel>
            </Panel>
        </Border>
        <TabControl
            Name="tab"
            Grid.Row="1"
            Margin="8"
            Padding="20,0,0,0"
            HorizontalAlignment="Stretch"
            TabStripPlacement="Left"
            Classes.Dismiss="{Binding #ExpandButton.IsChecked}"
            Theme="{DynamicResource NavigationTab}">
            <TabItem Header="Overview">
                <pages:Overview />
            </TabItem>
            <TabItem Header="Palette">
                <pages:PaletteDemo />
            </TabItem>
            <TabItem Header="HighContrastTheme">
                <pages:HighContrastDemo />
            </TabItem>
            <TabItem Header="Variables">
                <pages:VariablesDemo />
            </TabItem>
            <TabItem Header="Icon">
                <pages:IconDemo />
            </TabItem>
            <TabItem Header="AutoCompleteBox">
                <pages:AutoCompleteBoxDemo />
            </TabItem>
            <TabItem Header="Border">
                <pages:BorderDemo />
            </TabItem>
            <TabItem Header="Button">
                <pages:ButtonDemo />
            </TabItem>
            <TabItem Header="ButtonSpinner">
                <pages:ButtonSpinnerDemo />
            </TabItem>
            <TabItem Header="Calendar">
                <pages:CalendarDemo />
            </TabItem>
            <TabItem Header="CalendarDatePicker">
                <pages:CalendarDatePickerDemo />
            </TabItem>
            <TabItem Header="Carousel">
                <pages:CarouselDemo />
            </TabItem>
            <TabItem Header="CheckBox">
                <pages:CheckBoxDemo />
            </TabItem>
            <TabItem Header="ColorPicker">
                <pages:ColorPickerDemo />
            </TabItem>
            <TabItem Header="ComboBox">
                <pages:ComboBoxDemo />
            </TabItem>
            <TabItem Header="DataValidationErrors">
                <pages:DataValidationErrorsDemo />
            </TabItem>
            <TabItem Header="DataGrid">
                <pages:DataGridDemo />
            </TabItem>
            <TabItem Header="DatePicker">
                <pages:DatePickerDemo />
            </TabItem>
            <TabItem Header="Expander">
                <pages:ExpanderDemo />
            </TabItem>
            <TabItem Header="Flyout">
                <pages:FlyoutDemo />
            </TabItem>
            <TabItem Header="GridSplitter">
                <pages:GridSplitterDemo />
            </TabItem>
            <TabItem Header="HeaderedContentControl">
                <pages:HeaderedContentControlDemo />
            </TabItem>
            <TabItem Header="HyperlinkButton">
                <pages:HyperlinkButtonDemo />
            </TabItem>
            <TabItem Header="Label">
                <pages:LabelDemo />
            </TabItem>
            <TabItem Header="ListBox">
                <pages:ListBoxDemo />
            </TabItem>
            <TabItem Header="ManagedFileChooser">
                <pages:ManagedFileChooserDemo />
            </TabItem>
            <TabItem Header="Menu">
                <pages:MenuDemo />
            </TabItem>
            <TabItem Header="Notification">
                <pages:NotificationDemo />
            </TabItem>
            <TabItem Header="NumericUpDown">
                <pages:NumericUpDownDemo />
            </TabItem>
            <TabItem Header="PathIcon">
                <pages:PathIconDemo />
            </TabItem>
            <TabItem Header="ProgressBar">
                <pages:ProgressBarDemo />
            </TabItem>
            <TabItem Header="RadioButton">
                <pages:RadioButtonDemo />
            </TabItem>
            <TabItem Header="RefreshContainer">
                <pages:RefreshContainerDemo />
            </TabItem>
            <TabItem Header="RepeatButton">
                <pages:RepeatButtonDemo />
            </TabItem>
            <TabItem Header="ScrollViewer">
                <pages:ScrollViewerDemo />
            </TabItem>
            <TabItem Header="SelectableTextBlock">
                <pages:SelectableTextBlockDemo />
            </TabItem>
            <TabItem Header="Slider">
                <pages:SliderDemo />
            </TabItem>
            <TabItem Header="SplitView">
                <pages:SplitViewDemo />
            </TabItem>
            <TabItem Header="TabControl">
                <pages:TabControlDemo />
            </TabItem>
            <TabItem Header="TextBlock">
                <pages:TextBlockDemo />
            </TabItem>
            <TabItem Header="TextBox">
                <pages:TextBoxDemo />
            </TabItem>
            <TabItem Header="ThemeVariantScope">
                <pages:ThemeVariantDemo />
            </TabItem>
            <TabItem Header="TimePicker">
                <pages:TimePickerDemo />
            </TabItem>
            <TabItem Header="ToggleButton">
                <pages:ToggleButtonDemo />
            </TabItem>
            <TabItem Header="ToggleSwitch">
                <pages:ToggleSwitchDemo />
            </TabItem>
            <TabItem Header="ToolTip">
                <pages:ToolTipDemo />
            </TabItem>
            <TabItem Header="TreeView">
                <pages:TreeViewDemo />
            </TabItem>
        </TabControl>
    </Grid>

</UserControl>