<fw:BaseWindow x:Class="Com.FirmLib.UI.Seller.WinSupplyContractNoSelector"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:fw="http://schemas.FWind/xaml"
             xmlns:uc="clr-namespace:Com.FirmLib.UI.Common"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             Name="this"
            Height="350" Width="300" Title="供应商合同" WindowStartupLocation="CenterOwner">
     <fw:BaseWindow.Resources>
        <fw:BindingProxy x:Key="DATA" Data="{Binding}"></fw:BindingProxy>
    </fw:BaseWindow.Resources>
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="30"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
             <Label   Content="供应合同编号"></Label>
            <TextBox Grid.Row="1" Text="{Binding UseNo,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"  Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.TextBoxKey}}" Margin="5">
            </TextBox>

            <GroupBox Grid.Row="2" VerticalAlignment="Stretch">
                <GroupBox.Header>
                    <TextBlock Text="从已有供应商合同编号中选择"></TextBlock>
                </GroupBox.Header>
                <Grid>
                    <ListBox  x:Name="List" Margin="0,10,0,0" ItemsSource="{Binding ExistContracts}" SelectedItem="{Binding CurrentNo,Mode=TwoWay}">
                         <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseLeftButtonUp">
                    <i:InvokeCommandAction Command="{Binding Data.Commands.SelectCommand,Source={StaticResource ResourceKey=DATA}}" CommandParameter="{Binding SelectedItem,ElementName=List}" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
                    </ListBox>
                </Grid>
               
            </GroupBox>
        </Grid>

        <StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
            <Button Command="{Binding Commands.GetContractNo}" CommandParameter="{Binding ElementName=this}"  Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}"  Height="23" Width="60"   Content="完成" Click="btnOK_Click"/>
        </StackPanel>
    </Grid>
</fw:BaseWindow>
