mirror of
https://github.com/Sarsoo/IF.Lastfm.git
synced 2024-10-17 07:13:09 +01:00
46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
using System;
|
|
using Cimbalino.Phone.Toolkit.Services;
|
|
using Microsoft.Phone.Controls;
|
|
|
|
namespace IF.Lastfm.Demo.Apollo
|
|
{
|
|
public partial class MainPage : PhoneApplicationPage
|
|
{
|
|
// Constructor
|
|
public MainPage()
|
|
{
|
|
InitializeComponent();
|
|
|
|
MultiApplicationBar.SelectedIndex = 0;
|
|
|
|
var service = new ApplicationSettingsService();
|
|
|
|
if (service.Get<string>("apikey") == string.Empty)
|
|
{
|
|
ApiKey.Text = "a6ab4b9376e54cdb06912bfbd9c1f288";
|
|
ApiSecret.Text = "3aa7202fd1bc6d5a7ac733246cbccc4b";
|
|
}
|
|
else
|
|
{
|
|
ApiKey.Text = service.Get<string>("apikey");
|
|
ApiSecret.Text = service.Get<string>("apisecret");
|
|
Username.Text = service.Get<string>("username");
|
|
Password.Text = service.Get<string>("pass");
|
|
}
|
|
}
|
|
|
|
private void OnDoneClick(object sender, EventArgs e)
|
|
{
|
|
var service = new ApplicationSettingsService();
|
|
|
|
service.Set("apikey", ApiKey.Text);
|
|
service.Set("apisecret", ApiSecret.Text);
|
|
service.Set("username", Username.Text);
|
|
service.Set("pass", Password.Text);
|
|
|
|
service.Save();
|
|
|
|
NavigationService.Navigate(new Uri("/ApiTest.xaml", UriKind.Relative));
|
|
}
|
|
}
|
|
} |