<ResourceDictionary
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:clr="clr-namespace:System;assembly=mscorlib" 
                    xmlns:clr2="clr-namespace:System.Collections;assembly=mscorlib" 
                    xmlns:wpg="clr-namespace:WPG;assembly=WPG"
                   xmlns:converters="clr-namespace:WPG.Converters;assembly=WPG" 
                    xmlns:typeeditors="clr-namespace:WPG.TypeEditors;assembly=WPG" 
                    xmlns:usercontrols="clr-namespace:WPG.UserControls;assembly=WPG" 
                   xmlns:TypeEditors="clr-namespace:WPG.Themes.TypeEditors;assembly=WPG"
                   xmlns:fw="http://schemas.FWind/xaml"
                  xmlns:wpf="clr-namespace:FWindSoft.Wpf;assembly=FWindSoft.Wpf"
    >

    <DataTemplate x:Key="default">
        <TextBox fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=Value,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" IsReadOnly="{Binding Path=IsReadOnly}" Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId=TextBoxStyle}}">
            <TextBox.Text>
                <Binding Mode="TwoWay" Path="Value" UpdateSourceTrigger="LostFocus">
                    <Binding.ValidationRules>
                        <ExceptionValidationRule />
                    </Binding.ValidationRules>
                </Binding>
            </TextBox.Text>
        </TextBox>
    </DataTemplate>
    <DataTemplate x:Key="TextBox_Double_A1">
        <usercontrols:TextBox_Double_A1 fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=Value,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"  IsReadOnly="{Binding Path=IsReadOnly}" Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId=TextBoxStyle}}">
            <TextBox.Text>
                <Binding Mode="TwoWay" Path="Value" UpdateSourceTrigger="LostFocus">
                    <Binding.ValidationRules>
                        <ExceptionValidationRule />
                    </Binding.ValidationRules>
                </Binding>
            </TextBox.Text>
        </usercontrols:TextBox_Double_A1>
    </DataTemplate>
    <DataTemplate x:Key="Textbox_DoubleUnit_A2">
        <usercontrols:Textbox_DoubleUnit_A2 fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=Value, UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
            Text="{Binding Path=Value, Mode=TwoWay}"
            TextUnit="{Binding Path=Property.ExtendObject.Unit, Mode=TwoWay}">
        </usercontrols:Textbox_DoubleUnit_A2>
    </DataTemplate>
    <DataTemplate x:Key="TextBox_String_B1">
        <usercontrols:TextBox_String_B1 fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=Value,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"  IsReadOnly="{Binding Path=IsReadOnly}" Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId=TextBoxStyle}}">
            <TextBox.Text>
                <Binding Mode="TwoWay" Path="Value" UpdateSourceTrigger="LostFocus">
                    <Binding.ValidationRules>
                        <ExceptionValidationRule />
                    </Binding.ValidationRules>
                </Binding>
            </TextBox.Text>
        </usercontrols:TextBox_String_B1>
    </DataTemplate>

    <DataTemplate x:Key="DataTime_Date_C5">
        <DatePicker  fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=Value,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
            <DatePicker.SelectedDate>
                <Binding Path="Value" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" Converter="{x:Static wpf:DateTimeConverter.Date}">
                </Binding>
            </DatePicker.SelectedDate>
        </DatePicker>
    </DataTemplate>

    <DataTemplate x:Key="Enum_D1">
        <ComboBox fw:ElementCopyOptions.UseCopy="True" fw:ElementCopyOptions.CopyValue="{Binding Path=Value,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"  IsReadOnly="{Binding Path=IsReadOnly}" Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId=ComboBoxStyle}}" 
                  ItemsSource="{Binding Property.ExtendObject.EnumItems}" DisplayMemberPath="Name" SelectedValuePath="Value"  SelectedValue="{Binding Path=Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
        </ComboBox>
    </DataTemplate>
    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId={x:Type Brush}}">
        <TypeEditors:BrushEditorControl Brush="{Binding Path=Value}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"></TypeEditors:BrushEditorControl>
    </DataTemplate>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId={x:Type clr:Int32}}">
        <typeeditors:IntegerTypeEditor Text="{Binding Path=Value,UpdateSourceTrigger=PropertyChanged}" IsReadOnly="{Binding Path=IsReadOnly}" Foreground="Black"></typeeditors:IntegerTypeEditor>
    </DataTemplate>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId={x:Type clr:Boolean}}">
        <CheckBox Margin="2 0 0 0" Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId=CheckBoxStyle}}" IsEnabled="{Binding Path=IsWriteable}" IsChecked="{Binding Path=Value}" />
    </DataTemplate>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId={x:Type clr2:IList}}">
        <ListBox ItemsSource="{Binding Path=Value}" />
    </DataTemplate>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId={x:Type clr:Enum}}">
        <ComboBox Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId=ComboBoxStyle}}" 
                  SelectedItem="{Binding Path=Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
            <ComboBox.ItemsSource>
                <Binding Path="Value">
                    <Binding.Converter>
                        <converters:EnumTypeConverter />
                    </Binding.Converter>
                </Binding>
            </ComboBox.ItemsSource>
        </ComboBox>
    </DataTemplate>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId={x:Type clr:Double}}">
        <TextBox IsReadOnly="{Binding Path=IsReadOnly}" Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId=TextBoxStyle}}">
            <TextBox.Text>
                <Binding Mode="TwoWay" Path="Value">
                    <Binding.Converter>
                        <converters:DoubleTypeConverter />
                    </Binding.Converter>
                </Binding>
            </TextBox.Text>
        </TextBox>
    </DataTemplate>

    <!--对应资产-->
    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId={x:Type usercontrols:UcReferenceFM}}">
        <usercontrols:UcReferenceFM></usercontrols:UcReferenceFM>
    </DataTemplate>
    <!--生产厂家-->
    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId={x:Type usercontrols:UcPopups}}">
        <usercontrols:UcPopups></usercontrols:UcPopups>
    </DataTemplate>
    <!--铭牌照片-->
    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type wpg:PropertyGrid}, ResourceId={x:Type usercontrols:UcPopups_Nameplate}}">
        <usercontrols:UcPopups_Nameplate></usercontrols:UcPopups_Nameplate>
    </DataTemplate>
</ResourceDictionary>