当搜索按钮单击时,如何搜索存储在文件中的数据并将其显示在列表框中?

时间:2011-09-08 09:40:01

标签: windows-phone-7

我想搜索存储在文件中的数据,当我点击搜索按钮,然后在Window Phone 7应用程序的列表框中显示它。

像这样的UI设计

<ComboBox x:Name="comboPriority" Height="43" VerticalAlignment="Center" SelectedIndex="1" HorizontalAlignment="Center" Width="246" OpacityMask="#BFBAD5AF" Foreground="Black" Margin="12,61,198,503">
    <ComboBoxItem Content="Art" x:Name="minimum" Foreground="Black" Background="White" FontSize="28"></ComboBoxItem>
    <ComboBoxItem Content="Science" x:Name="maximum" Foreground="Black" Background="White"  FontSize="28" ></ComboBoxItem>
    <ComboBoxItem Content="Entertenment" Foreground="Black" Background="White"  FontSize="28"></ComboBoxItem>
    <ComboBoxItem Content="Politics" Foreground="Black" Background="White"  FontSize="28"></ComboBoxItem>
</ComboBox>

<Button Name="btnSearch" Content="Search" Height="70" Width="150" Margin="293,47,13,483" Click="btnSearch_Click" BorderBrush="#FF100505" Foreground="#FF070101" />
<ListBox Height="359" HorizontalAlignment="Left" Margin="10,168,0,0" Name="lbList" VerticalAlignment="Top" Width="433" />

当我选择文件中的类别相关数据时,可以在列表框中显示..

1 个答案:

答案 0 :(得分:0)

您应该阅读Data Binding