2019-04-10 06:24:03 +03:00
|
|
|
|
using Bit.App.Models;
|
|
|
|
|
using Bit.App.Pages;
|
2019-03-30 04:23:34 +03:00
|
|
|
|
using Bit.App.Utilities;
|
2019-03-29 00:10:10 +03:00
|
|
|
|
using System;
|
2019-03-30 00:54:03 +03:00
|
|
|
|
using System.Reflection;
|
2019-03-28 03:12:44 +03:00
|
|
|
|
using Xamarin.Forms;
|
2019-03-30 00:54:03 +03:00
|
|
|
|
using Xamarin.Forms.StyleSheets;
|
2019-03-28 03:12:44 +03:00
|
|
|
|
using Xamarin.Forms.Xaml;
|
|
|
|
|
|
|
|
|
|
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
|
|
|
|
|
namespace Bit.App
|
|
|
|
|
{
|
|
|
|
|
public partial class App : Application
|
|
|
|
|
{
|
|
|
|
|
public App()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2019-03-30 00:54:03 +03:00
|
|
|
|
|
2019-04-05 20:35:19 +03:00
|
|
|
|
ThemeManager.SetTheme("light");
|
2019-03-29 06:52:33 +03:00
|
|
|
|
MainPage = new TabsPage();
|
2019-04-10 06:24:03 +03:00
|
|
|
|
|
|
|
|
|
MessagingCenter.Subscribe<Application, DialogDetails>(Current, "ShowDialog", async (sender, details) =>
|
|
|
|
|
{
|
|
|
|
|
var confirmed = true;
|
|
|
|
|
// TODO: ok text
|
|
|
|
|
var confirmText = string.IsNullOrWhiteSpace(details.ConfirmText) ? "Ok" : details.ConfirmText;
|
|
|
|
|
if(!string.IsNullOrWhiteSpace(details.CancelText))
|
|
|
|
|
{
|
|
|
|
|
confirmed = await MainPage.DisplayAlert(details.Title, details.Text, confirmText,
|
|
|
|
|
details.CancelText);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
await MainPage.DisplayAlert(details.Title, details.Text, details.ConfirmText);
|
|
|
|
|
}
|
|
|
|
|
MessagingCenter.Send(Current, "ShowDialogResolve", new Tuple<int, bool>(details.DialogId, confirmed));
|
|
|
|
|
});
|
2019-03-28 03:12:44 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnStart()
|
|
|
|
|
{
|
|
|
|
|
// Handle when your app starts
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnSleep()
|
|
|
|
|
{
|
|
|
|
|
// Handle when your app sleeps
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnResume()
|
|
|
|
|
{
|
|
|
|
|
// Handle when your app resumes
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|