EmbeddedDynamicEditorForm.xaml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <UserControl x:Class="InABox.DynamicGrid.EmbeddedDynamicEditorForm"
  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:local="clr-namespace:InABox.DynamicGrid"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800" >
  9. <UserControl.Resources>
  10. <Style TargetType="{x:Type Button}" x:Key="ButtonStyle">
  11. <Style.Triggers>
  12. <DataTrigger Binding="{Binding IsEnabled}" Value="True">
  13. <Setter Property="Foreground" Value="Yellow" />
  14. </DataTrigger>
  15. <DataTrigger Binding="{Binding IsEnabled}" Value="False">
  16. <Setter Property="Foreground" Value="Blue" />
  17. </DataTrigger>
  18. </Style.Triggers>
  19. </Style>
  20. </UserControl.Resources>
  21. <Grid x:Name="LayoutGrid">
  22. <Grid.ColumnDefinitions>
  23. <ColumnDefinition Width="*" />
  24. <ColumnDefinition Width="80" />
  25. <ColumnDefinition Width="80" />
  26. </Grid.ColumnDefinitions>
  27. <Grid.RowDefinitions>
  28. <RowDefinition Height="*" />
  29. <RowDefinition Height="40" x:Name="ButtonRow"/>
  30. </Grid.RowDefinitions>
  31. <local:DynamicEditorGrid
  32. x:Name="Editor"
  33. Grid.Row="0"
  34. Grid.Column="0"
  35. Grid.ColumnSpan="3"
  36. Margin="5,5,5,0"
  37. HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
  38. OnCustomiseColumns="Editor_OnCustomiseColumns"
  39. OnDefineFilter="Editor_OnDefineFilter"
  40. OnEditorCreated="Editor_OnEditorCreated"
  41. OnSelectPage="Editor_OnSelectPage"
  42. OnUnloadPage="Editor_OnUnloadPage"
  43. OnAfterEditorValueChanged="Editor_OnAfterEditorValueChanged"
  44. OnReconfigureEditors="Editor_OnReconfigureEditors"
  45. OnGridCustomiseEditor="Editor_OnGridCustomiseEditor"
  46. OnGetSequence="Editor_OnGetSequence"
  47. OnEditorValueChanged="Editor_OnEditorValueChanged"
  48. OnDefineLookups="Editor_OnDefineLookups"
  49. GetItems="Editor_GetItems"
  50. OnGetEditor="Editor_OnGetEditor"
  51. OnGetPropertyValue="Editor_OnGetPropertyValue"
  52. OnSetPropertyValue="Editor_OnSetPropertyValue"/>
  53. <StackPanel
  54. Grid.Row="1"
  55. Grid.Column="0"
  56. HorizontalAlignment="Stretch"
  57. Orientation="Horizontal"
  58. x:Name="Buttons"/>
  59. <Button
  60. x:Name="OKButton"
  61. Content="OK"
  62. Grid.Row="1"
  63. Grid.Column="1"
  64. Margin="0,5,5,5"
  65. Click="OKButton_Click"
  66. IsEnabled="False"
  67. BorderBrush="DarkGreen"
  68. Background="LimeGreen"
  69. Foreground="White"
  70. FontWeight="Bold"
  71. Style="{StaticResource ButtonStyle}"/>
  72. <Button
  73. x:Name="CancelButton"
  74. Content="Cancel"
  75. Grid.Row="1"
  76. Grid.Column="2"
  77. Margin="0,5,5,5"
  78. IsEnabled="False"
  79. Click="CancelButton_Click"
  80. BorderBrush="Firebrick"
  81. Background="Red"
  82. Foreground="White"
  83. FontWeight="Bold"
  84. Style="{StaticResource ButtonStyle}"/>
  85. </Grid>
  86. </UserControl>