This is an Object as you can see (since my list holds objects). I use a simple Xaml file with some Code Behind, and it all clocks in at some 200 lines of code (including spaces and some comments).
If your List/Combobox/etc contains a list of strings, it'll be a string.
There wasn’t much documentation regarding that which I found that was helpful, so I’ll do another post about that later.
In this post I’ll just cover what I learned about basic data binding, so here is what I needed to do, without all of the Data Template/Grid View bloat Note that in my case, the View Model which the Combo Box needed to get its items from was the Data Context of the page and the Data Context of the Combo Box was the View Model which I needed to bind values to.
However, when I click a button to switch the Object Instance to obj2, the Combo Box Items Source gets populated correctly in the dropdown, but the Selected Value is set to Nothing instead of being equal to obj2. My conclusion is that Selected Value is designed for get operations and not set.
The Combo Box contains the names "Joe" and "Steve" and "Steve" is selected by default. What we found was if you set selectedvalue it would not see the change we had to instead set selecteditem which would properly update every thing.
Add(name) Next _selected Name = default Name End Sub Public Read Only Property My List() As Observable Collection(Of String) Get Return _mylist End Get End Property Public Read Only Property Selected Name() As String Get Return _selected Name End Get End Property End Class Class Window1 Private obj1 As My List Object Private obj2 As My List Object Private odp As Object Data Provider Public Sub New() Initialize Component() Dim namelist1 As New List(Of String) namelist1. Add("Steve") obj1 = New My List Object(namelist1, "Steve") . Find Resource("My List Object"), Object Data Provider) odp. If only one item is contained then Selected Item still does not work! I'm having a similar issue unfortunately as well with Selected Item but in my case my source is updated first before the target when my Mode is Two Way which from what I understand is backwards.
Now, all of that aside, let’s go over the more common properties used in Data Binding to a Selector control.
Now that we’ve got a decent understanding of the common binding properties of a Selector control (I hope! Given the following classes (only class signatures; the full sample project including source code is attached to this post): Note the use of “Mode=One Way” in my Items Source bindings.
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site.
If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.