Muhammad Saifullah
Muhammad Saifullah

Reputation: 4292

How to use listpickerflyout in windows phone 8.1 using MVVM

I am looking for an example of how can i use listpickerflyout in windows phone 8.1 in MVVM Light. My requirement is to show a list to user e.g country list where user can pick one of the country. and selected country is shown.

Upvotes: 2

Views: 3979

Answers (1)

Muhammad Saifullah
Muhammad Saifullah

Reputation: 4292

Got the solution :) just need to add the button and than add listpickerflyout in xaml and bind the item source of the flyout and button content property. here is how

<Button x:Name="btnTest" Content="{Binding SelectedCountry.Name, Mode=TwoWay}">
    <Button.Flyout>
        <ListPickerFlyout ItemsSource="{Binding Countries}" 
                          Placement="Full" 
                          SelectedValue="{Binding SelectedCountry, Mode=TwoWay}" 
                          DisplayMemberPath="Name"/>
    </Button.Flyout>
</Button>

Upvotes: 7

Related Questions