Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Using IronPython for a Data Source
posted

Hi,

we are using Silverlight with IronPython, so we generate the data with python.

Is it possible to create a data source with IronPython?

The main problem seems to implement the IEnumerable interface in python.


Parents
No Data
Reply
  • 2050
    Offline posted

    Hi,

    I'm not an expert on IronPython, so you will have to verify if this would work for you.

    According to the IronPython documentation when you interact with .NET and the .NET method expects a different type of data than the one Python provides, automatic conversion will occur. The conversion will be successful when the two types are compatible. Again according to the docs IEnumerable<T> corresponds to a tuple with only elements with type T.

    So my guess is that you have to create a DataSource just as you would in a normal SIlverlight application, but at the point where you have to set the ItemsSource to an IEnumerable you will have to set it to a tuple of elements with unanimous type that comes from Python.

    I hope this is useful.

    All the best,
    Atanas

Children