Im trying to convert my WPF project to Silverlight. The WPF project was written in MVVM template. it doesnt connect to any database, ive used an XML serializer to create and read from XML file.
But somehow the application crashes. I think it maybe the App.Xaml. But I am unable to debug the silverlight application, as it gives an error “The breakpoint will not currently be hit., no symbols have been loaded for this document”….
Not too sure where to go from here…
private void Application_Startup(object sender, StartupEventArgs e)
{
Views.MainPage view = new Views.MainPage();
ViewModels.MainPageViewModel mainViewModel = new ViewModels.MainPageViewModel();
mainViewModel.LoadProducts("Products.xml");
view.DataContext = mainViewModel;
this.RootVisual = view;
}
I’m not sure whether this is the problem or not, but you mentioned that your WPF application read from an XML file. Where is this XML file located? Silverlight is going to have some limitations on what it can access if it is being run in-browser, and may not be able to read the file if the
LoadProductsmethod tries to read it from disk.