public MainPage() { InitializeComponent(); BackgroundAudioPlayer.Instance.PlayStateChanged += new EventHandler(Instance_PlayStateChanged); timer = new DispatcherTimer(); timer.Interval = new TimeSpan(0, 0, 1); timer.Tick += new EventHandler(timer_Tick); // delay starting the timer until we get the first response so we don't get multiple // error boxes if there's no internet connection //timer.Start(); _requestHelper = new PlaylistRequestHelper(); _requestHelper.RequestCompleted += new RequestCompletedHandler(requestHelper_RequestCompleted); _requestHelper.GetUpdatedPlaylist(); _viewModel = new PlaylistViewModel(); _viewModel.LoadDataCommand.Execute(null); this.DataContext = _viewModel; }