123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:DataConvert ="clr-namespace:PDF_Master.DataConvert"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:prism ="http://prismlibrary.com/"
- prism:ViewModelLocator.AutoWireViewModel="True"
- xmlns:local="clr-namespace:PDF_Master.Views.HomePanel.CloudDrive"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <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" Header="打开文件" IsEnabled="True" Click="OpenDocMenuItem_Click">
- <MenuItem.Icon>
- <Path Fill="Black" Data="M9 0H3V2H0V3H1V14H11V3H12V2H9V0ZM2 13V3H3H4H8H9H10V13H2ZM8 2V1H4V2H8ZM4 12V4H3V12H4ZM6.5 4V12H5.5V4H6.5ZM9 12V4H8V12H9Z">
- <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" Header="移除帐户" IsEnabled="True" Click="RemoveUserMenuItem_Click">
- <MenuItem.Icon>
- <Path Fill="Black" Data="M9 0H3V2H0V3H1V14H11V3H12V2H9V0ZM2 13V3H3H4H8H9H10V13H2ZM8 2V1H4V2H8ZM4 12V4H3V12H4ZM6.5 4V12H5.5V4H6.5ZM9 12V4H8V12H9Z">
- <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 Text="{Binding FolderName}" HorizontalAlignment="Left"/>
- <TextBlock Text=" >" HorizontalAlignment="Left"/>
- </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" Background="Wheat" HorizontalAlignment="Right">
- <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" Content="上传文件" Click="UpLoadFileBtn_Click"/>
- </StackPanel>
-
- </Grid>
- <Grid Grid.Row="1" >
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <ListView x:Name="Listusers" Width="220" SelectionChanged="Listusers_SelectionChanged" VerticalAlignment="Top"
- ItemContainerStyle="{StaticResource useritemstyle}"
- >
- <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" ScrollViewer.VerticalScrollBarVisibility="Auto"
- ItemsSource="{Binding FilesList}"
- ItemContainerStyle="{StaticResource itemstyle}">
- <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 Visibility="{Binding IsFolder,Converter={StaticResource BoolToVisible}}" Background="YellowGreen">
- <TextBlock Text="文件夹:"/>
- <TextBlock Text="{Binding Name}"/>
- </StackPanel>
-
- </Grid>
-
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
- </Grid>
-
- </Grid>
- </UserControl>
|