XAML ComboBox Bind to Method

Posted by griegs on Stack Overflow See other posts from Stack Overflow or by griegs
Published on 2010-05-03T03:31:47Z Indexed on 2010/05/03 3:38 UTC
Read the original article Hit count: 497

Filed under:
|

If I have a method in my C#;

    public CollectionView Months
    {
        get 
        {
            CollectionView retList = new Enumerations.Months().ToCollectionView<Enumerations.Months>();
            return retList;
        }
    }

And I have a ComboBox;

<ComboBox x:Name="ddlMonth" Grid.Row="3" Grid.Column="1" 
ItemsSource="{Binding Source={StaticResource Months}}"/>

How can I bind my ComboBox to my method?

I should add I'm a complete xaml newbie.

© Stack Overflow or respective owner

Related posts about xaml

Related posts about binding