locked
Using Expression Sample Data in Visual Studio RRS feed

  • Question

  • Hi all,

    I created a Sketch project that I've converted into a production version and I'm now coding in Visual Studio.   For the time being, I'd still like to use the sample data that Blend generated.  I can see the sample data in my VS project under MyProject/SampleData/SampleDataSource/SampleData.xaml.

    I have a data grid that is bound to the sample data.  What I can't figure out is how to create an object to hold the selecteditem in my datagrid_selectionchanged event.

    private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)

    {

    ????? = DataGrid.SelectedItem as ?????;

     }

     

    }

     


     

    Sunday, September 13, 2009 2:48 PM

All replies

  • The sample data system, as the name indicates, is not designed for you to code against the objects that we generate. That said, there is nothing that prevents you from doing so - if you were to open the SampleData.xaml.cs file, you will see all the objects that we generate behind the covers - so you could use one of those types in here. Just note that if you were to disable sample data from your running application, you will need to figure out a way to remove such dependencies that you might take in your code.

    Thanks,
    Unni


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, September 14, 2009 6:12 AM