MainWindow.xaml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <Window x:Class="UpgradePackageUploadTool.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:upgradepackageuploadtool="clr-namespace:UpgradePackageUploadTool"
  7. xmlns:extensions="clr-namespace:UpgradePackageUploadTool.Extensions"
  8. mc:Ignorable="d"
  9. Title="Upgrade Package Upload Tool" Height="430" Width="820" WindowStartupLocation="CenterScreen" MinHeight="320">
  10. <Grid>
  11. <Grid.ColumnDefinitions>
  12. <ColumnDefinition Width="*" />
  13. </Grid.ColumnDefinitions>
  14. <Grid.RowDefinitions>
  15. <RowDefinition Height="*" />
  16. </Grid.RowDefinitions>
  17. <Grid Grid.Row="0">
  18. <StackPanel Orientation="Vertical">
  19. <GroupBox Header="登录信息设置" Margin="5">
  20. <StackPanel>
  21. <StackPanel Orientation="Horizontal" Visibility="Collapsed">
  22. <TextBlock Text="服务器:" Margin="5" VerticalAlignment="Center"></TextBlock>
  23. <TextBox x:Name="ServerIP_Text" Width="180" VerticalAlignment="Center" TextChanged="ServerIPText_TextChanged" Height="22"></TextBox>
  24. <TextBlock Text="服务器端口:" Margin="5" VerticalAlignment="Center"></TextBlock>
  25. <TextBox x:Name="ServerPort_Text" Width="118" VerticalAlignment="Center" TextChanged="ServerPortText_TextChanged" Height="22"></TextBox>
  26. </StackPanel>
  27. <StackPanel Orientation="Horizontal">
  28. <TextBlock Text="服务地址:" Margin="5" VerticalAlignment="Center"></TextBlock>
  29. <TextBox x:Name="WingServer_Text" Width="180" VerticalAlignment="Center" TextChanged="WingServer_Text_TextChanged" Height="22"></TextBox>
  30. </StackPanel>
  31. <StackPanel Orientation="Horizontal">
  32. <TextBlock Text="用户账号:" Margin="5" VerticalAlignment="Center"></TextBlock>
  33. <TextBox x:Name="Account_Text" Width="180" VerticalAlignment="Center" TextChanged="Account_Text_TextChanged" Height="22"></TextBox>
  34. <TextBlock Text="密码:" Margin="5" VerticalAlignment="Center"></TextBlock>
  35. <PasswordBox x:Name="Password_PasswordBox" Width="160" VerticalAlignment="Center" PasswordChanged="Password_PasswordBox_PasswordChanged" Height="22"></PasswordBox>
  36. <Button x:Name="ConnectOrDisconnectServer_Button" Margin="15,0,0,0" Content="连接" VerticalAlignment="Center" Click="OnConnectOrDisconnectServer" />
  37. </StackPanel>
  38. </StackPanel>
  39. </GroupBox>
  40. <GroupBox Header="上传功能设置" Margin="5">
  41. <StackPanel>
  42. <StackPanel Orientation="Horizontal">
  43. <TextBlock Text="更新包名称:" Margin="5" VerticalAlignment="Center" />
  44. <TextBox x:Name="FileName_Text" Margin="5" Width="159" VerticalAlignment="Center" Height="22" />
  45. <TextBlock Text="更新包版本:" Margin="5" VerticalAlignment="Center" />
  46. <TextBox x:Name="Version_Text" Margin="5" Width="100" VerticalAlignment="Center" Height="22" />
  47. <Button x:Name="GetLatestPackageInfo_Button" Margin="10,0,0,0" Content="查看最新版" VerticalAlignment="Center" Click="OnGetLatestPackage" />
  48. <Button x:Name="Download_Button" Content="下载" Margin="10,0,0,0" VerticalAlignment="Center" Click="OnDownloadPackage" />
  49. </StackPanel>
  50. <StackPanel Orientation="Horizontal">
  51. <TextBlock Text="更新包路径:" Margin="5" VerticalAlignment="Center" />
  52. <TextBox x:Name="FilePath_Text" Margin="5" Width="350" VerticalAlignment="Center" IsReadOnly="True" Height="22" />
  53. <Button x:Name="OpenFile_Button" Margin="10,0,0,0" Content="选择" VerticalAlignment="Center" Click="OnOpenFile" />
  54. </StackPanel>
  55. <StackPanel Orientation="Horizontal">
  56. <TextBlock Text="更新包描述:" Margin="5" VerticalAlignment="Center" />
  57. <TextBox x:Name="Description_Text" Margin="5" Width="350" VerticalAlignment="Center" Height="22" />
  58. <Button x:Name="UploadPackage_Button" Content="上传" Margin="10,0,0,0" VerticalAlignment="Center" Click="OnUploadPackage" />
  59. </StackPanel>
  60. </StackPanel>
  61. </GroupBox>
  62. <DataGrid x:Name="ShowInfo_DataGrid" GridLinesVisibility="Vertical" AutoGenerateColumns="False" IsReadOnly="True" Visibility="Collapsed" SelectionUnit="Cell" Margin="5,20">
  63. <DataGrid.Columns>
  64. <DataGridTemplateColumn Header="更新者" Width="0.7*">
  65. <DataGridTemplateColumn.CellTemplate>
  66. <DataTemplate>
  67. <TextBlock TextWrapping="Wrap" Text="{Binding CreateUserName}" VerticalAlignment="Center" />
  68. </DataTemplate>
  69. </DataGridTemplateColumn.CellTemplate>
  70. </DataGridTemplateColumn>
  71. <DataGridTemplateColumn Header="更新包版本" Width="*">
  72. <DataGridTemplateColumn.CellTemplate>
  73. <DataTemplate>
  74. <TextBlock TextWrapping="Wrap" Text="{Binding Version}" VerticalAlignment="Center" />
  75. </DataTemplate>
  76. </DataGridTemplateColumn.CellTemplate>
  77. </DataGridTemplateColumn>
  78. <DataGridTemplateColumn Header="更新包名称" Width="*">
  79. <DataGridTemplateColumn.CellTemplate>
  80. <DataTemplate>
  81. <TextBlock TextWrapping="Wrap" Text="{Binding FileName}" VerticalAlignment="Center" />
  82. </DataTemplate>
  83. </DataGridTemplateColumn.CellTemplate>
  84. </DataGridTemplateColumn>
  85. <DataGridTemplateColumn Header="下载地址" Width="3*">
  86. <DataGridTemplateColumn.CellTemplate>
  87. <DataTemplate>
  88. <TextBlock TextWrapping="Wrap" Text="{Binding FileToken}" VerticalAlignment="Center" />
  89. </DataTemplate>
  90. </DataGridTemplateColumn.CellTemplate>
  91. </DataGridTemplateColumn>
  92. <DataGridTemplateColumn Header="更新包大小" Width="*">
  93. <DataGridTemplateColumn.CellTemplate>
  94. <DataTemplate>
  95. <TextBlock TextWrapping="Wrap" Text="{Binding FileSize, Converter={extensions:FileSizeConverter}}" VerticalAlignment="Center" />
  96. </DataTemplate>
  97. </DataGridTemplateColumn.CellTemplate>
  98. </DataGridTemplateColumn>
  99. <DataGridTemplateColumn Header="更新时间" Width="0.9*">
  100. <DataGridTemplateColumn.CellTemplate>
  101. <DataTemplate>
  102. <TextBlock TextWrapping="Wrap" Text="{Binding UpdateTime, Converter={extensions:UpdateTimeConverter}}" VerticalAlignment="Center" />
  103. </DataTemplate>
  104. </DataGridTemplateColumn.CellTemplate>
  105. </DataGridTemplateColumn>
  106. <DataGridTemplateColumn Header="更新包描述" Width="*">
  107. <DataGridTemplateColumn.CellTemplate>
  108. <DataTemplate>
  109. <TextBlock TextWrapping="Wrap" Text="{Binding Description}" VerticalAlignment="Center" />
  110. </DataTemplate>
  111. </DataGridTemplateColumn.CellTemplate>
  112. </DataGridTemplateColumn>
  113. </DataGrid.Columns>
  114. </DataGrid>
  115. </StackPanel>
  116. </Grid>
  117. <upgradepackageuploadtool:WaitingSpinner x:Name="Waiting" />
  118. </Grid>
  119. </Window>