문제

I am using cinch framework v1. I have exposed a public property ( CurrentSuppier )and binded that property to the selecteditem of my combo box .. after I update the , the combobox display doesn't change to the current value of the supplier .. below is some code snippets..

/// <summary>
    /// Current Supplier Record
    /// </summary>
    static PropertyChangedEventArgs currentsupplierChangeArgs =
        ObservableHelper.CreateArgs<IncomingViewModel>(x => x.CurrentSupplier);

    public SupplierModel  CurrentSupplier
    {
        get { return currentsupplier ; }
        set
        {
            currentsupplier = value;

            NotifyPropertyChanged(currentsupplierChangeArgs);

        }
    }

XAML CODE:

  <ComboBox Margin="345,8,542,0" Name="cbosupplier" Height="23" VerticalAlignment="Top" 
          VerticalContentAlignment="Center"
          ItemTemplate="{StaticResource SupplierTemplate}" 
          ItemsSource="{Binding Path=ListofSupplier}"     
          Grid.ColumnSpan="3" Grid.RowSpan="2"
          SelectedItem="{Binding Path=CurrentSupplier ,Mode = TwoWay}"  

I tried binding the CurrentSupplier to a TextBox just to see if the binds works .. and it does .. the textbox gets updated with the current value of my CurrentSupplier property .. but it wont work on the combobox ..

올바른 솔루션이 없습니다

다른 팁

There is a difference between SelectedItem and SelectedValue.

Have you tried to use SelectedValue instead?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top