From e032a66048bebf59664b1d494fb09f5b3cb68e45 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 22 Dec 2016 19:35:29 +0100 Subject: [PATCH] fixes the account chooser page state --- .../Pages/UserProfile/AccountChooserPage.xaml | 1 + .../UserProfile/AccountChooserPage.xaml.cs | 30 +++++-------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/BookAStar/BookAStar/Pages/UserProfile/AccountChooserPage.xaml b/BookAStar/BookAStar/Pages/UserProfile/AccountChooserPage.xaml index e405395f..93785c6c 100644 --- a/BookAStar/BookAStar/Pages/UserProfile/AccountChooserPage.xaml +++ b/BookAStar/BookAStar/Pages/UserProfile/AccountChooserPage.xaml @@ -14,6 +14,7 @@ diff --git a/BookAStar/BookAStar/Pages/UserProfile/AccountChooserPage.xaml.cs b/BookAStar/BookAStar/Pages/UserProfile/AccountChooserPage.xaml.cs index 01bc58ca..fdc5cbfb 100644 --- a/BookAStar/BookAStar/Pages/UserProfile/AccountChooserPage.xaml.cs +++ b/BookAStar/BookAStar/Pages/UserProfile/AccountChooserPage.xaml.cs @@ -14,37 +14,24 @@ namespace BookAStar.Pages.UserProfile public partial class AccountChooserPage : ContentPage { - public ICommand RemoteSettingsRefreshCommand { get; private set; } - + public AccountChooserPage () { InitializeComponent (); - AccountListView.ItemsSource = MainSettings.AccountList; - - this.Musical = MainSettings.Musical; - this.Environ = MainSettings.Environ; - this.BindingContext = this; - AddAccountBtn.Clicked += AddAccountBtn_Clicked; - // avatarImage. //RemoveAccountBouton.Clicked += RemoveAccountBouton_Clicked; AccountListView.ItemSelected += Accounts_ItemSelected; - DumpParam = new RelayGesture((g, x) => - { - if (g.GestureType == GestureType.Swipe && g.Direction == Directionality.Left) - { - RemoveAccount(); - } - }); + // MainSettings.UserChanged += MainSettings_UserChanged; + } + // Should be useless + private void MainSettings_UserChanged(object sender, EventArgs e) + { + AccountListView.SelectedItem = MainSettings.CurrentUser; + throw new NotImplementedException(); } - - public RelayGesture DumpParam { get; set; } - public ObservableCollection Accounts { get; private set; } - public Dictionary Musical { get; private set; } - public Dictionary Environ { get; private set; } private void Accounts_ItemSelected(object sender, SelectedItemChangedEventArgs e) { @@ -68,7 +55,6 @@ namespace BookAStar.Pages.UserProfile protected override void OnAppearing() { base.OnAppearing(); - AccountListView.SelectedItem = MainSettings.CurrentUser; } private void AddAccountBtn_Clicked(object sender, EventArgs e)