source: trunk/CrypPlugins/P2PEditor/GUI/Controls/JobDisplayTemplate.xaml @ 1856

Last change on this file since 1856 was 1856, checked in by Paul Lelgemann, 11 years ago

o Fix for P2PEditor: Job descriptions with multiple lines are now shown, unknown start date or participant number will be shown as "-" and clicking on connect in the settings pane will disable the main connect button

File size: 3.6 KB
Line 
1<ResourceDictionary x:Class="Cryptool.P2PEditor.GUI.Controls.JobDisplayTemplate"
2              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Distributed="clr-namespace:Cryptool.P2PEditor.Distributed" xmlns:Converters="clr-namespace:Cryptool.P2PEditor.Converters">
4
5    <Converters:StatusToColorConverter x:Key="StatusToColorConverter" />
6        <Converters:StringEmptyToVisibilityConverter x:Key="StringEmptyToVisibilityConverter" />
7        <Converters:TrueToVisibleOrCollapsedConverter x:Key="TrueToVisibleOrCollapsedConverter" />
8    <Converters:UtcDateTimeToLocalConverter x:Key="UtcDateTimeToLocalConverter" />
9        <DataTemplate DataType="{x:Type Distributed:DistributedJob}" x:Key="jobDisplayTemplate">
10        <Border BorderBrush="Silver" BorderThickness="0,0,0,1">
11            <StackPanel>
12                <Grid>
13                    <Grid.ColumnDefinitions>
14                        <ColumnDefinition Width="300*" />
15                        <ColumnDefinition Width="300" />
16                        <ColumnDefinition Width="140" />
17                    </Grid.ColumnDefinitions>
18                    <Label Content="{Binding Name}" FontSize="16" Grid.Column="0" />
19
20                    <Ellipse Fill="{Binding Status.CurrentStatus, Converter={StaticResource StatusToColorConverter}}" Height="18" Width="18" StrokeThickness="1" Stroke="DarkGray" Margin="0,5,105,5" Grid.Column="1" HorizontalAlignment="Right" />
21                    <ProgressBar Value="{Binding Status.Progress}" Maximum="1" Width="100" Height="20" Grid.Column="1" HorizontalAlignment="Right" />
22
23                    <Label Content="{Binding CreateDate, Converter={StaticResource UtcDateTimeToLocalConverter}}" FontSize="16" Grid.Column="2" HorizontalAlignment="Right" Foreground="DarkGray" />
24                </Grid>
25                <Grid Visibility="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Converter={StaticResource TrueToVisibleOrCollapsedConverter}}">
26                    <Grid.ColumnDefinitions>
27                        <ColumnDefinition Width="75" />
28                        <ColumnDefinition Width="*" />
29                    </Grid.ColumnDefinitions>
30                    <StackPanel Grid.Column="0">
31                        <Label Content="Author:" FontSize="10" Height="23" />
32                        <Label Content="Workspace:" FontSize="10" Height="23" />
33                        <Label Content="Downloads:" FontSize="10" Height="23" />
34                        <Label Content="Participants:" FontSize="10" Height="23" />
35                        <Label Content="Start date:" FontSize="10" Height="23" />
36                        <Label Content="Description:" FontSize="10" Height="23" />
37                    </StackPanel>
38                    <StackPanel Grid.Column="1">
39                        <Label Content="{Binding Owner}" Height="23" FontSize="10" />
40                        <Label Content="{Binding FileName}" Height="23" FontSize="10" />
41                        <Label Content="{Binding Downloads}" Height="23" FontSize="10" />
42                        <Label Content="{Binding Status.Participants, FallbackValue=-}" Height="23" FontSize="10" />
43                        <Label Content="{Binding Status.StartDate, Converter={StaticResource UtcDateTimeToLocalConverter}, FallbackValue=-}" Height="23" FontSize="10" />
44                        <Label Content="{Binding Description}" FontSize="10" />
45                    </StackPanel>
46                </Grid>
47            </StackPanel>
48        </Border>
49    </DataTemplate>
50   
51</ResourceDictionary>
Note: See TracBrowser for help on using the repository browser.