Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

ComboBox Binding to DataClass

Closed Thread
 
Thread Tools Display Modes
Old 03-01-2007   #1 (permalink)
Horst Klein
Guest


 

ComboBox Binding to DataClass

I use a custom LoginCommandData Class to initalize a LoginDialog.

Public Class LoginCommandData
Inherits DependencyObject
Implements ComponentModel.INotifyPropertyChanged

Private m_Mandators As IList
Private m_Mandator As Common.Data.Mandator

Public Property Mandators() As IList
Get
Return m_Mandators
End Get
Set(ByVal value As IList)
Dim oldValue As IList = m_Mandators
m_Mandators = value
OnCommandDataPropertyChanged(New
ComponentModel.PropertyChangedEventArgs("Mandators"))
End Set
End Property

Public Property Mandator() As Vito64.Common.Data.Mandator
Get
Return m_Mandator
End Get
Set(ByVal value As Vito64.Common.Data.Mandator)
Dim oldValue As Vito64.Common.Data.Mandator = m_Mandator
m_Mandator = value
If Not Equals(oldValue, m_Mandators) Then
OnCommandDataPropertyChanged(New
ComponentModel.PropertyChangedEventArgs("Mandator"))
End If
End Set
End Property



The Login-Xaml

<Window.Resources>
<VFC:LoginCommandData x:Key="LoginData" Password="MyPasswordBox" />
</Window.Resources>


<Grid x:Name="MyGrid" DataContext="{StaticResource LoginData}">
<Label Content="Mandant" x:Name="LabelMandant" Height="23"/>
<ComboBox Margin="206,143,82,126" IsSynchronizedWithCurrentItem="True"
x:Name="ComboBoxMandator"
DisplayMemberPath="Name" SelectedValuePath="Id"
ItemsSource="{Binding Path=Mandators}"
SelectedValue="{Binding Path=Mandator,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}">
</ComboBox>
</Grid>

All I want is that the "Mantator" Property will be set, if it is selected in
the ComboBox
But it dosn't work.

Who can tell me why?

Old 03-01-2007   #2 (permalink)
Horst Klein
Guest


 

RE: ComboBox Binding to DataClass

Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding Problem in ComboBox Horst Klein Avalon 0 09-13-2007 02:50 AM
WPF ListView data binding with embedded ComboBox Krish_xx Avalon 1 06-01-2007 07:28 AM
WPF binding error when databinding a ComboBox inside a ListView it jeff.townes Avalon 0 05-01-2007 11:05 AM
Two-way binding doesn't work with ComboBox.Text? Keith Patrick Avalon 0 11-02-2006 06:20 PM
Binding a ComboBox to in internal property Keith Patrick Avalon 4 10-04-2006 08:40 AM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50