fixes the account chooser page state
This commit is contained in:
parent
8ac1a62512
commit
03209200af
2 changed files with 9 additions and 22 deletions
|
|
@ -14,6 +14,7 @@
|
|||
<ListView x:Name="AccountListView"
|
||||
SeparatorVisibility="Default"
|
||||
VerticalOptions="FillAndExpand"
|
||||
ItemsSource="{x:Static local:MainSettings.AccountList}"
|
||||
>
|
||||
<ListView.Header>
|
||||
<StackLayout Orientation="Horizontal">
|
||||
|
|
|
|||
|
|
@ -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<User> Accounts { get; private set; }
|
||||
public Dictionary<string, double> Musical { get; private set; }
|
||||
public Dictionary<string, double> 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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue