Added cap query support example.

This commit is contained in:
soukoku
2014-04-20 22:24:05 -04:00
parent a766370930
commit 31f77edb40
11 changed files with 76 additions and 44 deletions

View File

@@ -25,17 +25,28 @@
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Name}" TextWrapping="Wrap"></TextBlock>
<TextBlock Text="{Binding Version, StringFormat='Version {0}'}" TextWrapping="Wrap" Foreground="{DynamicResource ModernForeground2}"/>
<TextBlock Text="{Binding Protocol, StringFormat='TWAIN {0}'}" Foreground="{DynamicResource ModernForeground2}"/>
<TextBlock Text="{Binding Version, StringFormat='Version {0}'}" TextWrapping="Wrap" Foreground="{DynamicResource ModernForeground2}"
Margin="8 0 0 0"/>
<TextBlock Text="{Binding Protocol, StringFormat='TWAIN {0}'}" Foreground="{DynamicResource ModernForeground2}"
Margin="8 0 0 0"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Label Content="Caps" Grid.Column="1"></Label>
<ListBox x:Name="CapList" Grid.Row="1" Grid.Column="1" MinWidth="100"
<ListBox x:Name="CapList" Grid.Row="1" Grid.Column="1" Width="150"
SelectionChanged="CapList_SelectionChanged"
Style="{StaticResource AppListBox}"></ListBox>
Style="{StaticResource AppListBox}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Name}" ></TextBlock>
<TextBlock Text="{Binding Supports}" TextWrapping="Wrap" Foreground="{DynamicResource ModernForeground2}"
FontStyle="Italic"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate></ListBox>
<Label Content="Cap values" Grid.Column="2"></Label>
<ListBox x:Name="CapDetailList" Grid.Row="1" Grid.Column="2" MinWidth="100"

View File

@@ -92,7 +92,8 @@ namespace Tester.WPF
{
var caps = _twainVM.SupportedCaps.Select(o => new CapVM
{
Cap = o
Cap = o,
Supports = _twainVM.GetCapSupport(o)
}).OrderBy(o => o.Name).ToList();
CapList.ItemsSource = caps;
}

View File

@@ -21,13 +21,7 @@ namespace Tester.WPF
}
}
//public void SupportedOperations
//{
// get
// {
// }
//}
public QuerySupport Supports { get; set; }
public override string ToString()
{