|
|
|
|
<UserControl x:Class="Kingo.Plugin.MapView.Views.AttributeEdit"
|
|
|
|
|
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"
|
|
|
|
|
mc:Ignorable="d" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
|
|
|
|
xmlns:comboBox="clr-namespace:KUI.ComboBox;assembly=KUI"
|
|
|
|
|
d:DesignHeight="300" d:DesignWidth="300" >
|
|
|
|
|
<Grid>
|
|
|
|
|
<DataGrid Name="MyPropertyGrid" Grid.Column="1" Grid.RowSpan="2" CanUserAddRows="False" HorizontalAlignment="Stretch" ColumnWidth="*" AlternationCount="2" VerticalAlignment="Stretch" AutoGenerateColumns="False" CanUserResizeRows="False" CanUserReorderColumns="False" SelectionMode="Single" EnableRowVirtualization="False">
|
|
|
|
|
<DataGrid.RowStyle>
|
|
|
|
|
<Style TargetType="DataGridRow">
|
|
|
|
|
<Setter Property="Height" Value="30" />
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGrid.RowStyle>
|
|
|
|
|
<DataGrid.Columns>
|
|
|
|
|
<DataGridTemplateColumn Header="属性" IsReadOnly="True" Width="130">
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<!--<Label Content="{Binding Text}" Tag="{Binding Key}" ToolTip="{Binding HeaderToolTip}"></Label>-->
|
|
|
|
|
<Label Content="{Binding Key}" ToolTip="{Binding HeaderToolTip}" Foreground="{Binding FontColor}" ></Label>
|
|
|
|
|
<Label Name="LabelColor" Content="{Binding Text}" Foreground ="{Binding FontColor}"></Label>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
<DataGridTemplateColumn Header="值">
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<Grid>
|
|
|
|
|
<comboBox:AutoCompleteBox Name="ComboBox" Background="White" KeyFieldName="ID" IsReadOnly="True" IsEditable="True" IsGroup="True" ParentFieldName="PID" DisplayMemberPath="NAME" ValueMemberPath="CODE" Visibility="Collapsed" BorderBrush="AliceBlue"/>
|
|
|
|
|
|
|
|
|
|
<!--<dxe:ComboBoxEdit x:Name="MultiComboBox" IsTextEditable="False" Background="White" IsReadOnly="True" Visibility="Collapsed" BorderBrush="AliceBlue" DisplayMember="NAME" ValueMember="CODE" SeparatorString="," PopupClosed="MultiComboBox_PopupClosed">
|
|
|
|
|
<dxe:ComboBoxEdit.StyleSettings>
|
|
|
|
|
<dxe:CheckedComboBoxStyleSettings />
|
|
|
|
|
</dxe:ComboBoxEdit.StyleSettings>
|
|
|
|
|
</dxe:ComboBoxEdit>-->
|
|
|
|
|
|
|
|
|
|
<dxe:CheckEdit x:Name="CheckBox" Visibility="Collapsed" Background="White" BorderThickness="0" ShowBorder="False" />
|
|
|
|
|
<dxe:TextEdit x:Name="TextBox" Background="White" Visibility="Collapsed" ShowBorder="False"/>
|
|
|
|
|
<dxe:SpinEdit x:Name="SpinEdit" Background="White" HorizontalContentAlignment="Left" Visibility="Collapsed" ShowBorder="False" />
|
|
|
|
|
<dxe:ButtonEdit x:Name="ButtonEdit" AllowDefaultButton="False" Visibility="Collapsed">
|
|
|
|
|
<dxe:ButtonInfo x:Name="SelectPZWJ" Content="选择" Click="SelectPZWJ_Click"/>
|
|
|
|
|
<dxe:ButtonInfo x:Name="Browse" Content="浏览" Click="BtnBrowse_Click"/>
|
|
|
|
|
</dxe:ButtonEdit>
|
|
|
|
|
<dxe:ButtonEdit x:Name="ButtonEditFJ" AllowDefaultButton="False" Visibility="Collapsed" >
|
|
|
|
|
<dxe:ButtonInfo x:Name="SelectFJ" Content="选择" Click="SelectPZWJ_Click"/>
|
|
|
|
|
</dxe:ButtonEdit>
|
|
|
|
|
</Grid>
|
|
|
|
|
<DataTemplate.Triggers>
|
|
|
|
|
<!--<MultiDataTrigger>
|
|
|
|
|
<MultiDataTrigger.Conditions>
|
|
|
|
|
<Condition Binding="{Binding PropertyType}" Value="MultiComboBox" />
|
|
|
|
|
</MultiDataTrigger.Conditions>
|
|
|
|
|
<Setter TargetName="MultiComboBox" Property="Visibility" Value="Visible" />
|
|
|
|
|
<Setter TargetName="MultiComboBox" Property="ItemsSource" Value="{Binding DicData, Mode=TwoWay}" />
|
|
|
|
|
<Setter TargetName="MultiComboBox" Property="IsReadOnly" Value="{Binding IsReadOnly, Mode=TwoWay}" />
|
|
|
|
|
<Setter TargetName="MultiComboBox" Property="EditValue" Value="{Binding MultiSelectDicData}" />
|
|
|
|
|
--><!--<Setter TargetName="MultiComboBox" Property="Selector.ItemTemplateSelector" Value="{Binding MultiSelectDicData, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />--><!--
|
|
|
|
|
</MultiDataTrigger>-->
|
|
|
|
|
<MultiDataTrigger>
|
|
|
|
|
<MultiDataTrigger.Conditions>
|
|
|
|
|
<Condition Binding="{Binding PropertyType}" Value="ComboBox" />
|
|
|
|
|
</MultiDataTrigger.Conditions>
|
|
|
|
|
<Setter TargetName="ComboBox" Property="Visibility" Value="Visible" />
|
|
|
|
|
<Setter TargetName="ComboBox" Property="ValueMemberPath" Value="{Binding ValuePath,Mode=TwoWay}" />
|
|
|
|
|
<Setter TargetName="ComboBox" Property="DisplayMemberPath" Value="{Binding DisplayMemberPath,Mode=TwoWay}" />
|
|
|
|
|
<Setter TargetName="ComboBox" Property="ItemsSource" Value="{Binding DicData, Mode=TwoWay}" />
|
|
|
|
|
<Setter TargetName="ComboBox" Property="IsReadOnly" Value="{Binding IsReadOnly, Mode=TwoWay}" />
|
|
|
|
|
<Setter TargetName="ComboBox" Property="SelectedValue" Value="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
</MultiDataTrigger>
|
|
|
|
|
<DataTrigger Binding="{Binding PropertyType}" Value="CheckBox">
|
|
|
|
|
<Setter TargetName="CheckBox" Property="Visibility" Value="Visible" />
|
|
|
|
|
<Setter TargetName="CheckBox" Property="IsReadOnly" Value="{Binding IsReadOnly}" />
|
|
|
|
|
<Setter TargetName="CheckBox" Property="AllowNullInput" Value="{Binding AllowNull}" />
|
|
|
|
|
<Setter TargetName="CheckBox" Property="IsChecked" Value="{Binding CheckBoxValue, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
<DataTrigger Binding="{Binding PropertyType}" Value="TextBox">
|
|
|
|
|
<Setter TargetName="TextBox" Property="Visibility" Value="Visible" />
|
|
|
|
|
<Setter TargetName="TextBox" Property="IsReadOnly" Value="{Binding IsReadOnly}" />
|
|
|
|
|
<Setter TargetName="TextBox" Property="AllowNullInput" Value="{Binding AllowNull}" />
|
|
|
|
|
<Setter TargetName="TextBox" Property="EditValue" Value="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
<DataTrigger Binding="{Binding PropertyType}" Value="SpinEdit">
|
|
|
|
|
<Setter TargetName="SpinEdit" Property="Visibility" Value="Visible" />
|
|
|
|
|
<Setter TargetName="SpinEdit" Property="IsReadOnly" Value="{Binding IsReadOnly}" />
|
|
|
|
|
<Setter TargetName="SpinEdit" Property="AllowNullInput" Value="{Binding AllowNull}" />
|
|
|
|
|
<Setter TargetName="SpinEdit" Property="EditValue" Value="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
<DataTrigger Binding="{Binding PropertyType}" Value="ButtonEdit">
|
|
|
|
|
<Setter TargetName="ButtonEdit" Property="Visibility" Value="Visible" />
|
|
|
|
|
<Setter TargetName="ButtonEdit" Property="IsReadOnly" Value="{Binding IsReadOnly}" />
|
|
|
|
|
<Setter TargetName="ButtonEdit" Property="AllowNullInput" Value="{Binding AllowNull}" />
|
|
|
|
|
<Setter TargetName="ButtonEdit" Property="EditValue" Value="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />
|
|
|
|
|
<Setter TargetName="ButtonEdit" Property="Tag" Value="{Binding Key}" />
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
<DataTrigger Binding="{Binding PropertyType}" Value="ButtonEditFJ">
|
|
|
|
|
<Setter TargetName="ButtonEditFJ" Property="Visibility" Value="Visible" />
|
|
|
|
|
<Setter TargetName="ButtonEditFJ" Property="IsReadOnly" Value="{Binding IsReadOnly}" />
|
|
|
|
|
<Setter TargetName="ButtonEditFJ" Property="AllowNullInput" Value="{Binding AllowNull}" />
|
|
|
|
|
<Setter TargetName="ButtonEditFJ" Property="EditValue" Value="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />
|
|
|
|
|
<Setter TargetName="ButtonEditFJ" Property="Tag" Value="{Binding Key}" />
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
</DataTemplate.Triggers>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
</DataGrid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</UserControl>
|