Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用MVVM在windows phone 8.1中使用ListPickerLyout_C#_Xaml_Windows Phone_Mvvm Light - Fatal编程技术网

C# 如何使用MVVM在windows phone 8.1中使用ListPickerLyout

C# 如何使用MVVM在windows phone 8.1中使用ListPickerLyout,c#,xaml,windows-phone,mvvm-light,C#,Xaml,Windows Phone,Mvvm Light,我正在寻找如何在MVVM Light中使用windows phone 8.1中的listpickerflyout的示例。我的要求是向用户显示一个列表,例如国家列表,用户可以在其中选择一个国家。并显示所选国家。得到了解决方案:)只需添加按钮,然后在xaml中添加ListPickerLyout,并绑定弹出按钮和按钮内容属性的项目源。这里是如何 <Button x:Name="btnTest" Content="{Binding SelectedCountry.Name, Mode=TwoWay

我正在寻找如何在MVVM Light中使用windows phone 8.1中的listpickerflyout的示例。我的要求是向用户显示一个列表,例如国家列表,用户可以在其中选择一个国家。并显示所选国家。

得到了解决方案:)只需添加按钮,然后在xaml中添加ListPickerLyout,并绑定弹出按钮和按钮内容属性的项目源。这里是如何

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