本文介绍了如何将SelectedItem绑定到ListView.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在使用ListView,并且我想绑定SelectedItem Defualt,但它无法正常工作,我的XAML就是这样
I am working with ListView and I want to Bind SelectedItem Defualt but it will not working my XAML is like this
<ListView x:Name="MenuBarList" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Height="{Binding MainMenuHeight}" Width="{Binding MainMenuWidth}" ItemsSource="{Binding}" SelectedItem="{Binding Path=SelectedMainMenuOption, Mode=TwoWay}" Foreground="White" Background="#FF3D61D0" SelectionMode="Single">因此,SelectedMainMenuOption是Property,但是它不起作用,是否有任何解决方法,所以我可以非常感谢您..
so the SelectedMainMenuOption is the Property but it is not working is there any workaround so I can goahead thank you very much..
推荐答案
u需要设置 SelectedMainMenuOption 是
u need to set theSelectedMainMenuOption property to the one of the possible values in the
itemsource
itemsource
请放下代码以更好地理解该问题.
更多推荐
如何将SelectedItem绑定到ListView.
发布评论