MessageView.xaml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <UserControl x:Class="Muchinfo.MTPClient.Account.Views.MessageView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:converters="clr-namespace:Muchinfo.MTPClient.Infrastructure.Converters;assembly=Muchinfo.MTPClient.Infrastructure"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:dataGrid="clr-namespace:Muchinfo.WPF.Controls.DataGrid;assembly=Muchinfo.WPF.Controls"
  7. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:resource="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Muchinfo.MTPClient.Resources"
  10. xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
  11. Background="{DynamicResource MuchinfoBrush5}"
  12. DataContext="{Binding Message,
  13. Source={StaticResource Locator}}"
  14. mc:Ignorable="d">
  15. <UserControl.Resources>
  16. <converters:MessageReadStatusConverter x:Key="messageReadStatusConverter" />
  17. <!-- <converters:StringSubstringConverter x:Key="stringSubstringConverter" /> -->
  18. </UserControl.Resources>
  19. <xctk:BusyIndicator BusyContent="{x:Static resource:Muchinfo_Resource.Content_SearchBusy}" IsBusy="{Binding IsBusy, Mode=TwoWay}">
  20. <Grid>
  21. <Grid.RowDefinitions>
  22. <RowDefinition Height="auto" />
  23. <RowDefinition Height="*" />
  24. </Grid.RowDefinitions>
  25. <StackPanel Grid.Row="0"
  26. Margin="0,4"
  27. Background="{DynamicResource MuchinfoBrush2}"
  28. Orientation="Horizontal">
  29. <TextBlock Margin="10,0"
  30. VerticalAlignment="Center"
  31. Foreground="{DynamicResource MuchinfoBrush13}"
  32. Text="{x:Static resource:Muchinfo_Resource.Content_ReleascDate}" />
  33. <DatePicker Width="120"
  34. Height="23"
  35. CalendarStyle="{DynamicResource CalendarStyle}"
  36. KeyUp="Title_OnKeyUp"
  37. SelectedDate="{Binding StartDateTime,
  38. Mode=TwoWay}" />
  39. <TextBlock Margin="10,0"
  40. VerticalAlignment="Center"
  41. Foreground="{DynamicResource MuchinfoBrush13}"
  42. Text="{x:Static resource:Muchinfo_Resource.Content_To}" />
  43. <DatePicker Width="120"
  44. Height="23"
  45. CalendarStyle="{DynamicResource CalendarStyle}"
  46. KeyUp="Title_OnKeyUp"
  47. SelectedDate="{Binding EndDateTime,
  48. Mode=TwoWay}" />
  49. <TextBlock Margin="10,0"
  50. VerticalAlignment="Center"
  51. Foreground="{DynamicResource MuchinfoBrush13}"
  52. Text="{x:Static resource:Muchinfo_Resource.Content_Theme}" />
  53. <TextBox Width="120"
  54. Height="23"
  55. KeyUp="Title_OnKeyUp"
  56. Text="{Binding SelectWhere}" />
  57. <Button Height="26"
  58. Margin="10,0"
  59. Command="{Binding QuetyCommand}"
  60. Content="{x:Static resource:Muchinfo_Resource.Button_Search}"
  61. Style="{DynamicResource CommonButtonStyle}" />
  62. </StackPanel>
  63. <dataGrid:MuchinfoDataGrid x:Name="dg_Message"
  64. Grid.Row="1"
  65. ItemsSource="{Binding MessageSource}"
  66. SelectedItem="{Binding SelectedItemMessage}"
  67. SelectionMode="Extended"
  68. Style="{DynamicResource AccountMuchinfoDataGridStyle}">
  69. <i:Interaction.Triggers>
  70. <i:EventTrigger EventName="MouseDoubleClick">
  71. <i:InvokeCommandAction Command="{Binding ShowCommand}" />
  72. <!-- CommandParameter="{Binding SelectedItems, ElementName=dg_Message}" -->
  73. </i:EventTrigger>
  74. </i:Interaction.Triggers>
  75. <DataGrid.Columns>
  76. <DataGridTemplateColumn Width="150"
  77. MinWidth="150"
  78. Header="{x:Static resource:Muchinfo_Resource.Content_State}"
  79. SortMemberPath="ReadStatus">
  80. <DataGridTemplateColumn.CellTemplate>
  81. <DataTemplate>
  82. <Image Width="16"
  83. Height="16"
  84. HorizontalAlignment="Center"
  85. VerticalAlignment="Center"
  86. Source="{Binding ReadStatus,
  87. Converter={StaticResource messageReadStatusConverter},
  88. Mode=TwoWay}" />
  89. </DataTemplate>
  90. </DataGridTemplateColumn.CellTemplate>
  91. </DataGridTemplateColumn>
  92. <!-- ,Converter={StaticResource stringSubstringConverter} -->
  93. <DataGridTextColumn Width="*"
  94. Binding="{Binding Title}"
  95. ElementStyle="{StaticResource DataGridTextColumnStyle}"
  96. Header="{x:Static resource:Muchinfo_Resource.Content_Theme}" />
  97. <!--
  98. <DataGridTextColumn Width="*"
  99. Binding="{Binding Content,Converter={StaticResource stringSubstringConverter}}"
  100. ElementStyle="{StaticResource DataGridTextColumnStyle}"
  101. Header="内容" />
  102. -->
  103. <DataGridTextColumn Width="200"
  104. MinWidth="200"
  105. Binding="{Binding PublishDate,
  106. StringFormat=\{0:yyyy-MM-dd\}}"
  107. ElementStyle="{StaticResource DataGridTextColumnStyle}"
  108. Header="{x:Static resource:Muchinfo_Resource.Content_ReleascDates}" />
  109. <!--
  110. <DataGridTextColumn Width="150"
  111. Binding="{Binding ValidDate,
  112. StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}"
  113. ElementStyle="{StaticResource DataGridTextColumnStyle}"
  114. Header="失效时间" />
  115. -->
  116. </DataGrid.Columns>
  117. </dataGrid:MuchinfoDataGrid>
  118. </Grid>
  119. </xctk:BusyIndicator>
  120. </UserControl>