<UserControl x:Class="Com.FirmLib.UI.ContactInformationEditor"
             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:uc="clr-namespace:Com.FirmLib.UI.Common"
             xmlns:controls="http://schemas.FWind/xaml"
             xmlns:bllCommon="clr-namespace:Com.FirmLib.UI.BllCommon"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Name="this" Height="{Binding Height,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}"
             Width="{Binding Width,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}" >
    <Grid>
        <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch">
            <Label  Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.StarLableKey}}" Content="联系人:"></Label>

            <controls:TextBoxEditor  Style="{StaticResource ResourceKey={x:Static controls:ResourceKeys.ErrorTemplateKey2}}" Command="{x:Static bllCommon:EditCommands.SingleUpdate}" 
                                    CommandParameter="{Binding RelativeSource={RelativeSource Self}}" Tag="People" Margin="3" >
                <controls:TextBoxEditor.Text>
                    <Binding Path="People" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" >
                        <Binding.ValidationRules>
                            <controls:RequireValidationRule ></controls:RequireValidationRule>

                        </Binding.ValidationRules>
                    </Binding>
                </controls:TextBoxEditor.Text>
            </controls:TextBoxEditor>
            
            <Label  Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.StarLableKey}}" Content="联系电话:"></Label>
            <!--Text="{Binding Telephone,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"-->
            <controls:TextBoxEditor Style="{StaticResource ResourceKey={x:Static controls:ResourceKeys.ErrorTemplateKey2}}"
                                    Command="{x:Static bllCommon:EditCommands.SingleUpdate}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" Tag="Telephone"  Margin="3">
                <controls:TextBoxEditor.Text>
                    <Binding Path="Telephone" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" >
                        <Binding.ValidationRules>
                            <controls:RequireValidationRule ></controls:RequireValidationRule>
                            <controls:PhoneValidationRule ErrorMessage="电话手机号码不正确"></controls:PhoneValidationRule>
                        </Binding.ValidationRules>
                    </Binding>
                </controls:TextBoxEditor.Text>
               
            </controls:TextBoxEditor>
           
            <Label  Content="传真:"></Label>

            <controls:TextBoxEditor Text="{Binding Fax,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="3" 
                                    Command="{x:Static bllCommon:EditCommands.SingleUpdate}" 
                                    CommandParameter="{Binding RelativeSource={RelativeSource Self}}" Tag="Fax">
            </controls:TextBoxEditor>
            <Label   Content="电子邮件:"></Label>

            <controls:TextBoxEditor Text="{Binding Email,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"  Margin="3" 
                                    Command="{x:Static bllCommon:EditCommands.SingleUpdate}" 
                                    CommandParameter="{Binding RelativeSource={RelativeSource Self}}" Tag="Email">
            </controls:TextBoxEditor>
        </StackPanel>
    </Grid>
</UserControl>
