Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Thu, 1 Mar 2007 05:24:12 -0800,    group: microsoft.public.windows.developer.winfx.avalon        back       


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?
date: Thu, 1 Mar 2007 05:24:12 -0800   author:   Horst Klein

RE: ComboBox Binding to DataClass   
Solved! Read here:
http://forums.microsoft.com/MSDN/showpost.aspx?postid=1288772&siteid=1

Horst
date: Thu, 1 Mar 2007 07:46:11 -0800   author:   Horst Klein

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us