bitwarden-android/src/App/Pages/Settings/SettingsPage.xaml.cs
2019-05-15 12:54:48 -04:00

57 lines
1.5 KiB
C#

using Bit.App.Resources;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Bit.App.Pages
{
public partial class SettingsPage : BaseContentPage
{
private SettingsPageViewModel _vm;
public SettingsPage()
{
InitializeComponent();
_vm = BindingContext as SettingsPageViewModel;
_vm.Page = this;
}
private async void RowSelected(object sender, SelectedItemChangedEventArgs e)
{
((ListView)sender).SelectedItem = null;
if(!DoOnce())
{
return;
}
if(!(e.SelectedItem is SettingsPageListItem item))
{
return;
}
if(item.Name == AppResources.Sync)
{
await Navigation.PushModalAsync(new NavigationPage(new SyncPage()));
}
else if(item.Name == AppResources.Folders)
{
await Navigation.PushModalAsync(new NavigationPage(new FoldersPage()));
}
else if(item.Name == AppResources.About)
{
await _vm.AboutAsync();
}
else if(item.Name == AppResources.HelpAndFeedback)
{
_vm.Help();
}
else if(item.Name == AppResources.FingerprintPhrase)
{
await _vm.FingerprintAsync();
}
}
}
}