mirror of
https://github.com/Sarsoo/IF.Lastfm.git
synced 2024-10-17 15:23:08 +01:00
48cdea2aea
Also updated demo app.
59 lines
1.6 KiB
C#
59 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Navigation;
|
|
using IF.Lastfm.Demo.Apollo.TestPages.ViewModels;
|
|
using Microsoft.Phone.Controls;
|
|
using Microsoft.Phone.Shell;
|
|
|
|
namespace IF.Lastfm.Demo.Apollo.TestPages
|
|
{
|
|
public partial class Scrobbling : PhoneApplicationPage
|
|
{
|
|
private ScrobblingTestViewModel _viewModel;
|
|
|
|
public Scrobbling()
|
|
{
|
|
_viewModel = new ScrobblingTestViewModel();
|
|
|
|
DataContext = _viewModel;
|
|
|
|
InitializeComponent();
|
|
|
|
MultiApplicationBar.SelectedIndex = 0;
|
|
|
|
_viewModel.PropertyChanged += OnViewModelPropertyChanged;
|
|
}
|
|
|
|
private void OnViewModelPropertyChanged(object sender, PropertyChangedEventArgs e)
|
|
{
|
|
if (e.PropertyName == "InProgress")
|
|
{
|
|
if (_viewModel.InProgress)
|
|
{
|
|
SystemTray.ProgressIndicator = new ProgressIndicator
|
|
{
|
|
IsVisible = _viewModel.InProgress,
|
|
IsIndeterminate = _viewModel.InProgress
|
|
};
|
|
}
|
|
else
|
|
{
|
|
SystemTray.ProgressIndicator = null;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void OnDoneClick(object sender, EventArgs e)
|
|
{
|
|
if (!_viewModel.InProgress)
|
|
{
|
|
_viewModel.Scrobble().AsAsyncAction();
|
|
}
|
|
}
|
|
}
|
|
} |