Restore.xaml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <UserControl x:Class="DBBackupTool.Views.Restore"
  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:DBBackupTool.Views"
  7. xmlns:prism="http://prismlibrary.com/"
  8. prism:ViewModelLocator.AutoWireViewModel="True"
  9. xmlns:UICommon="clr-namespace:UICommon;assembly=UICommon"
  10. mc:Ignorable="d"
  11. d:DesignHeight="450" d:DesignWidth="800">
  12. <UserControl.Resources>
  13. <ResourceDictionary Source="/UICommon;component/Resources.xaml"/>
  14. </UserControl.Resources>
  15. <Grid Margin="8">
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="240"/>
  18. <ColumnDefinition Width="16"/>
  19. <ColumnDefinition Width="*"/>
  20. </Grid.ColumnDefinitions>
  21. <Grid.RowDefinitions>
  22. <RowDefinition/>
  23. <RowDefinition Height="16"/>
  24. <RowDefinition Height="auto"/>
  25. </Grid.RowDefinitions>
  26. <Grid Grid.ColumnSpan="3" Grid.RowSpan="3" Background="#80ffffff" Panel.ZIndex="2" Visibility="{Binding LoadingVis}">
  27. <UICommon:CycleRingLoading Width="100" Foreground="{StaticResource ThemeColor}"/>
  28. </Grid>
  29. <Grid>
  30. <Grid.RowDefinitions>
  31. <RowDefinition Height="auto"/>
  32. <RowDefinition Height="16"/>
  33. <RowDefinition Height="auto"/>
  34. <RowDefinition Height="16"/>
  35. <RowDefinition Height="auto"/>
  36. <RowDefinition Height="16"/>
  37. <RowDefinition Height="auto"/>
  38. <RowDefinition Height="16"/>
  39. <RowDefinition Height="auto"/>
  40. <RowDefinition Height="24"/>
  41. <RowDefinition Height="auto"/>
  42. <RowDefinition Height="24"/>
  43. <RowDefinition Height="*"/>
  44. </Grid.RowDefinitions>
  45. <Grid.ColumnDefinitions>
  46. <ColumnDefinition Width="100"/>
  47. <ColumnDefinition Width="8"/>
  48. <ColumnDefinition/>
  49. </Grid.ColumnDefinitions>
  50. <TextBlock Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">Server Address:</TextBlock>
  51. <TextBox Grid.Column="2" Grid.Row="0" VerticalAlignment="Center" VerticalContentAlignment="Center" Height="24" Text="{Binding DbInfo.ServerAddress}"/>
  52. <TextBlock Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" >Port:</TextBlock>
  53. <TextBox Grid.Column="2" Grid.Row="2" VerticalAlignment="Center" VerticalContentAlignment="Center" Height="24" Text="{Binding DbInfo.Port}"/>
  54. <TextBlock Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" >Database:</TextBlock>
  55. <TextBox Grid.Column="2" Grid.Row="4" VerticalAlignment="Center" VerticalContentAlignment="Center" Height="24" Text="{Binding DbInfo.DataBase}"/>
  56. <TextBlock Grid.Column="0" Grid.Row="6" VerticalAlignment="Center" >User:</TextBlock>
  57. <TextBox Grid.Column="2" Grid.Row="6" VerticalAlignment="Center" VerticalContentAlignment="Center" Height="24" Text="{Binding DbInfo.User}"/>
  58. <TextBlock Grid.Column="0" Grid.Row="8" VerticalAlignment="Center" >Password:</TextBlock>
  59. <TextBox Grid.Column="2 " Grid.Row="8" VerticalAlignment="Center" VerticalContentAlignment="Center" Height="24" Text="{Binding DbInfo.PassWord}"/>
  60. <Button Grid.Row="10" Grid.ColumnSpan="3" Height="24" VerticalAlignment="Center" Command="{Binding CheckDBCommand}">连接/建库</Button>
  61. <Grid Grid.Row="12" Grid.ColumnSpan="3">
  62. <Grid.ColumnDefinitions>
  63. <ColumnDefinition Width="auto"/>
  64. <ColumnDefinition Width="*"/>
  65. <ColumnDefinition Width="auto"/>
  66. </Grid.ColumnDefinitions>
  67. <Grid.RowDefinitions>
  68. <RowDefinition Height="auto"/>
  69. <RowDefinition Height="8"/>
  70. <RowDefinition/>
  71. </Grid.RowDefinitions>
  72. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left">备份文件:</TextBlock>
  73. <Button Grid.Column="2" Width="80" Command="{Binding SelectPathCommand}">选择文件</Button>
  74. <Border Grid.Row="2" Grid.ColumnSpan="3" BorderBrush="Black" BorderThickness="1">
  75. <TextBlock TextWrapping="Wrap" Margin="4" Text="{Binding SavePath}"/>
  76. </Border>
  77. </Grid>
  78. </Grid>
  79. <Grid Grid.Column="2">
  80. <Grid.RowDefinitions>
  81. <RowDefinition Height="24"/>
  82. <RowDefinition Height="8"/>
  83. <RowDefinition/>
  84. </Grid.RowDefinitions>
  85. <TextBlock VerticalAlignment="Center">
  86. <Run>恢复列表</Run>
  87. <Run> </Run>
  88. <Run>(</Run>
  89. <Run Text="{Binding TableCount}"/>
  90. <Run>)</Run>
  91. </TextBlock>
  92. <Border Grid.Row="2" Grid.ColumnSpan="3" BorderBrush="Black" BorderThickness="1">
  93. <ScrollViewer>
  94. <ItemsControl Margin="4" ItemsSource="{Binding Tables}">
  95. <ItemsControl.ItemTemplate>
  96. <DataTemplate>
  97. <TextBlock Text="{Binding Name}"/>
  98. </DataTemplate>
  99. </ItemsControl.ItemTemplate>
  100. </ItemsControl>
  101. </ScrollViewer>
  102. </Border>
  103. </Grid>
  104. <Button Grid.Row="2" Grid.ColumnSpan="3" Height="24" Command="{Binding RestoreCommand}">开始还原</Button>
  105. </Grid>
  106. </UserControl>