CloudFilesContent.xaml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <UserControl
  2. x:Class="PDF_Master.Views.HomePanel.CloudDrive.CloudFilesContent"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:DataConvert="clr-namespace:PDF_Master.DataConvert"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  8. xmlns:local="clr-namespace:PDF_Master.Views.HomePanel.CloudDrive"
  9. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  10. xmlns:prism="http://prismlibrary.com/"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. prism:ViewModelLocator.AutoWireViewModel="True"
  14. mc:Ignorable="d">
  15. <UserControl.Resources>
  16. <DataConvert:BoolToVisible x:Key="BoolToVisible" />
  17. <DataConvert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
  18. <ContextMenu x:Key="FlyoutMenu" FontSize="14">
  19. <ContextMenu.ItemContainerStyle>
  20. <Style TargetType="MenuItem">
  21. <Setter Property="Padding" Value="0,7,0,7" />
  22. <Setter Property="VerticalContentAlignment" Value="Center" />
  23. </Style>
  24. </ContextMenu.ItemContainerStyle>
  25. <MenuItem
  26. Name="OpenDocMenuItem"
  27. Click="OpenDocMenuItem_Click"
  28. Header="打开文件"
  29. IsEnabled="True">
  30. <MenuItem.Icon>
  31. <Path Data="M9 0H3V2H0V3H1V14H11V3H12V2H9V0ZM2 13V3H3H4H8H9H10V13H2ZM8 2V1H4V2H8ZM4 12V4H3V12H4ZM6.5 4V12H5.5V4H6.5ZM9 12V4H8V12H9Z" Fill="Black">
  32. <Path.RenderTransform>
  33. <TranslateTransform X="5.0000" Y="0" />
  34. </Path.RenderTransform>
  35. </Path>
  36. </MenuItem.Icon>
  37. </MenuItem>
  38. </ContextMenu>
  39. <ContextMenu x:Key="UserFlyoutMenu" FontSize="14">
  40. <ContextMenu.ItemContainerStyle>
  41. <Style TargetType="MenuItem">
  42. <Setter Property="Padding" Value="0,7,0,7" />
  43. <Setter Property="VerticalContentAlignment" Value="Center" />
  44. </Style>
  45. </ContextMenu.ItemContainerStyle>
  46. <MenuItem
  47. Name="RemoveUserMenuItem"
  48. Click="RemoveUserMenuItem_Click"
  49. Header="移除帐户"
  50. IsEnabled="True">
  51. <MenuItem.Icon>
  52. <Path Data="M9 0H3V2H0V3H1V14H11V3H12V2H9V0ZM2 13V3H3H4H8H9H10V13H2ZM8 2V1H4V2H8ZM4 12V4H3V12H4ZM6.5 4V12H5.5V4H6.5ZM9 12V4H8V12H9Z" Fill="Black">
  53. <Path.RenderTransform>
  54. <TranslateTransform X="5.0000" Y="0" />
  55. </Path.RenderTransform>
  56. </Path>
  57. </MenuItem.Icon>
  58. </MenuItem>
  59. </ContextMenu>
  60. <Style x:Key="itemstyle" TargetType="{x:Type ListViewItem}">
  61. <EventSetter Event="PreviewMouseRightButtonDown" Handler="ListViewItem_PreviewMouseRightButtonDown" />
  62. <EventSetter Event="PreviewMouseDoubleClick" Handler="ListViewItem_PreviewMouseDoubleClick" />
  63. </Style>
  64. <Style x:Key="useritemstyle" TargetType="{x:Type ListViewItem}">
  65. <EventSetter Event="PreviewMouseRightButtonDown" Handler="userItem_PreviewMouseRightButtonDown" />
  66. </Style>
  67. </UserControl.Resources>
  68. <Grid>
  69. <Grid.RowDefinitions>
  70. <RowDefinition Height="auto" />
  71. <RowDefinition />
  72. </Grid.RowDefinitions>
  73. <Grid HorizontalAlignment="Stretch">
  74. <Grid.ColumnDefinitions>
  75. <ColumnDefinition />
  76. <ColumnDefinition Width="auto" />
  77. </Grid.ColumnDefinitions>
  78. <ListBox x:Name="ListFolder" ItemsSource="{Binding FolderItems}">
  79. <ListBox.ItemTemplate>
  80. <DataTemplate>
  81. <StackPanel Orientation="Horizontal">
  82. <TextBlock HorizontalAlignment="Left" Text="{Binding FolderName}" />
  83. <TextBlock HorizontalAlignment="Left" Text=" &gt;" />
  84. </StackPanel>
  85. </DataTemplate>
  86. </ListBox.ItemTemplate>
  87. <ListBox.ItemsPanel>
  88. <ItemsPanelTemplate>
  89. <WrapPanel Orientation="Horizontal" />
  90. </ItemsPanelTemplate>
  91. </ListBox.ItemsPanel>
  92. <ListBox.ItemContainerStyle>
  93. <Style TargetType="{x:Type ListBoxItem}">
  94. <EventSetter Event="PreviewMouseLeftButtonUp" Handler="SelectListFolder_Click" />
  95. </Style>
  96. </ListBox.ItemContainerStyle>
  97. </ListBox>
  98. <StackPanel Grid.Column="1" Orientation="Horizontal">
  99. <ComboBox
  100. x:Name="combCloudDrive"
  101. Grid.Column="1"
  102. Width="115"
  103. Height="32"
  104. HorizontalAlignment="Right"
  105. Background="Wheat">
  106. <ComboBox.ItemTemplate>
  107. <DataTemplate>
  108. <Border Background="#DBDBDB">
  109. <TextBlock Text="{Binding DriveName}" />
  110. </Border>
  111. </DataTemplate>
  112. </ComboBox.ItemTemplate>
  113. <i:Interaction.Triggers>
  114. <i:EventTrigger EventName="SelectionChanged">
  115. <i:InvokeCommandAction Command="{Binding LoginCommand}" CommandParameter="{Binding ElementName=combCloudDrive, Path=SelectedItem}" />
  116. </i:EventTrigger>
  117. </i:Interaction.Triggers>
  118. </ComboBox>
  119. <Button
  120. x:Name="UpLoadFileBtn"
  121. Click="UpLoadFileBtn_Click"
  122. Content="上传文件" />
  123. </StackPanel>
  124. </Grid>
  125. <Grid Grid.Row="1">
  126. <Grid.ColumnDefinitions>
  127. <ColumnDefinition Width="Auto" />
  128. <ColumnDefinition />
  129. </Grid.ColumnDefinitions>
  130. <ListView
  131. x:Name="Listusers"
  132. Width="220"
  133. VerticalAlignment="Top"
  134. ItemContainerStyle="{StaticResource useritemstyle}"
  135. SelectionChanged="Listusers_SelectionChanged">
  136. <ListView.ItemTemplate>
  137. <DataTemplate>
  138. <Grid Height="50">
  139. <TextBlock VerticalAlignment="Center" Text="{Binding userInfo.UserAccount}" />
  140. </Grid>
  141. </DataTemplate>
  142. </ListView.ItemTemplate>
  143. </ListView>
  144. <ListView
  145. x:Name="ListvmFiles"
  146. Grid.Column="1"
  147. ItemContainerStyle="{StaticResource itemstyle}"
  148. ItemsSource="{Binding FilesList}"
  149. ScrollViewer.VerticalScrollBarVisibility="Auto">
  150. <ListView.ItemTemplate>
  151. <DataTemplate>
  152. <Grid>
  153. <StackPanel Margin="0,5,0,5" Visibility="{Binding IsFolder, Converter={StaticResource InvertBoolToVisibleConvert}}">
  154. <StackPanel Orientation="Horizontal">
  155. <TextBlock Text="Id:" />
  156. <TextBlock Text="{Binding Id}" />
  157. </StackPanel>
  158. <StackPanel Orientation="Horizontal">
  159. <TextBlock Text="文件名:" />
  160. <TextBlock Text="{Binding Name}" />
  161. </StackPanel>
  162. </StackPanel>
  163. <StackPanel Background="YellowGreen" Visibility="{Binding IsFolder, Converter={StaticResource BoolToVisible}}">
  164. <TextBlock Text="文件夹:" />
  165. <TextBlock Text="{Binding Name}" />
  166. </StackPanel>
  167. </Grid>
  168. </DataTemplate>
  169. </ListView.ItemTemplate>
  170. </ListView>
  171. </Grid>
  172. </Grid>
  173. </UserControl>