<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="InvExplorer.MainPage" mc:Ignorable="d" FontFamily="Arial" FontSize="14" d:DesignHeight="300" d:DesignWidth="600" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:InvExplorer" xmlns:auth="clr-namespace:MyAuth">
  
  <!-- layout root -->
  <Grid x:Name="LayoutRoot" Background="Black" DataContext="{StaticResource _model}">
    <Grid.RowDefinitions>
      <RowDefinition Height="auto" />
      <RowDefinition /> 
    </Grid.RowDefinitions>

    <!-- header -->
    <Border Background="Black">
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto" />
          <ColumnDefinition Width="Auto" />
          <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Image Source="Resources/InvExplorerLogo.png" Stretch="None" Margin="8" />
        <TextBlock Grid.Column="1" Text="ComponentOne invexplorer" Opacity=".5" FontSize="30" Foreground="White" VerticalAlignment="Center" />
        <StackPanel Grid.Column="0" Grid.ColumnSpan="3" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right">
          <HyperlinkButton Content="portolio" Command="{Binding SwitchPanelCommand, ElementName=_tp}" CommandParameter="_pPortfolio" ToolTipService.ToolTip="Add, remove, or modify items in the current portfolio." />
          <HyperlinkButton Content="all portfolios" Command="{Binding SwitchPanelCommand, ElementName=_tp}" CommandParameter="_pAllPortfolios" ToolTipService.ToolTip="Add, remove, or rename portfolios." />
          <HyperlinkButton Content="export" Command="{Binding SwitchPanelCommand, ElementName=_tp}" CommandParameter="_pExport" ToolTipService.ToolTip="Export portfolio and financial data." />
          <HyperlinkButton Content="about" Command="{Binding SwitchPanelCommand, ElementName=_tp}" CommandParameter="_pAbout" ToolTipService.ToolTip="Find out more about this application." />
          <auth:LoginControl x:Name="_ctlLogin" VerticalAlignment="Center" ToolTipService.ToolTip="Log in to enable additional functionality." />
        </StackPanel>
      </Grid>
    </Border>

    <!-- content area -->
    <local:TransitionPanel x:Name="_tp" Grid.Row="1" SelectedIndex="0">
      <local:PortfolioView x:Name="_pPortfolio" />
      <local:AllPortfoliosView x:Name="_pAllPortfolios" />
      <local:ExportView x:Name="_pExport" />
      <local:AboutView x:Name="_pAbout" />
    </local:TransitionPanel>
  </Grid>
</UserControl>