Source

main / Source / Excel / Excel.AddIn / Excel.AddIn / View / Usercontrols / Citation.xaml

Naethra D ba1cb57 







































































































<UserControl
    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"
    mc:Ignorable="d"
    x:Class="DataUp.Excel.Addin.Citation"
    x:Name="UserControl"
    d:DesignWidth="640" d:DesignHeight="480">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../Resources/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <BooleanToVisibilityConverter x:Key="VisibilityConverter"></BooleanToVisibilityConverter>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel Margin="10,0,10,5">
            <TextBlock Text="Steps:" 
                   Style="{DynamicResource DescriptionTextStyle}" Margin="0,0,10,0" Foreground="{DynamicResource LabelForeground}"/>

            <TextBlock TextWrapping="Wrap" x:Name="infoText"
                   Style="{DynamicResource DescriptionTextStyle}" Foreground="{DynamicResource LabelForeground}">
                    <Run Text="1. Retrieve an identifier from the repository for your dataset"/>
                    <Run Text="(Read this important information about your unique identifier"/>
                    <Hyperlink x:Name="hyperLink" Click="hyperLink_Click">
                        here
                    </Hyperlink>
                    <Run Text=")"/>
            </TextBlock>

            <Popup x:Name="infoPopup" Placement="MousePoint"  PlacementTarget="{Binding ElementName=infoText}" AllowsTransparency="True" PopupAnimation="Fade" StaysOpen="False">
                <Grid>
                    <ContentControl Margin="6" Opacity="0.8"  VerticalAlignment="Stretch" Style="{DynamicResource RoundedShadowControl}"/>
                    <Border Margin="6" CornerRadius="4" Padding="10" Background="White" BorderBrush="#FFEFEFEF">
                        <StackPanel>
                            <TextBlock TextWrapping="Wrap" Style="{DynamicResource DescriptionTextStyle}" MaxWidth="400" Foreground="{DynamicResource LabelForeground}" Margin="0,0,0,10"
                                   Text="A unique identifier is critical for citing and locating data sets. Your repository will provide you with an identifier when you click 'Get Identifier'.  If you have not yet clicked this button for  this data file, you must do so to obtain a unique identifier." >
                            </TextBlock>
                            <TextBlock TextWrapping="Wrap" Style="{DynamicResource DescriptionTextStyle}" MaxWidth="400" Foreground="{DynamicResource LabelForeground}" Margin="0,0,0,10"
                                   Text="If your data file is a more recent version of an existing data file that already has an identifier, the same identifier should be used for both versions. Be sure that the identifier for your data file has been generated specifically for that data file." >
                            </TextBlock>
                            <TextBlock TextWrapping="Wrap" Style="{DynamicResource DescriptionTextStyle}" MaxWidth="400" Foreground="{DynamicResource LabelForeground}"
                                   Text="If you have not yet clicked this button for  this data file, you must do so to obtain a unique identifier. If your data file is a more recent version of an existing data file that already has an identifier, the same identifier should be used for both versions. Be sure that the identifier for your data file has been generated specifically for that data file." >
                            </TextBlock>
                        </StackPanel>
                    </Border>
                </Grid>
            </Popup>

            <TextBlock Text="2. Check the rest of the information below for accuracy" 
                   Style="{DynamicResource DescriptionTextStyle}" Foreground="{DynamicResource LabelForeground}"/>
            <TextBlock Text="3. Make any necessary changes or edits to the information" 
                   Style="{DynamicResource DescriptionTextStyle}" Foreground="{DynamicResource LabelForeground}"/>
            <TextBlock Text="4. Click 'Generate Citation' to create your data citation" 
                   Style="{DynamicResource DescriptionTextStyle}"  Foreground="{DynamicResource LabelForeground}"/>

            <TextBlock Margin="0,10,0,10" Text="{Binding IdentifierExistsMessage}" Style="{DynamicResource ErrorLabelStyle}"
                       Visibility="{Binding EnableGetIdentifier, Converter={StaticResource VisibilityConverter}}" />
        </StackPanel>
        <StackPanel Grid.Row="1" Margin="{DynamicResource ControlMargin}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <StackPanel Style="{DynamicResource StackItemPanel}" >
                    <TextBlock Text="Unique identifier" Style="{DynamicResource LabelStyle}" ToolTip="This will be provided by the repository."/>
                    <TextBox Text="{Binding Identifier}" Style="{DynamicResource TextBoxStyle}" IsEnabled="{Binding EnableGetIdentifier}"/>
                    <Button Content="Retrieve an identifier" Tag="pack://application:,,,/DataUp.Addin;component/Resources/Images/GetId_Icon.png" Style="{DynamicResource ImageButtonStyle}" Width="150"
                        Command="{Binding GetIdentifierCommand}" IsEnabled="{Binding EnableGetIdentifier}"/>
                </StackPanel>

            </Grid>
            <StackPanel Style="{DynamicResource StackItemPanel}" >
                <TextBlock Text="Publication year" Style="{DynamicResource LabelStyle}" ToolTip="Year data are being submitted (usually the current year)."/>
                <TextBox x:Name="PublicationYearTextBox" Text="{Binding PublicationYear, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" Style="{DynamicResource TextBoxStyle}"/>
                <ContentControl IsEnabled="{Binding ElementName=PublicationYearTextBox,Path=(Validation.HasError),Mode=OneWay}" Style="{DynamicResource ErrorContentControl}" Content="{Binding ElementName=PublicationYearTextBox ,Path=(Validation.Errors).CurrentItem.ErrorContent}"/>
            </StackPanel>
            <StackPanel Style="{DynamicResource StackItemPanel}" >
                <TextBlock Text="Dataset title" Style="{DynamicResource LabelStyle}" ToolTip="Use a distinct title for the dataset that identifies its contents"/>
                <TextBox Text="{Binding Title}" Style="{DynamicResource TextBoxStyle}"/>
            </StackPanel>
            <StackPanel Style="{DynamicResource StackItemPanel}" >
                <TextBlock Text="Dataset version" Style="{DynamicResource LabelStyle}" ToolTip="If this is a new submission, the version number is 1. Updated versions should be sequentially ordered." />
                <TextBox Text="{Binding Version}" Style="{DynamicResource TextBoxStyle}"/>
            </StackPanel>
            <StackPanel Style="{DynamicResource StackItemPanel}" >
                <TextBlock Text="Publisher (Data owner)" Style="{DynamicResource LabelStyle}" ToolTip="List dataset authors, last name first."/>
                <TextBox Text="{Binding Publisher}" Style="{DynamicResource TextBoxStyle}"/>
            </StackPanel>
            <StackPanel Style="{DynamicResource StackItemPanel}" >
                <TextBlock Text="Citation" Style="{DynamicResource LabelStyle}"/>
                <TextBox Text="{Binding Citation}" TextWrapping="Wrap" IsReadOnly="True"  Style="{DynamicResource TextBoxStyle}" Height="62"/>
                <Button Content="Generate citation" Tag="pack://application:,,,/DataUp.Addin;component/Resources/Images/Populate_Icon.png" Style="{DynamicResource ImageButtonStyle}" Width="150" VerticalAlignment="Bottom"
                        Command="{Binding GenerateCitationCommand}"/>
            </StackPanel>
        </StackPanel>
    </Grid>
</UserControl>