<UserControl x:Class="AvalonStudio.Controls.Standard.SettingsDialog.SettingsDialogView"
             xmlns="https://github.com/avaloniaui"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:vm="clr-namespace:AvalonStudio.Extensibility.Settings;assembly=AvalonStudio.Shell.Extensibility"
             xmlns:cont="clr-namespace:AvalonStudio.Controls;assembly=AvalonStudio.Shell.Extensibility">
    <Grid>
        <DockPanel>
            <Grid DockPanel.Dock="Left" Width="300">
                <TreeView BorderThickness="1" BorderBrush="{DynamicResource ThemeBorderDarkBrush}" Items="{Binding Categories}" SelectedItem="{Binding SelectedSetting, Mode=TwoWay}">
                  <TreeView.Styles>
                    <Style Selector="TreeViewItem">
                      <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
                    </Style>
                  </TreeView.Styles>
                    <TreeView.DataTemplates>
                        <TreeDataTemplate DataType="vm:SettingsCategoryViewModel" ItemsSource="{Binding Dialogs}">
                          <TextBlock Text="{Binding Title}" />
                        </TreeDataTemplate>

                        <TreeDataTemplate DataType="vm:SettingsViewModel" ItemsSource="{Binding Dialogs}">
                            <TextBlock Text="{Binding Title}" />
                        </TreeDataTemplate>
                    </TreeView.DataTemplates>
                </TreeView>
            </Grid>
            <Grid>
                <cont:ViewModelViewHost DataContext="{Binding SelectedSetting}" Margin="4" />
            </Grid>
        </DockPanel>
    </Grid>
</UserControl>