刷新工具包:数据库更新后的listpicker

时间:2014-09-27 16:30:00

标签: c# xaml windows-phone-8.1 wptoolkit

我的Windows Phone 8.1 app mainpage.xaml

中有toolkit:listpicker
<toolkit:ListPicker x:Name="ListPicker"
                    HorizontalAlignment="Left"
                    Margin="40,10,0,0"
                    VerticalAlignment="Top"
                    Grid.Row="1">
    <toolkit:ListPicker.ItemTemplate>
        <DataTemplate>
            <toolkit:ListPickerItem Content="{Binding ListName}" />
        </DataTemplate>
    </toolkit:ListPicker.ItemTemplate>
 </toolkit:ListPicker>

和另一个在本地数据库中添加项目的页面。 当我添加项目时,listpicker不会刷新,直到我关闭应用程序并再次重新打开它。

有人可以帮我这个吗?

1 个答案:

答案 0 :(得分:1)

在数据源上实现Inotifypropertychanged模式。这样,UI将响应您在数据源中所做的任何更改。

http://danrigby.com/2012/03/01/inotifypropertychanged-the-net-4-5-way