private void ShowSettings(Objects.UIService service) { _service = service; _featuresPanel = new Popups.UIFeatures(_service.Service, false); _featuresPanel.Unsubscribe.Click += Unsubscribe_Click; _featuresPanel.SaveServiceSettings.Click += SaveServiceSettings_Click; UIController.ShowPanel(_featuresPanel); }
private void Unsubscribe_Click(object sender, RoutedEventArgs e) { MessageBoxResult result = MessageBox.Show("Are you sure you want to unsubscribe?", "Unsubscribing", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { _service.Unsubscribe(); UIController.HidePanel(_featuresPanel); _service = null; _featuresPanel = null; } }
private void SaveServiceSettings_Click(object sender, RoutedEventArgs e) { UIController.Proxy.UpdateChosenFeatures( UIController.MyProfile.Username, UIController.Password, _service.Service.Id, _featuresPanel.ChosenFeatures().ToArray()); if (String.IsNullOrEmpty(UIController.MyProfile.Avatar) && _featuresPanel.ChosenFeatures().Contains("Avatar")) { Uri[] avatarsUri = UIController.Proxy.GetAvailableAvatars(UIController.MyProfile.Username, UIController.Password); if (avatarsUri.Length > 0) { Uri uri = avatarsUri[0]; if (UIController.Proxy.SaveAvatar(UIController.MyProfile.Username, UIController.Password, uri)) { UIController.ChangeProfileButtonImage(uri); Avatar.InternalImage.Source = new BitmapImage(uri); } } } UIController.HidePanel(_featuresPanel); _service = null; _featuresPanel = null; }