Source

main / Source / Excel / Excel.AddIn / Excel.AddIn / View / PostWizard.xaml

Full commit
<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    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:local="clr-namespace:DataUp.Excel.Addin"
    xmlns:extToolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit.Extended"
    x:Class="DataUp.Excel.Addin.PostWizard"
    x:Name="Window" KeyDown="OnKeyDown"    
    Title="Post Wizard" Background="{x:Null}" AllowsTransparency="True" WindowStyle="None"  WindowStartupLocation="CenterOwner"
    Width="840" Height="620" ResizeMode="NoResize">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <BooleanToVisibilityConverter x:Key="VisibilityConverter"></BooleanToVisibilityConverter>
            <local:PostWizardViewModel x:Key="Model"/>
        </ResourceDictionary>
    </Window.Resources>

    <Grid x:Name="LayoutRoot">
        <GroupBox MouseLeftButtonDown="OnMouseLeftButtonDown" Header="FILE POST" Tag="Generic" Style="{DynamicResource PopupContainerStyle}" Margin="10" 
                  Visibility="{Binding ShowSelectTab, Converter={StaticResource VisibilityConverter}}">
            <StackPanel>
                <TextBlock Margin="0,50,0,0" Width="Auto" Text="You can upload your file as CSV or XLSX" HorizontalAlignment="Center" FontWeight="SemiBold" Style="{DynamicResource LabelStyle}" Foreground="#FF888888" FontSize="16"
                            Visibility="{Binding ShowSelect, Converter={StaticResource VisibilityConverter}}"/>
                <Grid Margin="0,50,0,0" HorizontalAlignment="Center" Width="500"  Visibility="{Binding ShowSelect, Converter={StaticResource VisibilityConverter}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="1"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <GroupBox Header="CSV" Style="{DynamicResource HomepageInfo}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="1"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <TextBlock Foreground="#FF888888" FontSize="13" TextWrapping="Wrap" Style="{DynamicResource LabelStyle}" Width="Auto" VerticalAlignment="Top"
                               Text="All Embedded Objects, Graphs, images, etc will be removed from your data file." />
                            <Rectangle Fill="#FFEFEFEF" Grid.Row="1"/>
                            <Button Grid.Row="2" Content="POST AS CSV" Style="{DynamicResource GreenButton}" HorizontalAlignment="Center" Margin="0,10,0,5"
                            VerticalAlignment="Bottom" Command="{Binding PostAsCsvCommand}" CommandParameter="{Binding}"/>
                        </Grid>
                    </GroupBox>
                    <Rectangle Fill="#FFEFEFEF" Margin="0,10" Grid.Column="1"/>
                    <GroupBox Header="XLSX" Grid.Column="2" Style="{DynamicResource HomepageInfo}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="1"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <TextBlock Foreground="#FF888888" FontSize="13"  TextWrapping="Wrap" Style="{DynamicResource LabelStyle}" Width="Auto" VerticalAlignment="Top" 
                                       Text="Your file may contain embedded Objects, Graphs, images, etc. Also, please ensure the repository you are posting accepts XLSX format files." />
                            <Rectangle Fill="#FFEFEFEF" Grid.Row="1"/>
                            <Button Grid.Row="2" Content="POST AS XLSX" Style="{DynamicResource GreenButton}" HorizontalAlignment="Center" Margin="0,10,0,5"
                                    VerticalAlignment="Bottom" Command="{Binding PostAsXlsxCommand}" CommandParameter="{Binding}"/>
                        </Grid>
                    </GroupBox>
                </Grid>
                <StackPanel Visibility="{Binding ShowErrorStatus, Converter={StaticResource VisibilityConverter}}">
                    <local:PostSuccessError DataContext="{Binding PostMessage}" Tag="Error"/>
                </StackPanel>
                <StackPanel Visibility="{Binding ShowSuccessStatus, Converter={StaticResource VisibilityConverter}}">
                    <local:PostSuccessError DataContext="{Binding PostMessage}" />
                </StackPanel>
            </StackPanel>
        </GroupBox>
        <GroupBox MouseLeftButtonDown="OnMouseLeftButtonDown"  Header="FILE POST" Style="{DynamicResource PopupContainerStyle}" Margin="10" Tag="{Binding SubHeaderText}"  
                  Visibility="{Binding ShowWizardTab, Converter={StaticResource VisibilityConverter}}" >
            <extToolkit:BusyIndicator IsBusy="{Binding IsBusy}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <ContentControl Opacity="0.2" Content="ContentControl" VerticalAlignment="Stretch" Style="{DynamicResource SharpShadowControl}" />
                    <Rectangle Fill="White" Stroke="{DynamicResource WizardControlBorderBrush}" SnapsToDevicePixels="True"/>
                    <Rectangle Fill="{DynamicResource PatternImageBrush}" Opacity="0.06" SnapsToDevicePixels="True"/>
                    <TabControl x:Name="tabControl"  Style="{DynamicResource WizardTabControl}" ItemContainerStyle="{DynamicResource WizardTabItemStyle}" 
                            Margin="0,10,0,0" SelectedIndex="{Binding CurrentIndex}">
                        <TabItem Header="issues" IsEnabled="{Binding IssuesTabState.IsEnabled}" PreviewMouseLeftButtonDown="OnPreviewMouseLeftButtonDown"
                             IsSelected="{Binding IssuesTabState.IsCurrent}" Tag="0">
                            <Grid>
                                <local:ErrorXSLX DataContext="{Binding ErrorPaneViewModel}"/>
                            </Grid>
                        </TabItem>
                        <TabItem Header="descriptions" IsEnabled="{Binding MetadataTabState.IsEnabled}" PreviewMouseLeftButtonDown="OnPreviewMouseLeftButtonDown"
                             IsSelected="{Binding MetadataTabState.IsCurrent}" Tag="0">
                            <Grid>
                                <local:Metadata VerticalAlignment="Top" DataContext="{Binding MetadataListViewModel}"/>
                            </Grid>
                        </TabItem>
                        <TabItem Header="citation" IsEnabled="{Binding CitationTabState.IsEnabled}" PreviewMouseLeftButtonDown="OnPreviewMouseLeftButtonDown"
                             IsSelected="{Binding CitationTabState.IsCurrent}">
                            <Grid>
                                <local:Citation DataContext="{Binding CitationViewModel}"/>
                            </Grid>
                        </TabItem>
                        <TabItem Header="post" Tag="LastItem" IsEnabled="{Binding PostTabState.IsEnabled}" PreviewMouseLeftButtonDown="OnPreviewMouseLeftButtonDown"
                             IsSelected="{Binding PostTabState.IsCurrent}">
                            <Grid>
                                <local:PostControl DataContext="{Binding RepositoryDetailListViewModel}"/>
                            </Grid>
                        </TabItem>
                    </TabControl>
                    <StackPanel Grid.Row="1" Style="{DynamicResource ButtonContainer}">
                        <Button Content="BACK" Style="{DynamicResource CommonButtonStyle}" Tag="Back"
                            Visibility="{Binding CurrentTabState.ShowBack, Converter={StaticResource VisibilityConverter}}" 
                            Command="{Binding BackCommand}" CommandParameter="{Binding}"/>
                        <Button Content="CANCEL" Style="{DynamicResource CommonButtonStyle}" Tag="Cancel" 
                            Visibility="{Binding CurrentTabState.ShowCancel, Converter={StaticResource VisibilityConverter}}" IsCancel="True" />
                        <Button Content="NEXT" Style="{DynamicResource CommonButtonStyle}" Tag="Next" 
                            Visibility="{Binding CurrentTabState.ShowNext, Converter={StaticResource VisibilityConverter}}" 
                            Command="{Binding NextCommand}" CommandParameter="{Binding}"/>
                        <Button Content="POST" Style="{DynamicResource CommonButtonStyle}" Tag="Post" 
                            Visibility="{Binding CurrentTabState.ShowPost, Converter={StaticResource VisibilityConverter}}" 
                            Command="{Binding PostCommand}" CommandParameter="{Binding}"/>
                    </StackPanel>
                </Grid>
            </extToolkit:BusyIndicator>
        </GroupBox>

        <Border BorderThickness="1" Background="#88272727" CornerRadius="5" Margin="10" Visibility="{Binding ShowIdentifier, Converter={StaticResource VisibilityConverter}}">
            <GroupBox MouseLeftButtonDown="OnMouseLeftButtonDown" Style="{DynamicResource PopupContainerStyle}" Tag="GenericSmall" Header="GET IDENTIFIER" HorizontalAlignment="Center" VerticalAlignment="Center" >
                <local:GetIdentifierControl VerticalAlignment="Center" HorizontalAlignment="Center"
                                            DataContext="{Binding GetIdentifierViewModel}"/>
            </GroupBox>
        </Border>
    </Grid>
</Window>