PhotosPage.xaml 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <Window x:Class="NBAManagment.PhotosPage"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:NBAManagment"
  7. mc:Ignorable="d"
  8. Title="PhotosPage" Height="450" Width="800">
  9. <Grid>
  10. <TextBlock Text="When you like a photo, you can right-click a photo and choose the download menu item in the context menu to download."
  11. HorizontalAlignment="Center" Margin="10"
  12. FontSize="14px"/>
  13. <Border BorderThickness="1" Margin="10, 35, 10, 45">
  14. <ListView Name="imagesListView" ItemsSource="{Binding PagedPictures.Filtered}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="-1,0,1,0">
  15. <ListView.ItemsPanel>
  16. <ItemsPanelTemplate>
  17. <WrapPanel ItemHeight="180" ItemWidth="250"
  18. Width="{Binding Path=ActualWidth, ElementName=imagesListView}"
  19. Orientation="Horizontal"/>
  20. </ItemsPanelTemplate>
  21. </ListView.ItemsPanel>
  22. <ListView.ItemTemplate>
  23. <DataTemplate>
  24. <Grid>
  25. <Button Margin="5" PreviewMouseRightButtonDown="ShowDownloadPoput">
  26. <Image Source="{Binding Img}" Stretch="Fill"/>
  27. </Button>
  28. </Grid>
  29. </DataTemplate>
  30. </ListView.ItemTemplate>
  31. </ListView>
  32. </Border>
  33. <Popup x:Name="downloadPoput" Width="125" Height="30" IsOpen="False" Placement="Mouse" PopupAnimation="None" StaysOpen="False">
  34. <Grid>
  35. <Button Click="DownloadImage" Margin="0">
  36. <Button.Content>
  37. <StackPanel Orientation="Horizontal">
  38. <Image Source="/NBAManagement;component/Resources/download.png" Height="25" Width="25"/>
  39. <TextBlock Text="Download" FontSize="16px"/>
  40. </StackPanel>
  41. </Button.Content>
  42. </Button>
  43. </Grid>
  44. </Popup>
  45. <StackPanel VerticalAlignment="Bottom" Margin="10" Orientation="Horizontal">
  46. <TextBlock Text="Total " Foreground="Black" FontSize="18px" FontWeight="Bold" FontStyle="Italic" />
  47. <TextBlock Text="{Binding PagedPictures.CurrentPageItemCount}" Foreground="Black" FontSize="18px" FontWeight="Bold" FontStyle="Italic" />
  48. <TextBlock Text=" Photos, " Foreground="Black" FontSize="18px" FontWeight="Bold" FontStyle="Italic" />
  49. <TextBlock Text="{Binding PagedPictures.ItemCount}" Foreground="Black" FontSize="18px" FontWeight="Bold" FontStyle="Italic" />
  50. <TextBlock Text=" Photos in one page, Total " Foreground="Black" FontSize="18px" FontWeight="Bold" FontStyle="Italic" />
  51. <TextBlock Text="{Binding PagedPictures.PageCount}" Foreground="Black" FontSize="18px" FontWeight="Bold" FontStyle="Italic" />
  52. <TextBlock Text=" Pages" Foreground="Black" FontSize="18px" FontWeight="Bold" FontStyle="Italic" />
  53. </StackPanel>
  54. <StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="10" Orientation="Horizontal">
  55. <Button Content="|&lt;" Padding="10, 2" BorderBrush="Black" Margin="3, 0" Click="FirstPage"/>
  56. <Button Content="&lt;" Padding="10, 2" BorderBrush="Black" Margin="3, 0" Click="PriveusPage"/>
  57. <TextBox Name="pageNumTaxtBlock" Text="{Binding PageNum}" Width="30" Padding="4" TextAlignment="Center" Margin="3, 0"/>
  58. <Button Content="&gt;" Padding="10, 2" BorderBrush="Black" Margin="3, 0" Click="NextPage"/>
  59. <Button Content="&gt;|" Padding="10, 2" BorderBrush="Black" Margin="3, 0" Click="LastPage"/>
  60. <Button Margin="50, 0, 10, 0" Content="Download photos in current page" Padding="10, 2" BorderBrush="Black"
  61. Click="DownloadPageImages"/>
  62. </StackPanel>
  63. </Grid>
  64. </Window>