2019-05-10 20:22:35 +03:00
|
|
|
|
using Xamarin.Forms;
|
2019-06-25 00:32:24 +03:00
|
|
|
|
using Xamarin.Forms.PlatformConfiguration;
|
|
|
|
|
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
|
2019-05-10 20:22:35 +03:00
|
|
|
|
|
|
|
|
|
namespace Bit.App.Pages
|
|
|
|
|
{
|
|
|
|
|
public partial class SharePage : BaseContentPage
|
|
|
|
|
{
|
|
|
|
|
private SharePageViewModel _vm;
|
|
|
|
|
|
2019-05-10 21:28:17 +03:00
|
|
|
|
public SharePage(string cipherId)
|
2019-05-10 20:22:35 +03:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
_vm = BindingContext as SharePageViewModel;
|
|
|
|
|
_vm.Page = this;
|
|
|
|
|
_vm.CipherId = cipherId;
|
|
|
|
|
SetActivityIndicator();
|
2020-03-28 16:16:28 +03:00
|
|
|
|
if (Device.RuntimePlatform == Device.Android)
|
2019-06-12 04:31:51 +03:00
|
|
|
|
{
|
|
|
|
|
ToolbarItems.RemoveAt(0);
|
|
|
|
|
}
|
2019-06-25 00:32:24 +03:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_organizationPicker.On<iOS>().SetUpdateMode(UpdateMode.WhenFinished);
|
|
|
|
|
}
|
2019-05-10 20:22:35 +03:00
|
|
|
|
_organizationPicker.ItemDisplayBinding = new Binding("Key");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override async void OnAppearing()
|
|
|
|
|
{
|
|
|
|
|
base.OnAppearing();
|
|
|
|
|
await LoadOnAppearedAsync(_scrollView, true, () => _vm.LoadAsync());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnDisappearing()
|
|
|
|
|
{
|
|
|
|
|
base.OnDisappearing();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async void Save_Clicked(object sender, System.EventArgs e)
|
|
|
|
|
{
|
2020-03-28 16:16:28 +03:00
|
|
|
|
if (DoOnce())
|
2019-05-10 20:22:35 +03:00
|
|
|
|
{
|
|
|
|
|
await _vm.SubmitAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-06-12 04:31:51 +03:00
|
|
|
|
|
|
|
|
|
private async void Close_Clicked(object sender, System.EventArgs e)
|
|
|
|
|
{
|
2020-03-28 16:16:28 +03:00
|
|
|
|
if (DoOnce())
|
2019-06-12 04:31:51 +03:00
|
|
|
|
{
|
|
|
|
|
await Navigation.PopModalAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-05-10 20:22:35 +03:00
|
|
|
|
}
|
|
|
|
|
}
|