TodoControl.xaml 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <UserControl x:Class="GeekDesk.Control.UserControls.Backlog.TodoControl"
  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:GeekDesk.Control.UserControls.PannelCard"
  7. xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ToDoInfo}"
  8. mc:Ignorable="d"
  9. Background="Transparent"
  10. >
  11. <hc:SimplePanel Margin="20" Background="Transparent">
  12. <Grid Background="Transparent">
  13. <DataGrid x:Name="BacklogList"
  14. HeadersVisibility="All"
  15. AutoGenerateColumns="False"
  16. ItemsSource="{Binding}"
  17. IsReadOnly="True"
  18. Initialized="DataGridMenu_Initialized"
  19. >
  20. <DataGrid.ContextMenu>
  21. <ContextMenu x:Name="Menu" Width="120">
  22. <MenuItem Header="详情" Click="DetailMenu_Click"/>
  23. <MenuItem Header="删除" Click="DeleteMenu_Click"/>
  24. </ContextMenu>
  25. </DataGrid.ContextMenu>
  26. <DataGrid.RowStyle>
  27. <Style TargetType="DataGridRow" BasedOn="{StaticResource DataGridRowStyle}">
  28. <EventSetter Event="MouseRightButtonDown" Handler="DataGridRow_MouseRightButtonDown" />
  29. <EventSetter Event="Selected" Handler="DataGridRow_Selected"/>
  30. <Setter Property="Background" Value="White"/>
  31. <Style.Triggers>
  32. <Trigger Property="IsSelected" Value="True">
  33. <Setter Property="Background" Value="#5BC0DE"/>
  34. </Trigger>
  35. <Trigger Property="IsSelected" Value="False">
  36. <Setter Property="Background" Value="White"/>
  37. </Trigger>
  38. </Style.Triggers>
  39. </Style>
  40. </DataGrid.RowStyle>
  41. <DataGrid.CellStyle>
  42. <Style TargetType="DataGridCell" BasedOn="{StaticResource DataGridCellStyle}">
  43. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  44. <Setter Property="Background" Value="Transparent"/>
  45. <Style.Triggers>
  46. <Trigger Property="IsSelected" Value="True">
  47. <Setter Property="Background" Value="Transparent"/>
  48. <Setter Property="Foreground" Value="Black"/>
  49. </Trigger>
  50. </Style.Triggers>
  51. </Style>
  52. </DataGrid.CellStyle>
  53. <DataGrid.ColumnHeaderStyle>
  54. <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource DataGridColumnHeaderStyle}">
  55. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  56. </Style>
  57. </DataGrid.ColumnHeaderStyle>
  58. <DataGrid.Background>
  59. <SolidColorBrush Color="Transparent"/>
  60. </DataGrid.Background>
  61. <DataGrid.Columns>
  62. <DataGridTextColumn Width="120" Binding="{Binding Title}" Header="待办任务"/>
  63. <DataGridTextColumn Width="210" Binding="{Binding Msg}" Header="待办详情"/>
  64. <DataGridTextColumn Width="147" Binding="{Binding ExeTime}" Header="待办时间"/>
  65. <DataGridTextColumn Width="147" Binding="{Binding DoneTime}" Header="完成时间"/>
  66. </DataGrid.Columns>
  67. </DataGrid>
  68. <StackPanel hc:Growl.GrowlParent="True" hc:Growl.Token="DeleteConfirm" VerticalAlignment="Center" Margin="0,10,10,50"/>
  69. </Grid>
  70. </hc:SimplePanel>
  71. </UserControl>