CloudFilesContent.xaml 8.2 KB

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