RecipeStepSelectDialogView.xaml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <UserControl x:Class="FurnaceUI.Views.Recipes.RecipeStepSelectDialogView"
  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:FurnaceUI.Views.Recipes" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:cal="http://www.caliburn.org"
  7. mc:Ignorable="d"
  8. Height="470" Width="350">
  9. <UserControl.Resources>
  10. <Style BasedOn="{StaticResource ExScrollViewer}" TargetType="ScrollViewer" />
  11. <Style BasedOn="{StaticResource ExScrollBar}" TargetType="ScrollBar" />
  12. </UserControl.Resources>
  13. <Grid>
  14. <Grid.RowDefinitions>
  15. <RowDefinition Height="420"/>
  16. <RowDefinition Height="60"/>
  17. </Grid.RowDefinitions>
  18. <DataGrid Grid.ColumnSpan="2" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserSortColumns="False" ItemsSource="{Binding NewSteps,Mode=OneTime}">
  19. <DataGrid.Columns>
  20. <DataGridTemplateColumn Header="StepNo" IsReadOnly="True" Width="80" >
  21. <DataGridTemplateColumn.CellTemplate>
  22. <DataTemplate>
  23. <StackPanel Orientation="Horizontal">
  24. <Label FontSize="17" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{Binding StepNo, UpdateSourceTrigger=PropertyChanged}"/>
  25. </StackPanel>
  26. </DataTemplate>
  27. </DataGridTemplateColumn.CellTemplate>
  28. </DataGridTemplateColumn>
  29. <DataGridTemplateColumn Header="StepName" Width="210" IsReadOnly="True" >
  30. <DataGridTemplateColumn.CellTemplate>
  31. <DataTemplate>
  32. <TextBlock Text="{Binding Name}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" TextWrapping="Wrap" Width="150">
  33. <i:Interaction.Triggers>
  34. <i:EventTrigger EventName="MouseDown">
  35. <cal:ActionMessage MethodName="SelectStepCmd">
  36. <cal:Parameter Value="{Binding}"></cal:Parameter>
  37. </cal:ActionMessage>
  38. </i:EventTrigger>
  39. </i:Interaction.Triggers>
  40. </TextBlock>
  41. </DataTemplate>
  42. </DataGridTemplateColumn.CellTemplate>
  43. </DataGridTemplateColumn>
  44. </DataGrid.Columns>
  45. <DataGrid.RowStyle>
  46. <Style TargetType="DataGridRow">
  47. <Setter Property="Visibility" Value="{Binding IsVisibility}"/>
  48. </Style>
  49. </DataGrid.RowStyle>
  50. </DataGrid>
  51. <Border Margin="4" Grid.Row="1" Grid.Column="0">
  52. <Canvas>
  53. <Button Content="Save" Style="{StaticResource CommandButton}" Width="90" Height="35" Canvas.Left="80" Canvas.Top="10" IsEnabled="{Binding IsSaveEnabled}">
  54. <i:Interaction.Triggers>
  55. <i:EventTrigger EventName="Click">
  56. <cal:ActionMessage MethodName="SaveCmd">
  57. </cal:ActionMessage>
  58. </i:EventTrigger>
  59. </i:Interaction.Triggers>
  60. </Button>
  61. <Button Content="Cancel" Style="{StaticResource CommandButton}" Width="90" Height="35" Canvas.Left="190" Canvas.Top="10">
  62. <i:Interaction.Triggers>
  63. <i:EventTrigger EventName="Click">
  64. <cal:ActionMessage MethodName="CancelCmd"/>
  65. </i:EventTrigger>
  66. </i:Interaction.Triggers>
  67. </Button>
  68. </Canvas>
  69. </Border>
  70. </Grid>
  71. </UserControl>