1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-06-26 10:36:21 +02:00
bitwarden-mobile/src/App/Pages/Vault/SharePage.xaml.cs

57 lines
1.5 KiB
C#

using Xamarin.Forms;
using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
namespace Bit.App.Pages
{
public partial class SharePage : BaseContentPage
{
private SharePageViewModel _vm;
public SharePage(string cipherId)
{
InitializeComponent();
_vm = BindingContext as SharePageViewModel;
_vm.Page = this;
_vm.CipherId = cipherId;
SetActivityIndicator();
if (Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
else
{
_organizationPicker.On<iOS>().SetUpdateMode(UpdateMode.WhenFinished);
}
_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)
{
if (DoOnce())
{
await _vm.SubmitAsync();
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if (DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}