Permalink
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (76 sloc) 4.78 KB
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:views="clr-namespace:UI.Views;assembly=UI"
xmlns:fsxaml="http://github.com/fsprojects/FsXaml">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
<ListView Grid.Row="0" Grid.Column="0" SelectionMode="Extended"
Name="Searches"
ItemsSource="{Binding Model.Searches}">
<ListView.InputBindings>
<KeyBinding Key="C" Modifiers="Ctrl" Command="{Binding Copy}" CommandParameter="{Binding ElementName=Searches, Path=SelectedItems}" />
</ListView.InputBindings>
<ListView.Resources>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="Background">
<Setter.Value>
<Binding RelativeSource="{RelativeSource Self}" Converter="{StaticResource AlternatingRowColor}"/>
</Setter.Value>
</Setter>
</Style>
</ListView.Resources>
<ListView.View>
<GridView>
<GridView.Columns>
<GridViewColumn Header="Name" Width="150"
DisplayMemberBinding="{Binding LogName}"/>
<GridViewColumn Header="Result" Width="150">
<GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<ProgressBar Grid.Column="0" Grid.Row="0"
Minimum="0" Maximum="100" Value="{Binding Progress}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
IsIndeterminate="{Binding IsStarting}"
Visibility="{Binding Path=IsExecuting, Converter={StaticResource Visibility}}"/>
<TextBlock Grid.Column="0" Grid.Row="0"
Text="{Binding TargetResult, Converter={StaticResource TargetOption}}"
Visibility="{Binding Path=IsExecuting, Converter={StaticResource NegateVisibility}}"/>
</Grid>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Total" Width="75"
DisplayMemberBinding="{Binding Total}"/>
<GridViewColumn Header="Range" Width="75"
DisplayMemberBinding="{Binding Range}"/>
<GridViewColumn Header="From" Width="75"
DisplayMemberBinding="{Binding LowerBound}"/>
<GridViewColumn Header="To" Width="75"
DisplayMemberBinding="{Binding UpperBound}"/>
<GridViewColumn Header="Query" Width="75"
DisplayMemberBinding="{Binding QueryPosition}"/>
<GridViewColumn Header="Current" Width="75"
DisplayMemberBinding="{Binding CurrentPosition}"/>
<GridViewColumn Header="Status" Width="100"
DisplayMemberBinding="{Binding Status}"/>
</GridView.Columns>
</GridView>
</ListView.View>
</ListView>
<DockPanel Grid.Row="1" Grid.Column="0">
<Button DockPanel.Dock="Left" Command="{Binding Run}" Padding="5 0 5 0" CommandParameter="{Binding ElementName=Searches, Path=SelectedItems}">▶ Start</Button>
<Button DockPanel.Dock="Left" Command="{Binding RunAll}" Padding="5 0 5 0">All</Button>
<Button DockPanel.Dock="Left" Command="{Binding Stop}" Padding="5 0 5 0" CommandParameter="{Binding ElementName=Searches, Path=SelectedItems}">◼ Stop</Button>
<Button DockPanel.Dock="Left" Command="{Binding StopAll}" Padding="5 0 5 0">All</Button>
<views:VersionView />
</DockPanel>
</Grid>
</UserControl>