简体   繁体   中英

Refreshing toolkit:listpicker after database update

I have toolkit:listpicker in my windows phone 8.1 app mainpage.xaml

<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>

and another page that add's item in local database. When i add item, listpicker is not refreshed until i close app and reopen it again.

Can someone help me with this?

Implement the Inotifypropertychanged pattern on your datasource. That way the UI wil respond to any changes you make in your datasource.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM