Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.23 KB | None | 0 0
  1. <Window x:Class="_WPF__CREATE_TREE_OF_FOLDER.MainWindow"
  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:_WPF__CREATE_TREE_OF_FOLDER"
  7. mc:Ignorable="d"
  8. Title="Image SlideShow Sample App" Height="600" Width="800" MinHeight="600" MinWidth="800"
  9. WindowStartupLocation="CenterScreen">
  10. <Window.Resources>
  11. <local:WidthFourConverter x:Key="widthFourConverter" />
  12. </Window.Resources>
  13.  
  14. <DockPanel>
  15. <Menu DockPanel.Dock="Top">
  16. <MenuItem Header="_File" >
  17. <MenuItem Header="_Open Folder" Click="MenuItem_Click" />
  18. <Separator />
  19. <MenuItem Header="_Exit" Click="MenuItem_Click_1"/>
  20. </MenuItem>
  21. <MenuItem Header="_About" Click="MenuItem_Click_2" />
  22. </Menu>
  23. <Grid>
  24. <Grid.ColumnDefinitions>
  25. <ColumnDefinition Width="*"></ColumnDefinition>
  26. <ColumnDefinition Width="3*"></ColumnDefinition>
  27. </Grid.ColumnDefinitions>
  28.  
  29. <ListView Name="ListView1" Margin="5" BorderThickness="1" BorderBrush="Black" ScrollViewer.CanContentScroll="False">
  30. <ListView.ItemContainerStyle>
  31. <Style TargetType="{x:Type ListViewItem}">
  32. <Setter Property="Background" Value="Transparent" />
  33. <Setter Property="Template">
  34. <Setter.Value>
  35. <ControlTemplate TargetType="{x:Type ListViewItem}">
  36. <ContentPresenter />
  37. </ControlTemplate>
  38. </Setter.Value>
  39. </Setter>
  40. </Style>
  41. </ListView.ItemContainerStyle>
  42.  
  43.  
  44. <Expander Header="Explorer" Expanded="Expander_Expanded" Margin="5,5,5,5">
  45. <TreeView x:Name="foldersItem" Padding="0,5,5,5"
  46. Width="{Binding ElementName=ListView1, Path=ActualWidth, Converter={StaticResource widthFourConverter}}"
  47. Background="LightBlue" BorderBrush="Black" Foreground="#FFFFFFFF"
  48. >
  49. </TreeView>
  50.  
  51.  
  52. </Expander>
  53.  
  54. <Expander Name="fileinfo" Header="File Info" Margin="5,5,5,5" Expanded="exp">
  55. <StackPanel>
  56. <Border Name="bor1" Padding="5" BorderThickness="1" BorderBrush="black" Background="LightGray"
  57. Width="{Binding ElementName=ListView1, Path=ActualWidth, Converter={StaticResource widthFourConverter}}">
  58. <TextBlock Name="nofile">No File is Selected</TextBlock>
  59. </Border>
  60. <Border Name="bor2" Padding="5" BorderThickness="1" BorderBrush="black" Background="LightGray"
  61. Width="{Binding ElementName=ListView1, Path=ActualWidth, Converter={StaticResource widthFourConverter}}">
  62. <Grid Name="picinfo">
  63. <Grid.ColumnDefinitions>
  64. <ColumnDefinition Width="*"></ColumnDefinition>
  65. <ColumnDefinition Width="*"></ColumnDefinition>
  66. </Grid.ColumnDefinitions>
  67. <Grid.RowDefinitions>
  68. <RowDefinition Height="*" />
  69. <RowDefinition Height="*" />
  70. <RowDefinition Height="*" />
  71. <RowDefinition Height="*" />
  72. </Grid.RowDefinitions>
  73. <TextBlock Grid.Row="0" Name="a" Text="Name" FontWeight="Bold"></TextBlock>
  74. <TextBlock Grid.Row="1" Name="b" Text="Width" FontWeight="Bold"></TextBlock>
  75. <TextBlock Grid.Row="2" Name="c" Text="Height" FontWeight="Bold"></TextBlock>
  76. <TextBlock Grid.Row="3" Name="d" Text="Size" FontWeight="Bold"></TextBlock>
  77.  
  78. <TextBlock Grid.Column="1" Name="filename" ></TextBlock>
  79. <TextBlock Grid.Column="1" Grid.Row="1" Name="picwidth" ></TextBlock>
  80. <TextBlock Grid.Column="1" Grid.Row="2" Name="picheight" ></TextBlock>
  81. <TextBlock Grid.Column="1" Grid.Row="3" Name="picsize" ></TextBlock>
  82. </Grid>
  83. </Border>
  84. </StackPanel>
  85. </Expander>
  86.  
  87. <Expander Name="slideshow" Margin="5,5,5,5" Header="Slide Show" >
  88. <Border Name="b1" Padding="5" BorderThickness="1" BorderBrush="black"
  89. Width="{Binding ElementName=ListView1, Path=ActualWidth, Converter={StaticResource widthFourConverter}}" >
  90. <StackPanel>
  91. <Label FontWeight="Bold" FontSize="12">Select SlideShow effect:</Label>
  92. <ComboBox Margin="5,5,5,5">
  93. <ComboBoxItem IsSelected="True">Horizontal effect</ComboBoxItem>
  94. <ComboBoxItem>Opacity effect</ComboBoxItem>
  95. <ComboBoxItem>Vertical effect</ComboBoxItem>
  96. </ComboBox>
  97.  
  98. <Button Margin="5,5,5,5" Click="Startshow_Click" >Start SlideShow</Button>
  99. </StackPanel>
  100. </Border>
  101. </Expander>
  102.  
  103. </ListView>
  104.  
  105. <ListView Name="list" ItemsSource="{Binding Photos}" Margin="5" BorderThickness="1" BorderBrush="Black" Grid.Column="2" SelectionChanged="list_SelectionChanged">
  106. <ItemsControl.ItemTemplate>
  107. <DataTemplate>
  108. <Border BorderThickness="1" BorderBrush="Black" Padding="5" Margin="5,5,5,5">
  109. <StackPanel Orientation="Vertical" Margin="5,5,5,5" VerticalAlignment="Center" >
  110.  
  111. <Grid Width="120" Height="90">
  112. <Image Source="{Binding Path}"/>
  113. </Grid>
  114.  
  115. <TextBlock Name="ImageName" Margin="1" Foreground="#FF787878" Text="{Binding FileName}" HorizontalAlignment="Center"/>
  116. <TextBlock Name="ImageType" Margin="1" Foreground="#FF787878" HorizontalAlignment="Center">
  117. <TextBlock.Text>
  118. <MultiBinding StringFormat="Type: {0}">
  119. <Binding Path="Extension"/>
  120. </MultiBinding>
  121. </TextBlock.Text>
  122. </TextBlock>
  123. <TextBlock Name="ImageSize" Margin="1" Foreground="#FF787878" HorizontalAlignment="Center">
  124. <TextBlock.Text>
  125. <MultiBinding StringFormat="Size: {0} Bytes">
  126. <Binding Path="Size"/>
  127. </MultiBinding>
  128. </TextBlock.Text>
  129. </TextBlock>
  130.  
  131. </StackPanel>
  132. </Border>
  133. </DataTemplate>
  134. </ItemsControl.ItemTemplate>
  135. <ListView.ItemsPanel>
  136. <ItemsPanelTemplate>
  137. <WrapPanel Width = "{Binding ActualWidth , RelativeSource ={RelativeSource AncestorType = ListView }}"/>
  138. </ItemsPanelTemplate>
  139. </ListView.ItemsPanel>
  140. </ListView>
  141.  
  142.  
  143.  
  144. </Grid>
  145. </DockPanel>
  146.  
  147. </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement