Browse Source

added a toolbar and an open button...only working on pdf files. need to try it on Macs

master
gene 2 years ago
parent
commit
5fe99bfe98
  1. 2
      CDPShared/CircleAPIHelper.cs
  2. 23
      CircleViewerMaui/AppShell.xaml
  3. 24
      CircleViewerMaui/MainPage.xaml

2
CDPShared/CircleAPIHelper.cs

@ -33,7 +33,7 @@ namespace CDPShared
public CircleAPIHelper(string customerCode, string appKey, string endUserId, string secret) public CircleAPIHelper(string customerCode, string appKey, string endUserId, string secret)
{ {
_api = new CircleApi(); // to use CircleAPI, you need RESTSharp v105.0.0
_api = new CircleApi(); // to use CircleAPI, you need RESTSharp v106.15.0
_customerCode = customerCode; _customerCode = customerCode;
_appKey = appKey; _appKey = appKey;
_endUserId = endUserId; _endUserId = endUserId;

23
CircleViewerMaui/AppShell.xaml

@ -4,16 +4,21 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:CircleViewerMaui" xmlns:local="clr-namespace:CircleViewerMaui"
Shell.FlyoutBehavior="Disabled">
<TabBar>
<ShellContent
Title="PDF"
Shell.FlyoutBehavior="Flyout">
<ShellContent
Title="Viewer"
ContentTemplate="{DataTemplate local:MainPage}" ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" /> Route="MainPage" />
<ShellContent
Title="User Groups"
ContentTemplate="{DataTemplate local:UserGroups}"
Route="UserGroups" />
</TabBar>
<ShellContent
Title="User Groups"
ContentTemplate="{DataTemplate local:UserGroups}"
Route="UserGroups" />
<ShellContent
Title="Activity"
ContentTemplate="{DataTemplate local:UserGroups}"
Route="UserGroups" />
</Shell> </Shell>

24
CircleViewerMaui/MainPage.xaml

@ -5,7 +5,27 @@
x:Class="CircleViewerMaui.MainPage"> x:Class="CircleViewerMaui.MainPage">
<ContentPage.Content> <ContentPage.Content>
<pdfViewer:SfPdfViewer x:Name="PdfViewer" VerticalOptions="Fill">
</pdfViewer:SfPdfViewer>
<Grid x:Name="mainGrid">
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<AbsoluteLayout>
<Grid x:Name="toolbar" Grid.Row="0" BackgroundColor="#E9E9E9" HorizontalOptions="Fill" VerticalOptions="Fill">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="0.4*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Button x:Name="openButton" Grid.Column="3" BackgroundColor="Yellow" TextColor="Black" Text="Open" HorizontalOptions="Center" VerticalOptions="Center" Clicked="onOpenClicked"/>
</Grid>
</AbsoluteLayout>
<Grid x:Name="pdfViewGrid" Grid.Row="1">
<pdfViewer:SfPdfViewer x:Name="PdfViewer" VerticalOptions="Fill">
</pdfViewer:SfPdfViewer>
</Grid>
</Grid>
</ContentPage.Content> </ContentPage.Content>
</ContentPage> </ContentPage>
Loading…
Cancel
Save