[7150] | 1 | <Window x:Class="Com.Piwigo.Wpf.MainWindow" |
---|
| 2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
---|
| 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
---|
| 4 | xmlns:pwg="clr-namespace:Com.Piwigo.Wpf" |
---|
[11911] | 5 | xmlns:pwgui="clr-namespace:Com.Piwigo.Wpf.UI" |
---|
[7160] | 6 | xmlns:pwgdto="clr-namespace:Com.Piwigo.Wpf.DTO" |
---|
[7150] | 7 | xmlns:pwgcmd="clr-namespace:Com.Piwigo.Wpf.Command" |
---|
[11904] | 8 | xmlns:pwgsrv="clr-namespace:Com.Piwigo.Wpf.Service" |
---|
[11922] | 9 | xmlns:pwghlp="clr-namespace:Com.Piwigo.Wpf.Helper" |
---|
[7150] | 10 | Title="PiwigoWpf" |
---|
| 11 | WindowState="Maximized" |
---|
| 12 | MinHeight="600" MinWidth="800"> |
---|
| 13 | <Window.Resources> |
---|
[11922] | 14 | <pwghlp:AdvBooltoVisibilityConverter x:Key="AdvBooltoVisibilityConverter" Collapse="False" Reverse="False" /> |
---|
| 15 | <pwghlp:AdvBooltoVisibilityConverter x:Key="AdvBooltoVisibilityConverterReversal" Collapse="False" Reverse="True" /> |
---|
| 16 | <!-- DATA TEMPLATES --> |
---|
[7150] | 17 | |
---|
[7160] | 18 | <DataTemplate DataType="{x:Type pwgdto:PwgImageWPF}"> |
---|
| 19 | <Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" Background="Blue" |
---|
[11904] | 20 | DataContext="{Binding}"><!--Source="{Binding UrlElement}"--> |
---|
| 21 | <Image ToolTip="{Binding File}" > |
---|
| 22 | <Image.Source> |
---|
[11922] | 23 | <Binding Path="ImgSource" /> <!--Converter="{x:Static pwgsrv:ImageCacheManager.ImageUrlCachedConverter}"--> |
---|
[11904] | 24 | </Image.Source> |
---|
| 25 | </Image> |
---|
[7150] | 26 | </Border> |
---|
| 27 | </DataTemplate> |
---|
| 28 | |
---|
[11904] | 29 | <DataTemplate DataType="{x:Type pwgdto:PwgCategoryWPF}" > |
---|
| 30 | <Border VerticalAlignment="Center" HorizontalAlignment="Center" |
---|
| 31 | Padding="4" Margin="1" |
---|
| 32 | Background="LightBlue" |
---|
| 33 | DataContext="{Binding}"> |
---|
| 34 | <StackPanel Orientation="Vertical" DataContext="{Binding}" VerticalAlignment="Center" > |
---|
| 35 | <Image Source="pack://application:,,,/Pictures/folder_images.png" |
---|
| 36 | Stretch="Uniform" |
---|
| 37 | MaxHeight="128" |
---|
| 38 | MaxWidth="128"> |
---|
| 39 | <Image.ToolTip> |
---|
| 40 | <StackPanel Orientation="Vertical"> |
---|
| 41 | <StackPanel Orientation="Horizontal"> |
---|
| 42 | <TextBlock Text="{Binding Path=ImagesCount}"/> |
---|
| 43 | <TextBlock Text=" images inside"/> |
---|
| 44 | </StackPanel> |
---|
| 45 | <StackPanel Orientation="Horizontal"> |
---|
| 46 | <TextBlock Text="{Binding Path=SubCategoriesCount}"/> |
---|
| 47 | <TextBlock Text=" categories inside"/> |
---|
| 48 | </StackPanel> |
---|
| 49 | </StackPanel> |
---|
| 50 | </Image.ToolTip> |
---|
| 51 | </Image> |
---|
| 52 | <TextBlock Text="{Binding Name}" /> |
---|
| 53 | </StackPanel> |
---|
[7150] | 54 | </Border> |
---|
| 55 | </DataTemplate> |
---|
| 56 | |
---|
[11904] | 57 | <Style x:Key="CategoryListStyle" TargetType="{x:Type ListBox}"> |
---|
[7150] | 58 | <Setter Property="Template"> |
---|
| 59 | <Setter.Value> |
---|
| 60 | <ControlTemplate TargetType="{x:Type ListBox}" > |
---|
| 61 | <Border |
---|
| 62 | BorderBrush="Gray" |
---|
| 63 | BorderThickness="1" |
---|
| 64 | CornerRadius="6" |
---|
[11904] | 65 | Background="LightBlue" |
---|
| 66 | > |
---|
| 67 | <!--Background="{DynamicResource ListBoxGradient}"--> |
---|
[7150] | 68 | <ScrollViewer |
---|
[11904] | 69 | VerticalScrollBarVisibility="Auto" |
---|
| 70 | HorizontalScrollBarVisibility="Disabled"> |
---|
[7150] | 71 | <StackPanel |
---|
| 72 | IsItemsHost="True" |
---|
[11904] | 73 | Orientation="Vertical" |
---|
| 74 | HorizontalAlignment="Center" |
---|
| 75 | VerticalAlignment="Top"/> |
---|
[7150] | 76 | </ScrollViewer> |
---|
| 77 | </Border> |
---|
| 78 | </ControlTemplate> |
---|
| 79 | </Setter.Value> |
---|
| 80 | </Setter> |
---|
| 81 | </Style> |
---|
| 82 | |
---|
[11904] | 83 | <Style x:Key="CategoryListItem" TargetType="{x:Type ListBoxItem}"> |
---|
| 84 | <Setter Property="MaxHeight" Value="128" /> |
---|
| 85 | <Setter Property="MinHeight" Value="128" /> |
---|
[7150] | 86 | <Setter Property="Opacity" Value=".75" /> |
---|
| 87 | <Style.Triggers> |
---|
| 88 | <EventTrigger RoutedEvent="Mouse.MouseEnter"> |
---|
| 89 | <EventTrigger.Actions> |
---|
| 90 | <BeginStoryboard> |
---|
| 91 | <Storyboard> |
---|
| 92 | <DoubleAnimation |
---|
| 93 | Duration="0:0:0.2" |
---|
| 94 | Storyboard.TargetProperty="MaxHeight" |
---|
[11904] | 95 | To="220" /> |
---|
[7150] | 96 | <DoubleAnimation |
---|
| 97 | Duration="0:0:0.2" |
---|
| 98 | Storyboard.TargetProperty="Opacity" |
---|
| 99 | To="1.0" /> |
---|
| 100 | </Storyboard> |
---|
| 101 | </BeginStoryboard> |
---|
| 102 | </EventTrigger.Actions> |
---|
| 103 | </EventTrigger> |
---|
| 104 | |
---|
| 105 | <EventTrigger RoutedEvent="Mouse.MouseLeave"> |
---|
| 106 | <EventTrigger.Actions> |
---|
| 107 | <BeginStoryboard> |
---|
| 108 | <Storyboard> |
---|
| 109 | <DoubleAnimation |
---|
| 110 | Duration="0:0:1" |
---|
| 111 | Storyboard.TargetProperty="MaxHeight" /> |
---|
| 112 | <DoubleAnimation |
---|
| 113 | Duration="0:0:0.2" |
---|
| 114 | Storyboard.TargetProperty="Opacity" /> |
---|
| 115 | </Storyboard> |
---|
| 116 | </BeginStoryboard> |
---|
| 117 | </EventTrigger.Actions> |
---|
| 118 | </EventTrigger> |
---|
| 119 | </Style.Triggers> |
---|
| 120 | </Style> |
---|
[11904] | 121 | <!-- PHOTOLIST TEMPLATE --> |
---|
| 122 | |
---|
| 123 | <Style x:Key="PhotoListStyle" TargetType="{x:Type ListBox}"> |
---|
[7150] | 124 | <Setter Property="Template"> |
---|
| 125 | <Setter.Value> |
---|
[11904] | 126 | <ControlTemplate TargetType="{x:Type ListBox}" > |
---|
[7150] | 127 | <Border |
---|
[11904] | 128 | BorderBrush="Gray" |
---|
[7150] | 129 | BorderThickness="1" |
---|
| 130 | CornerRadius="6" |
---|
[11904] | 131 | Background="LightBlue" |
---|
| 132 | > |
---|
| 133 | <!--Background="{DynamicResource ListBoxGradient}"--> |
---|
| 134 | <ScrollViewer |
---|
| 135 | VerticalScrollBarVisibility="Disabled" |
---|
| 136 | HorizontalScrollBarVisibility="Auto"> |
---|
| 137 | <StackPanel |
---|
| 138 | IsItemsHost="True" |
---|
| 139 | Orientation="Horizontal" |
---|
| 140 | HorizontalAlignment="Left" /> |
---|
| 141 | </ScrollViewer> |
---|
[7150] | 142 | </Border> |
---|
| 143 | </ControlTemplate> |
---|
| 144 | </Setter.Value> |
---|
| 145 | </Setter> |
---|
| 146 | </Style> |
---|
| 147 | |
---|
[11904] | 148 | <!-- PHOTOLIST STORYBOARDS --> |
---|
[7150] | 149 | |
---|
[11904] | 150 | <Style x:Key="PhotoListItem" TargetType="{x:Type ListBoxItem}"> |
---|
| 151 | <Setter Property="MaxHeight" Value="75" /> |
---|
| 152 | <Setter Property="MinHeight" Value="75" /> |
---|
| 153 | <Setter Property="Opacity" Value=".75" /> |
---|
| 154 | <Style.Triggers> |
---|
| 155 | <EventTrigger RoutedEvent="Mouse.MouseEnter"> |
---|
| 156 | <EventTrigger.Actions> |
---|
| 157 | <BeginStoryboard> |
---|
| 158 | <Storyboard> |
---|
| 159 | <DoubleAnimation |
---|
| 160 | Duration="0:0:0.2" |
---|
| 161 | Storyboard.TargetProperty="MaxHeight" |
---|
| 162 | To="85" /> |
---|
| 163 | <DoubleAnimation |
---|
| 164 | Duration="0:0:0.2" |
---|
| 165 | Storyboard.TargetProperty="Opacity" |
---|
| 166 | To="1.0" /> |
---|
| 167 | </Storyboard> |
---|
| 168 | </BeginStoryboard> |
---|
| 169 | </EventTrigger.Actions> |
---|
| 170 | </EventTrigger> |
---|
[7150] | 171 | |
---|
[11904] | 172 | <EventTrigger RoutedEvent="Mouse.MouseLeave"> |
---|
| 173 | <EventTrigger.Actions> |
---|
| 174 | <BeginStoryboard> |
---|
| 175 | <Storyboard> |
---|
| 176 | <DoubleAnimation |
---|
| 177 | Duration="0:0:1" |
---|
| 178 | Storyboard.TargetProperty="MaxHeight" /> |
---|
| 179 | <DoubleAnimation |
---|
| 180 | Duration="0:0:0.2" |
---|
| 181 | Storyboard.TargetProperty="Opacity" /> |
---|
| 182 | </Storyboard> |
---|
| 183 | </BeginStoryboard> |
---|
| 184 | </EventTrigger.Actions> |
---|
| 185 | </EventTrigger> |
---|
| 186 | </Style.Triggers> |
---|
[7150] | 187 | </Style> |
---|
| 188 | |
---|
[11904] | 189 | <!--<Style TargetType="{x:Type pwg:MainWindow}"> |
---|
| 190 | <Setter Property="Background" Value="{DynamicResource WindowGradient}" /> |
---|
| 191 | </Style>--> |
---|
[7150] | 192 | |
---|
| 193 | </Window.Resources> |
---|
| 194 | <DockPanel Name="mainDockPanel" Margin="5"> |
---|
| 195 | <StackPanel Name="headerStackPanel" DockPanel.Dock="Top" Orientation="Vertical"> |
---|
[11922] | 196 | <StackPanel Name="headerStackPanelLogo" Orientation="Horizontal" > |
---|
| 197 | <Image Name="ImgPiwigoLogo" MinHeight="50" MinWidth="50" |
---|
[7150] | 198 | Source="pack://application:,,,/Pictures/PiwigoLogo.png" |
---|
[11904] | 199 | ToolTip="www.piwigo.org" Stretch="None" HorizontalAlignment="Left" /> |
---|
[11922] | 200 | <Image Name="ImgGlobe" |
---|
| 201 | Visibility="{Binding Source={x:Static pwgdto:PwgModelManager.Instance}, Path=booCmdRunning, Converter={StaticResource AdvBooltoVisibilityConverterReversal}}" |
---|
| 202 | Source="pack://application:,,,/Pictures/Globe.png" |
---|
| 203 | ToolTip="www.piwigo.org" Stretch="None" HorizontalAlignment="Right"/> |
---|
| 204 | </StackPanel> |
---|
[7150] | 205 | <StackPanel Name="connectStackPanel" Orientation="Horizontal" VerticalAlignment="Center" Margin="5" |
---|
| 206 | DataContext="{Binding Source={StaticResource Session}}"> |
---|
| 207 | <Label Content="User" Name="LblUsr" /> |
---|
| 208 | <TextBox Height="23" Name="BbUsr" Width="120" Text="{Binding Path=UserName, Mode=TwoWay}" /> |
---|
| 209 | <Label Content="Password" Name="LblPwd" /> |
---|
[11911] | 210 | <PasswordBox Height="23" Name="TbPwd" Width="120" PasswordChar="*" |
---|
| 211 | pwgui:PasswordHelper.BindPassword="true" pwgui:PasswordHelper.BoundPassword="{Binding Path=Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
---|
[7150] | 212 | <Label Content="Url" Name="LblUrl" /> |
---|
| 213 | <TextBox Height="23" Name="TbUrl" Width="300" Text="{Binding Path=ServeurName, Mode=TwoWay}"/> |
---|
[11911] | 214 | <CheckBox Margin="2" VerticalAlignment="Center" IsChecked="{Binding Path=SaveSetting, Mode=TwoWay}">Save settings</CheckBox> |
---|
[11922] | 215 | <Button Margin="2" Command="{x:Static pwgcmd:PwgCmdProvider.PwgCmdConnect}" Visibility="{Binding Path=IsConnected, Converter={StaticResource AdvBooltoVisibilityConverterReversal}}">Conect</Button> |
---|
| 216 | <Button Margin="2" Command="{x:Static pwgcmd:PwgCmdProvider.PwgCmdDisconnect}" Visibility="{Binding Path=IsConnected, Converter={StaticResource AdvBooltoVisibilityConverter}}">Disconect</Button> |
---|
[7150] | 217 | </StackPanel> |
---|
| 218 | </StackPanel> |
---|
[11922] | 219 | <ListView Name="listViewLogUiInfo" DockPanel.Dock="Bottom" |
---|
| 220 | DataContext="{Binding Source={x:Static pwgdto:PwgModelManager.Instance}, Path=lstMsgInfo}" |
---|
| 221 | ItemsSource="{Binding }" /> |
---|
[7160] | 222 | |
---|
[11904] | 223 | <ListView Name="listViewCategory" DockPanel.Dock="Left" MinWidth="100" |
---|
| 224 | Style="{DynamicResource CategoryListStyle}" |
---|
| 225 | ItemContainerStyle="{DynamicResource CategoryListItem}" |
---|
| 226 | DataContext="{Binding Source={StaticResource Categories}}" |
---|
| 227 | ItemsSource="{Binding }" MouseDoubleClick="listViewCategory_MouseDoubleClick" /> |
---|
[11922] | 228 | |
---|
[11904] | 229 | <ListView Name="listViewImage" DockPanel.Dock="Right" MinWidth="500" |
---|
| 230 | Style="{DynamicResource PhotoListStyle}" |
---|
| 231 | ItemContainerStyle="{DynamicResource PhotoListItem}" |
---|
| 232 | DataContext="{Binding Source={StaticResource Images}}" |
---|
| 233 | ItemsSource="{Binding }" /> |
---|
[7150] | 234 | </DockPanel> |
---|
| 235 | |
---|
| 236 | </Window> |
---|