123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- <UserControl
- x:Class="PDF_Master.Views.HomePanel.CloudDrive.CloudFilesContent"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:DataConvert="clr-namespace:PDF_Master.DataConvert"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:local="clr-namespace:PDF_Master.Views.HomePanel.CloudDrive"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:prism="http://prismlibrary.com/"
- d:DesignHeight="450"
- d:DesignWidth="800"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d">
- <UserControl.Resources>
- <DataConvert:BoolToVisible x:Key="BoolToVisible" />
- <DataConvert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
- <ContextMenu x:Key="FlyoutMenu" FontSize="14">
- <ContextMenu.ItemContainerStyle>
- <Style TargetType="MenuItem">
- <Setter Property="Padding" Value="0,7,0,7" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- </Style>
- </ContextMenu.ItemContainerStyle>
- <MenuItem
- Name="OpenDocMenuItem"
- Click="OpenDocMenuItem_Click"
- Header="打开文件"
- IsEnabled="True">
- <MenuItem.Icon>
- <Path Data="M9 0H3V2H0V3H1V14H11V3H12V2H9V0ZM2 13V3H3H4H8H9H10V13H2ZM8 2V1H4V2H8ZM4 12V4H3V12H4ZM6.5 4V12H5.5V4H6.5ZM9 12V4H8V12H9Z" Fill="Black">
- <Path.RenderTransform>
- <TranslateTransform X="5.0000" Y="0" />
- </Path.RenderTransform>
- </Path>
- </MenuItem.Icon>
- </MenuItem>
- </ContextMenu>
- <ContextMenu x:Key="UserFlyoutMenu" FontSize="14">
- <ContextMenu.ItemContainerStyle>
- <Style TargetType="MenuItem">
- <Setter Property="Padding" Value="0,7,0,7" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- </Style>
- </ContextMenu.ItemContainerStyle>
- <MenuItem
- Name="RemoveUserMenuItem"
- Click="RemoveUserMenuItem_Click"
- Header="移除帐户"
- IsEnabled="True">
- <MenuItem.Icon>
- <Path Data="M9 0H3V2H0V3H1V14H11V3H12V2H9V0ZM2 13V3H3H4H8H9H10V13H2ZM8 2V1H4V2H8ZM4 12V4H3V12H4ZM6.5 4V12H5.5V4H6.5ZM9 12V4H8V12H9Z" Fill="Black">
- <Path.RenderTransform>
- <TranslateTransform X="5.0000" Y="0" />
- </Path.RenderTransform>
- </Path>
- </MenuItem.Icon>
- </MenuItem>
- </ContextMenu>
- <Style x:Key="itemstyle" TargetType="{x:Type ListViewItem}">
- <EventSetter Event="PreviewMouseRightButtonDown" Handler="ListViewItem_PreviewMouseRightButtonDown" />
- <EventSetter Event="PreviewMouseDoubleClick" Handler="ListViewItem_PreviewMouseDoubleClick" />
- </Style>
- <Style x:Key="useritemstyle" TargetType="{x:Type ListViewItem}">
- <EventSetter Event="PreviewMouseRightButtonDown" Handler="userItem_PreviewMouseRightButtonDown" />
- </Style>
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Grid HorizontalAlignment="Stretch">
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <ListBox x:Name="ListFolder" ItemsSource="{Binding FolderItems}">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <TextBlock HorizontalAlignment="Left" Text="{Binding FolderName}" />
- <TextBlock HorizontalAlignment="Left" Text=" >" />
- </StackPanel>
- </DataTemplate>
- </ListBox.ItemTemplate>
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel Orientation="Horizontal" />
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemContainerStyle>
- <Style TargetType="{x:Type ListBoxItem}">
- <EventSetter Event="PreviewMouseLeftButtonUp" Handler="SelectListFolder_Click" />
- </Style>
- </ListBox.ItemContainerStyle>
- </ListBox>
- <StackPanel Grid.Column="1" Orientation="Horizontal">
- <ComboBox
- x:Name="combCloudDrive"
- Grid.Column="1"
- Width="115"
- Height="32"
- HorizontalAlignment="Right"
- Background="Wheat">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <Border Background="#DBDBDB">
- <TextBlock Text="{Binding DriveName}" />
- </Border>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectionChanged">
- <i:InvokeCommandAction Command="{Binding LoginCommand}" CommandParameter="{Binding ElementName=combCloudDrive, Path=SelectedItem}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </ComboBox>
- <Button
- x:Name="UpLoadFileBtn"
- Click="UpLoadFileBtn_Click"
- Content="上传文件" />
- </StackPanel>
- </Grid>
- <Grid Grid.Row="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <ListView
- x:Name="Listusers"
- Width="220"
- VerticalAlignment="Top"
- ItemContainerStyle="{StaticResource useritemstyle}"
- SelectionChanged="Listusers_SelectionChanged">
- <ListView.ItemTemplate>
- <DataTemplate>
- <Grid Height="50">
- <TextBlock VerticalAlignment="Center" Text="{Binding userInfo.UserAccount}" />
- </Grid>
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
- <ListView
- x:Name="ListvmFiles"
- Grid.Column="1"
- ItemContainerStyle="{StaticResource itemstyle}"
- ItemsSource="{Binding FilesList}"
- ScrollViewer.VerticalScrollBarVisibility="Auto">
- <ListView.ItemTemplate>
- <DataTemplate>
- <Grid>
- <StackPanel Margin="0,5,0,5" Visibility="{Binding IsFolder, Converter={StaticResource InvertBoolToVisibleConvert}}">
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="Id:" />
- <TextBlock Text="{Binding Id}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="文件名:" />
- <TextBlock Text="{Binding Name}" />
- </StackPanel>
- </StackPanel>
- <StackPanel Background="YellowGreen" Visibility="{Binding IsFolder, Converter={StaticResource BoolToVisible}}">
- <TextBlock Text="文件夹:" />
- <TextBlock Text="{Binding Name}" />
- </StackPanel>
- </Grid>
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
- </Grid>
- </Grid>
- </UserControl>
|