Ignore:
Timestamp:
Jan 19, 2011, 6:06:27 PM (11 years ago)
Author:
matkovic
Message:

-added collapse all / expand all button
-added aging in indicated by the ProgressBar color

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/StatisticsPresentation.xaml

    r2330 r2393  
    1313        <Controls:ChunkSumConverter x:Key="ChunkSumConverter"/>
    1414        <Controls:StringLengthConverter x:Key="StringLengthConverter"/>
     15        <Controls:ColorToDateConverter x:Key="ColorToDateConverter"></Controls:ColorToDateConverter>
    1516        <g:WidthConverter x:Key="WidthConverter"></g:WidthConverter>
    1617        <AlternationConverter x:Key="TeamsBackgroundConverter">
     
    1920            <SolidColorBrush>Blue</SolidColorBrush>
    2021        </AlternationConverter>
     22
     23        <Style x:Key="ItemStyle" TargetType="TreeViewItem">
     24            <Setter x:Name="P" Property="IsExpanded" Value="True" />
     25        </Style>
     26
     27        <Style x:Key="ItemStyle2" TargetType="TreeViewItem">
     28            <Setter x:Name="P" Property="IsExpanded" Value="False" />
     29        </Style>
     30
    2131    </UserControl.Resources>
    2232   
     
    3242                    <RowDefinition ScrollViewer.VerticalScrollBarVisibility="Auto"/>
    3343                </Grid.RowDefinitions>
    34                 <TextBlock Text="User/Host " Grid.Column="0" Grid.Row="0" HorizontalAlignment="Center"/>
    35                 <TextBlock Text="Calculated Chunks" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left"/>
     44                <StackPanel Orientation="Horizontal">
     45                    <TextBlock Text="User/Host " Grid.Column="0" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
     46                </StackPanel>
     47                <TextBlock Text="Calculated Chunks" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center"/>
     48                <Button Content="Expand" Grid.Column="1" Grid.Row="0" Click="Button_Click" Width="50" HorizontalAlignment="Right"></Button>
    3649                <TreeView HorizontalAlignment="Stretch" Name="statisticsTree" VerticalAlignment="Stretch" ItemsSource="{Binding}" AlternationCount="3" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" >
    3750                    <TreeView.ItemTemplate>
     
    4457                                        </Grid>
    4558                                        <Grid>
    46                                             <ProgressBar Foreground="{Binding RelativeSource={RelativeSource FindAncestor,  AncestorLevel=2, AncestorType={x:Type TreeViewItem}},Path=(ItemsControl.AlternationIndex),Converter={StaticResource ResourceKey=TeamsBackgroundConverter}}" Value="{Binding Path=Value.Count, Mode=OneTime, Converter={StaticResource ResourceKey=InformationToProgressConverter2}}" Width="{Binding ElementName=statisticsTree, Path=ActualWidth, Converter={StaticResource ResourceKey=WidthConverter}}" Maximum="1" />
     59                                            <ProgressBar Width="{Binding ElementName=statisticsTree, Path=ActualWidth, Converter={StaticResource ResourceKey=WidthConverter}}" Value="{Binding Path=Value.Count, Mode=OneTime, Converter={StaticResource ResourceKey=InformationToProgressConverter2}}" Maximum="1">
     60                                                <ProgressBar.Foreground>
     61                                                    <MultiBinding Converter="{StaticResource ResourceKey=ColorToDateConverter}">
     62                                                        <Binding Path="Value.Date" Mode="OneTime"></Binding>
     63                                                        <Binding RelativeSource="{RelativeSource FindAncestor, AncestorLevel=2, AncestorType={x:Type TreeViewItem}}" Path="(ItemsControl.AlternationIndex)"></Binding>
     64                                                    </MultiBinding>
     65                                                </ProgressBar.Foreground>
     66                                            </ProgressBar>
    4767                                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
    4868                                                <TextBlock Text="{Binding Path=Value.Count, StringFormat=\{0\,-5\}}"/>
Note: See TracChangeset for help on using the changeset viewer.