Skip to content

Commit 0135b8f

Browse files
Merge pull request #1 from SyncfusionExamples/navigate-using-bottom-sheet
Updated the sample and read me file
2 parents acd3252 + b4c6525 commit 0135b8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+9316
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35521.163 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BottomSheetSample", "BottomSheetSample\BottomSheetSample.csproj", "{38A3BF75-3F37-4DBD-ABD1-A530681C1499}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{38A3BF75-3F37-4DBD-ABD1-A530681C1499}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{38A3BF75-3F37-4DBD-ABD1-A530681C1499}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{38A3BF75-3F37-4DBD-ABD1-A530681C1499}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{38A3BF75-3F37-4DBD-ABD1-A530681C1499}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version = "1.0" encoding = "UTF-8" ?>
2+
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:local="clr-namespace:BottomSheetSample"
5+
x:Class="BottomSheetSample.App">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
10+
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
11+
</ResourceDictionary.MergedDictionaries>
12+
</ResourceDictionary>
13+
</Application.Resources>
14+
</Application>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace BottomSheetSample
2+
{
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
}
9+
10+
protected override Window CreateWindow(IActivationState? activationState)
11+
{
12+
return new Window(new AppShell());
13+
}
14+
}
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<Shell
3+
x:Class="BottomSheetSample.AppShell"
4+
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
6+
xmlns:local="clr-namespace:BottomSheetSample"
7+
Shell.FlyoutBehavior="Flyout"
8+
Title="BottomSheetSample">
9+
10+
<ShellContent
11+
ContentTemplate="{DataTemplate local:MainPage}"
12+
Route="MainPage" />
13+
14+
</Shell>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace BottomSheetSample
2+
{
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
10+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
6+
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
7+
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
8+
9+
<!-- Note for MacCatalyst:
10+
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
11+
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
12+
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
13+
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
14+
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
15+
16+
<OutputType>Exe</OutputType>
17+
<RootNamespace>BottomSheetSample</RootNamespace>
18+
<UseMaui>true</UseMaui>
19+
<SingleProject>true</SingleProject>
20+
<ImplicitUsings>enable</ImplicitUsings>
21+
<Nullable>enable</Nullable>
22+
23+
<!-- Display name -->
24+
<ApplicationTitle>BottomSheetSample</ApplicationTitle>
25+
26+
<!-- App Identifier -->
27+
<ApplicationId>com.companyname.bottomsheetsample</ApplicationId>
28+
29+
<!-- Versions -->
30+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
31+
<ApplicationVersion>1</ApplicationVersion>
32+
33+
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
34+
<WindowsPackageType>None</WindowsPackageType>
35+
36+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
37+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
38+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
39+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
40+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
41+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
42+
</PropertyGroup>
43+
44+
<ItemGroup>
45+
<!-- App Icon -->
46+
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
47+
48+
<!-- Splash Screen -->
49+
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
50+
51+
<!-- Images -->
52+
<MauiImage Include="Resources\Images\*" />
53+
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />
54+
55+
<!-- Custom Fonts -->
56+
<MauiFont Include="Resources\Fonts\*" />
57+
58+
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
59+
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
60+
</ItemGroup>
61+
62+
<ItemGroup>
63+
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.70" />
64+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.5" />
65+
<PackageReference Include="Syncfusion.Maui.ListView" Version="*" />
66+
<PackageReference Include="Syncfusion.Maui.Toolkit" Version="*" />
67+
</ItemGroup>
68+
69+
<ItemGroup>
70+
<MauiXaml Update="FavoritesPage.xaml">
71+
<Generator>MSBuild:Compile</Generator>
72+
</MauiXaml>
73+
</ItemGroup>
74+
75+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:listview="clr-namespace:Syncfusion.Maui.ListView;assembly=Syncfusion.Maui.ListView"
5+
x:Class="BottomSheet.FavoritesPage"
6+
Title="Favorites Page">
7+
<listview:SfListView ItemsSource="{Binding FavoriteBooks}" SelectionMode="None">
8+
<listview:SfListView.ItemTemplate>
9+
<DataTemplate>
10+
<Border>
11+
<VerticalStackLayout>
12+
<Label Text="{Binding Title}" FontAttributes="Bold" FontSize="20"/>
13+
<Label Text="{Binding Description}" FontSize="14" TextColor="Gray"/>
14+
</VerticalStackLayout>
15+
</Border>
16+
</DataTemplate>
17+
</listview:SfListView.ItemTemplate>
18+
</listview:SfListView>
19+
</ContentPage>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using BottomSheetSample;
2+
3+
namespace BottomSheet;
4+
5+
public partial class FavoritesPage : ContentPage
6+
{
7+
public List<Book> FavoriteBooks { get; set; }
8+
public FavoritesPage()
9+
{
10+
InitializeComponent();
11+
FavoriteBooks = BookFavorites.FavoriteBooks;
12+
BindingContext = this;
13+
}
14+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:bottomSheet="clr-namespace:Syncfusion.Maui.Toolkit.BottomSheet;assembly=Syncfusion.Maui.Toolkit"
5+
xmlns:listview="clr-namespace:Syncfusion.Maui.ListView;assembly=Syncfusion.Maui.ListView"
6+
xmlns:local="clr-namespace:BottomSheetSample"
7+
x:Class="BottomSheetSample.MainPage">
8+
9+
<ContentPage.BindingContext>
10+
<local:BookViewModel/>
11+
</ContentPage.BindingContext>
12+
13+
<ContentPage.ToolbarItems>
14+
<ToolbarItem Text="Favorites" Clicked="OnFavoritesClicked" />
15+
</ContentPage.ToolbarItems>
16+
17+
<Grid>
18+
<listview:SfListView ItemsSource="{Binding Books}" SelectionMode="None" AutoFitMode="DynamicHeight">
19+
<listview:SfListView.ItemTemplate>
20+
<DataTemplate>
21+
<ViewCell>
22+
<VerticalStackLayout Padding="10">
23+
<Label Text="{Binding Title}" FontSize="20" FontAttributes="Bold">
24+
<Label.GestureRecognizers>
25+
<TapGestureRecognizer Tapped="BookTitleTapped"/>
26+
</Label.GestureRecognizers>
27+
</Label>
28+
<Label Text="{Binding Description}" FontSize="14"
29+
TextColor="Gray"/>
30+
</VerticalStackLayout>
31+
</ViewCell>
32+
</DataTemplate>
33+
</listview:SfListView.ItemTemplate>
34+
</listview:SfListView>
35+
36+
<bottomSheet:SfBottomSheet x:Name="bottomSheet">
37+
<bottomSheet:SfBottomSheet.BottomSheetContent>
38+
<VerticalStackLayout x:Name="bottomSheetContent" Spacing="5">
39+
<Grid ColumnDefinitions="120,*" ColumnSpacing="10">
40+
<Label Text="Title:" FontSize="18" FontAttributes="Bold"/>
41+
<Label Text="{Binding Title}" FontSize="18"
42+
VerticalTextAlignment="Center" Grid.Column="1"/>
43+
</Grid>
44+
<Grid ColumnDefinitions="120, *" ColumnSpacing="10">
45+
<Label Text="Genre:" FontSize="18" FontAttributes="Bold"/>
46+
<Label Text="{Binding Genre}" FontSize="18" VerticalTextAlignment="Center" Grid.Column="1"/>
47+
</Grid>
48+
<Grid ColumnDefinitions="120, *" ColumnSpacing="10">
49+
<Label Text="Published:" FontSize="18" FontAttributes="Bold"/>
50+
<Label Text="{Binding Published}" FontSize="18" VerticalTextAlignment="Center" Grid.Column="1"/>
51+
</Grid>
52+
<Grid ColumnDefinitions="120, *" ColumnSpacing="10">
53+
<Label Text="Description:" FontSize="18" FontAttributes="Bold"/>
54+
<Label Text="{Binding Description}" FontSize="18" VerticalTextAlignment="Center" Grid.Column="1"/>
55+
</Grid>
56+
<Grid ColumnDefinitions="120,*" ColumnSpacing="10">
57+
<Label Text="Price:" FontSize="18" FontAttributes="Bold"/>
58+
<Label FontSize="18" VerticalTextAlignment="Center" Grid.Column="1">
59+
<Label.FormattedText>
60+
<FormattedString>
61+
<Span Text="$" FontAttributes="Bold"/>
62+
<Span Text="{Binding Price, StringFormat='{0:F2}'}"/>
63+
</FormattedString>
64+
</Label.FormattedText>
65+
</Label>
66+
</Grid>
67+
68+
<Button Text="Add to Favorites" Clicked="AddToFavoritesClicked" Margin="0,10,0,0"/>
69+
</VerticalStackLayout>
70+
</bottomSheet:SfBottomSheet.BottomSheetContent>
71+
</bottomSheet:SfBottomSheet>
72+
</Grid>
73+
74+
</ContentPage>

0 commit comments

Comments
 (0)