Ignore:
Timestamp:
Oct 11, 2010, 8:04:34 PM (14 years ago)
Author:
bayral
Message:

Connection à partir de wpf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml

    r7150 r7160  
    33        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    44        xmlns:pwg="clr-namespace:Com.Piwigo.Wpf"
     5        xmlns:pwgdto="clr-namespace:Com.Piwigo.Wpf.DTO"
    56        xmlns:pwgcmd="clr-namespace:Com.Piwigo.Wpf.Command"
    67        Title="PiwigoWpf"
     
    122123        <!-- DATA TEMPLATES -->
    123124
    124         <!--<DataTemplate DataType="{x:Type pd:ImageFile}">
    125             <Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" Background="White">
    126                 <Image Source="{Binding Image}" />
     125        <DataTemplate DataType="{x:Type pwgdto:PwgImageWPF}">
     126            <Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" Background="Blue"
     127                    DataContext="{Binding}">
     128                <Image Source="{Binding UrlElement}" ToolTip="{Binding File}" />
    127129            </Border>
    128130        </DataTemplate>
    129131
    130         <DataTemplate DataType="{x:Type pd:Print}">
    131             <Border Margin="3" VerticalAlignment="Center" HorizontalAlignment="Center" Background="White" Padding="3"  BorderBrush="#66000000" BorderThickness="1" MaxWidth="60" MaxHeight="60" >
    132                 <Image Source="{Binding Photo}" />
     132        <DataTemplate DataType="{x:Type pwgdto:PwgCategoryWPF}">
     133            <Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" Background="Blue"
     134                    DataContext="{Binding}">               
     135                <TextBox ToolTip="{Binding Name}" />
    133136            </Border>
    134137        </DataTemplate>
    135 
    136         <DataTemplate DataType="{x:Type pd:GreetingCard}">
    137             <Grid Margin="3" >
    138                 <Border VerticalAlignment="Center" HorizontalAlignment="Center" Background="{DynamicResource GreetingCardGradient}" Width="40" Height="50" BorderBrush="#44000000" BorderThickness="1" >
    139                     <Border.RenderTransform>
    140                         <SkewTransform AngleY="-10" />
    141                     </Border.RenderTransform>
    142                 </Border>
    143                 <Border VerticalAlignment="Center" HorizontalAlignment="Center" Background="White" Width="50" Height="50" BorderBrush="#66000000" BorderThickness="1" >
    144                     <Image Margin="3" Source="{Binding Photo}" />
    145                 </Border>
    146             </Grid>
    147         </DataTemplate>
    148 
    149         <DataTemplate DataType="{x:Type pd:TShirt}">
    150             <Grid Margin="3">
    151                 <Path VerticalAlignment="Center" HorizontalAlignment="Center" Fill="White" Stroke="#66000000"  Data="M 0 9.6 L 24 0 L 40 0 L 64 9.6 L 62.4 24 L 51.2 24 L 51.2 56 L 12.8 56 L 12.8 24 L 1.6 24 Z "/>
    152                 <Image Source="{Binding Photo}"  MaxWidth="32" MaxHeight="36"  VerticalAlignment="Center" HorizontalAlignment="Center"/>
    153             </Grid>
    154         </DataTemplate>-->
    155138
    156139        <!-- PHOTOLIST TEMPLATE -->
     
    218201                </EventTrigger>
    219202            </Style.Triggers>
    220         </Style>
    221 
    222         <!-- SHOPPING CART TEMPLATE -->
    223 
    224         <Style x:Key="ShoppingCartStyle" TargetType="{x:Type ListBox}">
    225             <Setter Property="Template">
    226                 <Setter.Value>
    227                     <ControlTemplate TargetType="{x:Type ListBox}" >
    228                         <Border
    229                                                         BorderBrush="Gray"
    230                                                         BorderThickness="1"
    231                                                         CornerRadius="6"
    232                                                         Background="{DynamicResource ShoppingCartGradient}" >
    233                             <ScrollViewer>
    234                                 <WrapPanel
    235                                                                         ItemHeight="70"
    236                                                                         ItemWidth="70"
    237                                                                         Margin="0,25,0,0"
    238                                                                         IsItemsHost="True"
    239                                                                         Orientation="Horizontal"
    240                                                                         HorizontalAlignment="Center"  />
    241                             </ScrollViewer>
    242                         </Border>
    243                     </ControlTemplate>
    244                 </Setter.Value>
    245             </Setter>
    246         </Style>
    247 
    248         <!-- SHOPPING CART TRIGGERS -->
    249 
    250         <Style x:Key="ShoppingCartItem" TargetType="{x:Type ListBoxItem}">
    251             <Setter Property="BorderBrush" Value="Transparent" />
    252             <Setter Property="Template">
    253                 <Setter.Value>
    254                     <ControlTemplate TargetType="{x:Type ListBoxItem}">
    255                         <Border
    256                                                         x:Name="ContentBorder"
    257                                                         Opacity="0.85">
    258                             <ContentPresenter />
    259                         </Border>
    260                         <ControlTemplate.Triggers>
    261                             <Trigger Property="IsSelected" Value="True">
    262                                 <Setter
    263                                                                         TargetName="ContentBorder"
    264                                                                         Property="Opacity"
    265                                                                         Value="1.0" />
    266                             </Trigger>
    267                         </ControlTemplate.Triggers>
    268                     </ControlTemplate>
    269                 </Setter.Value>
    270             </Setter>
    271203        </Style>
    272204
     
    500432           <ProgressBar IsIndeterminate="True" />         
    501433        </StackPanel>
    502        
    503         <ListView Name="listViewCategory" DockPanel.Dock="Left" MinWidth="100" />
    504         <ListView Name="listViewImage" DockPanel.Dock="Right"  MinWidth="500"/>
     434
     435        <ListView Name="listViewCategory" Style="PhotoListStyle" DockPanel.Dock="Left" MinWidth="100" ItemsSource="{Binding Source={StaticResource Categories}}" />
     436        <ListView Name="listViewImage" Style="PhotoListStyle" DockPanel.Dock="Right"  MinWidth="500" ItemsSource="{Binding Source={StaticResource Images}}" />
    505437    </DockPanel>
    506438   
Note: See TracChangeset for help on using the changeset viewer.