I'm a novice C # programmer and I'm having trouble playing music in the game using my WPF (Windows) VS 2008. This is a web app do I think that
myMediaElementExample
variable is empty when executing it in the Play
method ExpenseReportPage.xaml.cs
file Is used for This program is created now, but after running it, it encounters an exception to Can any of you suggest me what else to try? I have included only the code related to this problem: ExpenseReportPage.xaml.cs file: Homepage. Xll.cs File: myMediaElementExample.Play (); The line exception says:
WpfApplication1.vhost.exe [9 48] generated an uncontrolled Win32 exception.
Namespace expense {{Public Partial Square ExpenseReportPage: Page {... } Public Partial Category MediaElement Example: Page {MediaElement myMediaElementExample = New MediaElement (); Public Media Illustration Example () {} Public Zero OnMouseDownPlayMedia (Object Sender, RoutedEventArgs args) / MouseButtonEventArgs {// Play system will launch media if it is currently not active or // resumed the media if it is stopped If there is a media already running, then there is no effect. I myMediaElementExample.Play (); }}}
Namespace expense for this {public partial home page: Page {MediaElementExample mediaElementExample = new MediaElementExample (); Public Homepage () {InitializeComponent (); } Zero handclick (Object Sender, Routing Avent ARG E) {button as srcButton = e.Source button; SrcButton.Width = 200; Media Element Example OnMouseDownplayMedia (Sender, E); Enclosing the line for debugging purposes: