Exemple #1
0
 public MainWindow(SpotifyViewModel model)
 {
     this.model = model;
     InitializeComponent();
     DataContext = model;
     model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(model_PropertyChanged);
 }
Exemple #2
0
 public App()
     : base()
 {
     model = SpotifyViewModel.Instance;
     client = new ServiceReference.SpotifyClient(new InstanceContext(model));
     MainWindow = new MainWindow(model);
     AuthenticationStatus ok = AuthenticationStatus.Bad;
     try { ok = client.Authenticate(""); }
     catch { throw; }
     if (ok == AuthenticationStatus.Bad)
         Shutdown();
     else if (ok == AuthenticationStatus.RequireLogin)
     {
         bool loggedIn = false;
         while (!loggedIn)
         {
             SpotifyLogin login = new SpotifyLogin();
             login.ShowDialog();
             if (login.Username.Text != "")
                 loggedIn = client.Login(login.Username.Text, login.Password.Password);
         }
     }
     model.Client = client;
     MainWindow.Show();
     MainWindow.Closed += new EventHandler(MainWindow_Closed);
 }
 public PlayPauseCommand(SpotifyViewModel model)
 {
     this.model = model;
     this.model.PropertyChanged += new PropertyChangedEventHandler(model_PropertyChanged);
 }
 static SpotifyViewModel()
 {
     viewModel = new SpotifyViewModel();
 }
Exemple #5
0
 static SpotifyViewModel()
 {
     viewModel = new SpotifyViewModel();
 }