locked
C# to VB Conversion RRS feed

  • Question

  • I used source conversion tool to convert the following statment:

    this.collectionView = CollectionViewSource.GetDefaultView(this.persons);

    and I got the following result:

    Me.collectionView = CollectionViewSource.GetDefaultView(Me.persons)

    however the editor shows the following error message:

    "GetDefaultView is not a member of System.Windows.Data.CollectionViewSource"

    Can someone help me to correct the error?  Thanks

    Sunday, November 14, 2010 3:16 PM

Answers

  • Hi DeepZone1,

    your Code-Conversion is correct. But you missed one point:

    The static GetDefaultView-Method of the CollectionViewSource-class is only available in WPF. It's not available in Silverlight. So i think you've converted WPF-code and used it in a Silverlight-Project. I'm sure you have. :-)

    Sunday, November 14, 2010 5:06 PM

All replies

  • Hi DeepZone1,

    your Code-Conversion is correct. But you missed one point:

    The static GetDefaultView-Method of the CollectionViewSource-class is only available in WPF. It's not available in Silverlight. So i think you've converted WPF-code and used it in a Silverlight-Project. I'm sure you have. :-)

    Sunday, November 14, 2010 5:06 PM
  • Yup, so what do I use in silverlight project?

    Sunday, November 14, 2010 7:34 PM