diff --git a/CircleViewerMaui/App.xaml.cs b/CircleViewerMaui/App.xaml.cs
index 1d0e732..3f7204b 100644
--- a/CircleViewerMaui/App.xaml.cs
+++ b/CircleViewerMaui/App.xaml.cs
@@ -1,7 +1,12 @@
-namespace CircleViewerMaui;
+using CDPShared;
+
+namespace CircleViewerMaui;
public partial class App : Application
{
+ private static CDPWorker _cdp;
+ public static CDPWorker CDP =>_cdp;
+
private string syncFusionLicenseKey = "MTg3MzUyM0AzMjMxMmUzMTJlMzQzMVhOUDNaUUxSMUExWTB3a1EzK294VjhKcGh3eENlanRIdXR2aWVrSGZUVTg9";
public App()
{
@@ -9,7 +14,7 @@ public partial class App : Application
//Register SyncFusion license
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(syncFusionLicenseKey);
-
+ _cdp = new CDPWorker();
InitializeComponent();
MainPage = new AppShell();
diff --git a/CircleViewerMaui/AppShell.xaml b/CircleViewerMaui/AppShell.xaml
index 183d753..9955416 100644
--- a/CircleViewerMaui/AppShell.xaml
+++ b/CircleViewerMaui/AppShell.xaml
@@ -5,9 +5,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:CircleViewerMaui"
Shell.FlyoutBehavior="Disabled">
-
-
+
+
+
+
diff --git a/CircleViewerMaui/CircleViewerMaui.csproj b/CircleViewerMaui/CircleViewerMaui.csproj
index e70390a..2afb6a2 100644
--- a/CircleViewerMaui/CircleViewerMaui.csproj
+++ b/CircleViewerMaui/CircleViewerMaui.csproj
@@ -64,4 +64,16 @@
+
+
+ UserGroups.xaml
+
+
+
+
+
+ MSBuild:Compile
+
+
+
diff --git a/CircleViewerMaui/MainPage.xaml b/CircleViewerMaui/MainPage.xaml
index 6fb6c19..7e9ab4e 100644
--- a/CircleViewerMaui/MainPage.xaml
+++ b/CircleViewerMaui/MainPage.xaml
@@ -4,11 +4,6 @@
xmlns:pdfViewer="http://schemas.syncfusion.com/maui"
x:Class="CircleViewerMaui.MainPage">
-
-
-
-
-
diff --git a/CircleViewerMaui/MainPage.xaml.cs b/CircleViewerMaui/MainPage.xaml.cs
index 57dd870..6b8841a 100644
--- a/CircleViewerMaui/MainPage.xaml.cs
+++ b/CircleViewerMaui/MainPage.xaml.cs
@@ -7,7 +7,7 @@ namespace CircleViewerMaui;
public partial class MainPage : ContentPage
{
int count = 0;
- private CDPWorker _cdp;
+// private CDPWorker _cdp;
Timer _timer;
Boolean _bConnected = false;
@@ -15,18 +15,16 @@ public partial class MainPage : ContentPage
{
using (LogMethod.Log(MethodBase.GetCurrentMethod().ReflectedType.Name))
{
- _cdp = new CDPWorker();
InitializeComponent();
_timer = new Timer(IsReady, null, 250, 250);
-
}
}
void IsReady(object state)
{
- if (_bConnected != _cdp.Ready)
+ if (_bConnected != App.CDP.Ready)
{
- _bConnected = _cdp.Ready;
+ _bConnected = App.CDP.Ready;
OnReady();
_timer = null;
}
@@ -76,7 +74,7 @@ public partial class MainPage : ContentPage
{
using (LogMethod.Log(MethodBase.GetCurrentMethod().ReflectedType.Name))
{
- var result = await _cdp.Decrypt(fileToLoad);
+ var result = await App.CDP.Decrypt(fileToLoad);
if (result.Status.Result.GetValueOrDefault(false))
{
byte[] buf = Convert.FromBase64String(result.DecryptedData);
diff --git a/CircleViewerMaui/UserGroups.xaml b/CircleViewerMaui/UserGroups.xaml
new file mode 100644
index 0000000..3a4493d
--- /dev/null
+++ b/CircleViewerMaui/UserGroups.xaml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CircleViewerMaui/UserGroups.xaml.cs b/CircleViewerMaui/UserGroups.xaml.cs
new file mode 100644
index 0000000..3cff98f
--- /dev/null
+++ b/CircleViewerMaui/UserGroups.xaml.cs
@@ -0,0 +1,41 @@
+using CircleSDK.Model;
+using CommunityToolkit.Maui.Alerts;
+using CommunityToolkit.Maui.Core;
+
+namespace CircleViewerMaui
+{
+ public partial class UserGroups : ContentPage
+ {
+ public List Circles;
+ public UserGroups()
+ {
+ InitializeComponent();
+ Circles = new List(App.CDP.Circles);
+// Circles = App.CDP.Circles;
+// lvCircles.ItemsSource = App.CDP.Circles;
+ circlePicker.ItemsSource = App.CDP.Circles;
+ circlePicker.ItemDisplayBinding = new Binding("CircleName");
+ }
+
+ private async void BnRequestVerfication_OnClicked(object sender, EventArgs e)
+ {
+ var reply = await App.CDP.ProcessInvite(RequestCode.Text, VerificationCode.Text);
+ if (reply.Status.Result.GetValueOrDefault(false))
+ {
+ ShowToast("Failed to process request.");
+ }
+ else
+ {
+ ShowToast("Request has be submitted.");
+ }
+ }
+ async void ShowToast(string text)
+ {
+ CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
+ ToastDuration duration = ToastDuration.Short;
+ double fontSize = 14;
+ var toast = Toast.Make(text, duration, fontSize);
+ await toast.Show(cancellationTokenSource.Token);
+ }
+ }
+}