CommunicationSetView.xaml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <windows:WindowBase x:Class="Muchinfo.MTPClient.UI.Views.CommunicationSetView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:dataGrid="clr-namespace:Muchinfo.WPF.Controls.DataGrid;assembly=Muchinfo.WPF.Controls"
  5. xmlns:resource="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Muchinfo.MTPClient.Resources"
  6. xmlns:windows="clr-namespace:Muchinfo.WPF.Controls.Windows;assembly=Muchinfo.WPF.Controls"
  7. x:Name="view"
  8. Title="{x:Static resource:Muchinfo_Resource.CommunicationSet_Title}"
  9. Width="434"
  10. Height="358"
  11. BorderThickness="6,0,6,6"
  12. ClosedCommand="{Binding ClosedCommand}"
  13. CornerRadius="0"
  14. Style="{DynamicResource WindowBaseStyle}">
  15. <Grid>
  16. <Grid.RowDefinitions>
  17. <RowDefinition Height="*" />
  18. <RowDefinition Height="Auto" />
  19. <RowDefinition Height="Auto" />
  20. </Grid.RowDefinitions>
  21. <TabControl Grid.Row="0"
  22. Margin="20,10"
  23. Style="{DynamicResource TabControlStyle1}">
  24. <TabItem Header="{x:Static resource:Muchinfo_Resource.Content_LoginSet}" Style="{DynamicResource TabItemStyle1}">
  25. <Grid>
  26. <dataGrid:MuchinfoDataGrid x:Name="grid"
  27. EnableRowVirtualization="False"
  28. ItemsSource="{Binding ServerCollection}"
  29. MouseDoubleClick="grid_MouseDoubleClick"
  30. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  31. SelectionUnit="FullRow"
  32. Style="{DynamicResource LinkDataGridStyle}">
  33. <DataGrid.ColumnHeaderStyle>
  34. <Style TargetType="DataGridColumnHeader">
  35. <Setter Property="HorizontalContentAlignment" Value="Center" />
  36. <Setter Property="VerticalContentAlignment" Value="Center" />
  37. <Setter Property="Height" Value="22" />
  38. <Setter Property="Background" Value="{DynamicResource MuchinfoBrush63}" />
  39. </Style>
  40. </DataGrid.ColumnHeaderStyle>
  41. <DataGrid.CellStyle>
  42. <Style TargetType="DataGridCell">
  43. <Setter Property="VerticalAlignment" Value="Center" />
  44. <Setter Property="HorizontalAlignment" Value="Center" />
  45. <Style.Triggers>
  46. <Trigger Property="IsSelected" Value="True">
  47. <Setter Property="Background" Value="Transparent" />
  48. <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush3}" />
  49. <Setter Property="BorderThickness" Value="0" />
  50. </Trigger>
  51. </Style.Triggers>
  52. </Style>
  53. </DataGrid.CellStyle>
  54. <DataGrid.RowStyle>
  55. <Style TargetType="DataGridRow">
  56. <Setter Property="Height" Value="22" />
  57. <Style.Triggers>
  58. <Trigger Property="IsSelected" Value="True">
  59. <Setter Property="Background" Value="Transparent" />
  60. <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush3}" />
  61. <Setter Property="BorderThickness" Value="0" />
  62. </Trigger>
  63. </Style.Triggers>
  64. </Style>
  65. </DataGrid.RowStyle>
  66. <DataGrid.Columns>
  67. <DataGridTemplateColumn Width="8"
  68. Header=""
  69. IsReadOnly="False">
  70. <DataGridTemplateColumn.CellTemplate>
  71. <DataTemplate>
  72. <Grid>
  73. <RadioButton VerticalContentAlignment="Center"
  74. GroupName="temp"
  75. IsChecked="{Binding IsChecked,
  76. UpdateSourceTrigger=PropertyChanged}">
  77. <RadioButton.Style>
  78. <Style TargetType="RadioButton">
  79. <Setter Property="Background" Value="{DynamicResource MuchinfoBrush66}" />
  80. <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush22}" />
  81. <Setter Property="Template">
  82. <Setter.Value>
  83. <ControlTemplate>
  84. <Grid Width="8" Height="8">
  85. <Border x:Name="Border"
  86. Background="{TemplateBinding Background}"
  87. BorderBrush="{TemplateBinding BorderBrush}"
  88. BorderThickness="{TemplateBinding BorderThickness}" />
  89. </Grid>
  90. </ControlTemplate>
  91. </Setter.Value>
  92. </Setter>
  93. <Style.Triggers>
  94. <Trigger Property="IsChecked" Value="True">
  95. <Setter Property="Template">
  96. <Setter.Value>
  97. <ControlTemplate>
  98. <Path Data="M1.5,5.7816667 C2.125,6.1566667 5.75,10.906333 5.75,10.906333 L12.5,0.78165909"
  99. SnapsToDevicePixels="False"
  100. Stroke="{DynamicResource MuchinfoBrush1}"
  101. StrokeThickness="2"
  102. Visibility="Visible" />
  103. </ControlTemplate>
  104. </Setter.Value>
  105. </Setter>
  106. </Trigger>
  107. </Style.Triggers>
  108. </Style>
  109. </RadioButton.Style>
  110. </RadioButton>
  111. </Grid>
  112. </DataTemplate>
  113. </DataGridTemplateColumn.CellTemplate>
  114. </DataGridTemplateColumn>
  115. <DataGridTextColumn Width="*"
  116. Binding="{Binding Path=ServerName}"
  117. Header="{x:Static resource:Muchinfo_Resource.Content_ServerName}" />
  118. <DataGridTextColumn Width="108"
  119. Binding="{Binding Path=ServerIP}"
  120. Header="{x:Static resource:Muchinfo_Resource.Content_Ip}"
  121. Visibility="Collapsed" />
  122. <DataGridTextColumn Width="68"
  123. Binding="{Binding Path=ServerPort}"
  124. Header="{x:Static resource:Muchinfo_Resource.Content_Port}"
  125. Visibility="Collapsed" />
  126. <DataGridTextColumn Width="68"
  127. Binding="{Binding Path=Rate}"
  128. Header="{x:Static resource:Muchinfo_Resource.Content_Rate}"
  129. Visibility="Collapsed" />
  130. <DataGridTemplateColumn Width="*"
  131. Header="{x:Static resource:Muchinfo_Resource.Content_TimeDelay}"
  132. IsReadOnly="False">
  133. <DataGridTemplateColumn.CellTemplate>
  134. <DataTemplate>
  135. <Button Background="Blue"
  136. Command="{Binding Path=DataContext.TestSpeedCommand,
  137. RelativeSource={RelativeSource Mode=FindAncestor,
  138. AncestorType={x:Type Window}}}"
  139. CommandParameter="{Binding }"
  140. Cursor="Hand"
  141. ToolTip="{x:Static resource:Muchinfo_Resource.Button_Speed}">
  142. <Button.Template>
  143. <ControlTemplate>
  144. <TextBlock Text="{Binding Path=RequestTimeText}" TextDecorations="Underline" />
  145. </ControlTemplate>
  146. </Button.Template>
  147. </Button>
  148. </DataTemplate>
  149. </DataGridTemplateColumn.CellTemplate>
  150. </DataGridTemplateColumn>
  151. </DataGrid.Columns>
  152. </dataGrid:MuchinfoDataGrid>
  153. </Grid>
  154. </TabItem>
  155. <TabItem Header="{x:Static resource:Muchinfo_Resource.Content_ServerSet}" Style="{DynamicResource TabItemStyle1}">
  156. <Grid>
  157. <dataGrid:MuchinfoDataGrid x:Name="gridRealTime"
  158. EnableRowVirtualization="False"
  159. ItemsSource="{Binding RealQuoteServers}"
  160. MouseDoubleClick="grid_MouseDoubleClick"
  161. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  162. SelectionUnit="FullRow"
  163. Style="{DynamicResource LinkDataGridStyle}">
  164. <DataGrid.ColumnHeaderStyle>
  165. <Style TargetType="DataGridColumnHeader">
  166. <Setter Property="HorizontalContentAlignment" Value="Center" />
  167. <Setter Property="VerticalContentAlignment" Value="Center" />
  168. <Setter Property="Height" Value="22" />
  169. <Setter Property="Background" Value="{DynamicResource MuchinfoBrush63}" />
  170. </Style>
  171. </DataGrid.ColumnHeaderStyle>
  172. <DataGrid.CellStyle>
  173. <Style TargetType="DataGridCell">
  174. <Setter Property="VerticalAlignment" Value="Center" />
  175. <Setter Property="HorizontalAlignment" Value="Center" />
  176. <Style.Triggers>
  177. <Trigger Property="IsSelected" Value="True">
  178. <Setter Property="Background" Value="Transparent" />
  179. <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush3}" />
  180. <Setter Property="BorderThickness" Value="0" />
  181. </Trigger>
  182. </Style.Triggers>
  183. </Style>
  184. </DataGrid.CellStyle>
  185. <DataGrid.RowStyle>
  186. <Style TargetType="DataGridRow">
  187. <Setter Property="Height" Value="22" />
  188. <Style.Triggers>
  189. <Trigger Property="IsSelected" Value="True">
  190. <Setter Property="Background" Value="Transparent" />
  191. <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush3}" />
  192. <Setter Property="BorderThickness" Value="0" />
  193. </Trigger>
  194. </Style.Triggers>
  195. </Style>
  196. </DataGrid.RowStyle>
  197. <DataGrid.Columns>
  198. <DataGridTemplateColumn Width="8"
  199. Header=""
  200. IsReadOnly="False">
  201. <DataGridTemplateColumn.CellTemplate>
  202. <DataTemplate>
  203. <Grid>
  204. <RadioButton VerticalContentAlignment="Center"
  205. GroupName="temp1"
  206. IsChecked="{Binding IsChecked,
  207. UpdateSourceTrigger=PropertyChanged}">
  208. <RadioButton.Style>
  209. <Style TargetType="RadioButton">
  210. <Setter Property="Background" Value="{DynamicResource MuchinfoBrush66}" />
  211. <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush22}" />
  212. <Setter Property="Template">
  213. <Setter.Value>
  214. <ControlTemplate>
  215. <Grid Width="8" Height="8">
  216. <Border x:Name="Border"
  217. Background="{TemplateBinding Background}"
  218. BorderBrush="{TemplateBinding BorderBrush}"
  219. BorderThickness="{TemplateBinding BorderThickness}" />
  220. </Grid>
  221. </ControlTemplate>
  222. </Setter.Value>
  223. </Setter>
  224. <Style.Triggers>
  225. <Trigger Property="IsChecked" Value="True">
  226. <Setter Property="Template">
  227. <Setter.Value>
  228. <ControlTemplate>
  229. <Path Data="M1.5,5.7816667 C2.125,6.1566667 5.75,10.906333 5.75,10.906333 L12.5,0.78165909"
  230. SnapsToDevicePixels="False"
  231. Stroke="{DynamicResource MuchinfoBrush1}"
  232. StrokeThickness="2"
  233. Visibility="Visible" />
  234. </ControlTemplate>
  235. </Setter.Value>
  236. </Setter>
  237. </Trigger>
  238. </Style.Triggers>
  239. </Style>
  240. </RadioButton.Style>
  241. </RadioButton>
  242. </Grid>
  243. </DataTemplate>
  244. </DataGridTemplateColumn.CellTemplate>
  245. </DataGridTemplateColumn>
  246. <DataGridTextColumn Width="*"
  247. Binding="{Binding Path=ServerName}"
  248. Header="{x:Static resource:Muchinfo_Resource.Content_ServerName}" />
  249. <DataGridTextColumn Width="108"
  250. Binding="{Binding Path=ServerIP}"
  251. Header="{x:Static resource:Muchinfo_Resource.Content_Ip}"
  252. Visibility="Collapsed" />
  253. <DataGridTextColumn Width="68"
  254. Binding="{Binding Path=ServerPort}"
  255. Header="{x:Static resource:Muchinfo_Resource.Content_Ports}"
  256. Visibility="Collapsed" />
  257. <DataGridTextColumn Width="68"
  258. Binding="{Binding Path=Rate}"
  259. Header="{x:Static resource:Muchinfo_Resource.Content_Rate}"
  260. Visibility="Collapsed" />
  261. <DataGridTemplateColumn Width="*"
  262. Header="{x:Static resource:Muchinfo_Resource.Content_TimeDelay}"
  263. IsReadOnly="False">
  264. <DataGridTemplateColumn.CellTemplate>
  265. <DataTemplate>
  266. <Button Background="Blue"
  267. Command="{Binding Path=DataContext.TestSpeedCommand,
  268. RelativeSource={RelativeSource Mode=FindAncestor,
  269. AncestorType={x:Type Window}}}"
  270. CommandParameter="{Binding }"
  271. Cursor="Hand"
  272. ToolTip="{x:Static resource:Muchinfo_Resource.Button_Speed}">
  273. <Button.Template>
  274. <ControlTemplate>
  275. <TextBlock Text="{Binding Path=RequestTimeText}" TextDecorations="Underline" />
  276. </ControlTemplate>
  277. </Button.Template>
  278. </Button>
  279. </DataTemplate>
  280. </DataGridTemplateColumn.CellTemplate>
  281. </DataGridTemplateColumn>
  282. </DataGrid.Columns>
  283. </dataGrid:MuchinfoDataGrid>
  284. </Grid>
  285. </TabItem>
  286. </TabControl>
  287. <!--
  288. <StackPanel Grid.Row="1">
  289. <GroupBox Margin="0,18,0,0"
  290. IsEnabled="False"
  291. Padding="10">
  292. <GroupBox.Header>
  293. <CheckBox Content="使用代理" />
  294. </GroupBox.Header>
  295. <StackPanel>
  296. <WrapPanel Margin="10,0,5,0">
  297. <RadioButton Margin="0,0,5,0"
  298. VerticalAlignment="Center"
  299. Content="socket5" />
  300. <RadioButton VerticalAlignment="Center" Content="http" />
  301. </WrapPanel>
  302. <WrapPanel Margin="10,8,0,0">
  303. <WrapPanel>
  304. <TextBlock Margin="0,0,6,0"
  305. VerticalAlignment="Center"
  306. Text="代理地址" />
  307. <TextBox Width="100" Height="22" />
  308. <TextBlock Margin="12,0,6,0"
  309. VerticalAlignment="Center"
  310. Text="端 口" />
  311. <TextBox Width="100" Height="22" />
  312. </WrapPanel>
  313. <WrapPanel Margin="0,8,0,0">
  314. <TextBlock Margin="0,0,6,0"
  315. VerticalAlignment="Center"
  316. Text="验证用户" />
  317. <TextBox Width="100" Height="22" />
  318. <TextBlock Margin="12,0,6,0"
  319. VerticalAlignment="Center"
  320. Text="密 码" />
  321. <TextBox Width="100" Height="22" />
  322. </WrapPanel>
  323. <Button Width="57"
  324. Height="22"
  325. Margin="10,-20,0,0"
  326. Content="测试代理"
  327. Padding="0"
  328. Style="{StaticResource CommonButtonStyle}" />
  329. </WrapPanel>
  330. </StackPanel>
  331. </GroupBox>
  332. </StackPanel>
  333. -->
  334. <WrapPanel Grid.Row="2" Margin="99,8,0,5">
  335. <Button Width="82"
  336. Height="28"
  337. Margin="0,0,60,0"
  338. Command="{Binding OKCommand}"
  339. CommandParameter="{Binding ElementName=view}"
  340. Content="{x:Static resource:Muchinfo_Resource.Button_Ok}"
  341. IsDefault="True"
  342. Style="{StaticResource CommonButtonStyle}" />
  343. <Button Width="82"
  344. Height="28"
  345. Command="{Binding CancelCommand}"
  346. CommandParameter="{Binding ElementName=view}"
  347. Content="{x:Static resource:Muchinfo_Resource.Button_Cancel}"
  348. IsCancel="True"
  349. Style="{StaticResource CommonButtonStyle}" />
  350. </WrapPanel>
  351. </Grid>
  352. </windows:WindowBase>