<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:vm="using:DodoSSH.Client.Shell.ViewModels"
             xmlns:views="using:DodoSSH.Client.App.Views"
             x:Class="DodoSSH.Client.App.Views.SettingsView"
             x:DataType="vm:MainWindowViewModel">

  <!--
    v5c: the settings MODE — the full-window chrome swap the design calls Settings, built as one control so
    MainWindow.axaml can show or hide the whole thing behind MainWindowViewModel.IsSettingsMode with a single
    IsVisible, the same way it already does for the unlocked application and the setup half of the window.

    Titlebar, then a row of the 340px SettingsNav beside whichever page ActiveSettingsPage names. Seven pages
    now, all of the design's — v5c-2 added Groups and Tags and retired the old VaultsScreen; see
    SettingsNav.axaml and design-notes/v5c-fidelity-notes.md.

    Every page including Vaults is wrapped in the 1100px centred column now. SettingsVaultsPage replaces the
    old VaultsScreen's own 268px-list-beside-a-full-bleed-pane layout with the design's card idiom — see that
    page's own remark for what changed and why.

    v5c-3: ImportScreen joined the Panel, drawn over SettingsPreferencesPage rather than beside it — see
    MainWindowViewModel.IsImportOpen. SettingsNav stays lit on Preferences the whole time, per Import.dc.html,
    because ActiveSettingsPage never actually leaves SettingsPage.Preferences; only IsImportOpen and the pair
    of IsVisible bindings below move. Its data context is ImportScreen rather than this control's own, the
    same split MainWindow.axaml drew before the importer moved in here.
  -->

  <Grid RowDefinitions="Auto,*" Background="{StaticResource Canvas}">

    <views:SettingsTitleBar Grid.Row="0" />

    <Grid Grid.Row="1" ColumnDefinitions="Auto,*">

      <views:SettingsNav Grid.Column="0" />

      <Panel Grid.Column="1">

        <views:SettingsGeneralPage IsVisible="{Binding IsSettingsGeneralPage}" />

        <views:SettingsVaultsPage IsVisible="{Binding IsSettingsVaultsPage}" />

        <views:SettingsAccountPage IsVisible="{Binding IsSettingsAccountPage}" />

        <views:SettingsSecurityPage IsVisible="{Binding IsSettingsSecurityPage}" />

        <views:SettingsPreferencesPage IsVisible="{Binding IsSettingsPreferencesContentShowing}" />

        <views:SettingsGroupsPage IsVisible="{Binding IsSettingsGroupsPage}" />

        <views:SettingsTagsPage IsVisible="{Binding IsSettingsTagsPage}" />

        <!--
          Wrapped, like MainWindow.axaml wraps every screen whose data context is its own rather than this
          control's: IsVisible has to resolve against the ambient MainWindowViewModel, and putting it on the
          same element as the DataContext override below would have it resolve against ImportViewModel
          instead, where IsImportOpen does not exist.
        -->
        <Panel IsVisible="{Binding IsImportOpen}">
          <views:ImportScreen DataContext="{Binding ImportScreen}" />
        </Panel>

      </Panel>

    </Grid>

  </Grid>

</UserControl>
