2019-05-14 18:05:30 +02:00
|
|
|
|
using System;
|
2019-06-12 03:31:51 +02:00
|
|
|
|
using Xamarin.Forms;
|
2019-05-14 18:05:30 +02:00
|
|
|
|
|
|
|
|
|
namespace Bit.App.Pages
|
|
|
|
|
{
|
|
|
|
|
public partial class SyncPage : BaseContentPage
|
|
|
|
|
{
|
|
|
|
|
private readonly SyncPageViewModel _vm;
|
|
|
|
|
|
|
|
|
|
public SyncPage()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
_vm = BindingContext as SyncPageViewModel;
|
|
|
|
|
_vm.Page = this;
|
2020-03-28 14:16:28 +01:00
|
|
|
|
if (Device.RuntimePlatform == Device.Android)
|
2019-06-12 03:31:51 +02:00
|
|
|
|
{
|
|
|
|
|
ToolbarItems.RemoveAt(0);
|
|
|
|
|
}
|
2019-05-14 18:05:30 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-05-14 22:36:54 +02:00
|
|
|
|
protected async override void OnAppearing()
|
|
|
|
|
{
|
|
|
|
|
base.OnAppearing();
|
2020-08-05 19:19:27 +02:00
|
|
|
|
await _vm.InitAsync();
|
2019-05-14 22:36:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-05-14 18:05:30 +02:00
|
|
|
|
private async void Sync_Clicked(object sender, EventArgs e)
|
|
|
|
|
{
|
2020-03-28 14:16:28 +01:00
|
|
|
|
if (DoOnce())
|
2019-05-14 18:05:30 +02:00
|
|
|
|
{
|
|
|
|
|
await _vm.SyncAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-06-12 03:31:51 +02:00
|
|
|
|
|
|
|
|
|
private async void Close_Clicked(object sender, System.EventArgs e)
|
|
|
|
|
{
|
2020-03-28 14:16:28 +01:00
|
|
|
|
if (DoOnce())
|
2019-06-12 03:31:51 +02:00
|
|
|
|
{
|
|
|
|
|
await Navigation.PopModalAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-05-14 18:05:30 +02:00
|
|
|
|
}
|
|
|
|
|
}
|