krz
krz

Reputation: 1

Use timer on Windows Phone application

How to create a timer for c# windows phone 7? I already find a timer, but it was for normal c#, and on C# for windows phone we can´t use system.Timers!I want to play the video just from 5000ms.

This is my code:

using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication()) { IsolatedStorageFileStream isoFileStream = myIsolatedStorage.OpenFile("xml_file.xml", FileMode.Open);

            XElement xml = XElement.Load(isoFileStream);

                    foreach (XElement node2 in xml.Element("graphics").Elements("file"))
                    {



                        string url_graficos = node2.Element("fileurl").Value;

                        string[] array = url_graficos.Split('/');
                        string[,] resultadosImage = { { node2.Element("fileurl").Value, node2.Element("playtime").Value, node2.Element("transition").Value } };

                        mediaSound.Play();
                        mediaSound.Stop();

Upvotes: 0

Views: 4276

Answers (1)

Blounty
Blounty

Reputation: 3358

The class you are looking for is a DispatcherTimer. Here is a good tutorial on how to use it.

Hope this helps you.

Upvotes: 3

Related Questions