WinSellerBaseInfo.xaml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <fw:NChildWindow x:Class="Com.FirmLib.UI.Seller.WinSellerBaseInfo"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:fw="http://schemas.FWind/xaml"
  7. xmlns:wpf="clr-namespace:FWindSoft.Wpf;assembly=FWindSoft.Wpf"
  8. xmlns:uc="clr-namespace:Com.FirmLib.UI.Common"
  9. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  10. xmlns:behaviors="clr-namespace:FWindSoft.Wpf.Behaviors;assembly=FWindSoft.Wpf"
  11. mc:Ignorable="d" Title="供应商名称"
  12. d:DesignHeight="300" d:DesignWidth="500" Name="this" Height="{Binding Height,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}"
  13. Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ScrollContentPresenter}}" >
  14. <fw:NChildWindow.Resources>
  15. <wpf:BindingProxy x:Key="DATA" Data="{Binding}"></wpf:BindingProxy>
  16. </fw:NChildWindow.Resources>
  17. <Grid Margin="5">
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="Auto"></RowDefinition>
  20. <RowDefinition></RowDefinition>
  21. </Grid.RowDefinitions>
  22. <StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right">
  23. <Button Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}" Command="{Binding Commands.AddCommand}" Height="23" Margin="10" Content="添加供应商"/>
  24. <Button Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}" Height="23" Margin="10" Content="查看备选名片" />
  25. </StackPanel>
  26. <DataGrid Grid.Row="1" Grid.Column="0" AutoGenerateColumns="False" SelectionMode="Single" FrozenColumnCount="1" ItemsSource="{Binding Sellers}"
  27. CanUserAddRows="False"
  28. CanUserDeleteRows="False"
  29. VerticalScrollBarVisibility="Auto"
  30. HorizontalScrollBarVisibility="Auto"
  31. SelectionUnit="FullRow"
  32. HeadersVisibility="Column"
  33. CanUserSortColumns="True"
  34. CellStyle="{StaticResource ResourceKey={x:Static uc:CommonStyles.DataGridCellKey}}"
  35. AlternationCount="2"
  36. >
  37. <DataGrid.RowStyle>
  38. <Style TargetType="DataGridRow">
  39. <Setter Property="ContextMenu">
  40. <Setter.Value>
  41. <ContextMenu>
  42. <MenuItem Header="删除" Command="{Binding Data.Commands.DeleteCommand,Source={StaticResource ResourceKey=DATA}}" CommandParameter="{Binding }"></MenuItem>
  43. </ContextMenu>
  44. </Setter.Value>
  45. </Setter>
  46. <Setter Property="Height" Value="30"></Setter>
  47. <Style.Triggers>
  48. <Trigger Property="ItemsControl.AlternationIndex"
  49. Value="0">
  50. <Setter Property="Background" Value="White" />
  51. </Trigger>
  52. <Trigger Property="ItemsControl.AlternationIndex"
  53. Value="1">
  54. <Setter Property="Background" Value="#FFE6E3DD" />
  55. </Trigger>
  56. </Style.Triggers>
  57. </Style>
  58. </DataGrid.RowStyle>
  59. <DataGrid.Columns>
  60. <DataGridTemplateColumn Header="操作" Width="60" IsReadOnly="True" >
  61. <DataGridTemplateColumn.CellTemplate>
  62. <DataTemplate>
  63. <Button Command="{Binding DataContext.Commands.ManageCommand,ElementName=this}" CommandParameter="{Binding }" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.LinkButtonKey}}" VerticalAlignment="Center" Content="管理" HorizontalAlignment="Left" Padding="5,0,5,0"/>
  64. </DataTemplate>
  65. </DataGridTemplateColumn.CellTemplate>
  66. </DataGridTemplateColumn>
  67. <fw:TDataGridTextColumn Header="供应商名称" Width="100" IsReadOnly="True" Binding="{Binding Path=Name}"></fw:TDataGridTextColumn>
  68. <fw:TDataGridTextColumn Header="供应商网址" Width="*" IsReadOnly="True" Binding="{Binding Path=Url}"></fw:TDataGridTextColumn>
  69. <fw:TDataGridTextColumn Header="供应品牌" Width="*" IsReadOnly="True" Binding="{Binding Path=BrandNames,Converter={x:Static wpf:ConverterFactory.ItemsToString}}"></fw:TDataGridTextColumn>
  70. <fw:TDataGridTextColumn Header="设备族" Width="*" IsReadOnly="True" Binding="{Binding Path=FamilyNames,Converter={x:Static wpf:ConverterFactory.ItemsToString}}"></fw:TDataGridTextColumn>
  71. <fw:TDataGridTextColumn Header="供应的项目" Width="*" IsReadOnly="True" Binding="{Binding Path=RefProjectCount}"></fw:TDataGridTextColumn>
  72. </DataGrid.Columns>
  73. <i:Interaction.Behaviors>
  74. <behaviors:GridCellSingleClickEditBehavior></behaviors:GridCellSingleClickEditBehavior>
  75. </i:Interaction.Behaviors>
  76. </DataGrid>
  77. </Grid>
  78. </fw:NChildWindow>