Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions BottomSheetSample/BottomSheetSample.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.12.35521.163 d17.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BottomSheetSample", "BottomSheetSample\BottomSheetSample.csproj", "{38A3BF75-3F37-4DBD-ABD1-A530681C1499}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{38A3BF75-3F37-4DBD-ABD1-A530681C1499}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{38A3BF75-3F37-4DBD-ABD1-A530681C1499}.Debug|Any CPU.Build.0 = Debug|Any CPU
{38A3BF75-3F37-4DBD-ABD1-A530681C1499}.Release|Any CPU.ActiveCfg = Release|Any CPU
{38A3BF75-3F37-4DBD-ABD1-A530681C1499}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
14 changes: 14 additions & 0 deletions BottomSheetSample/BottomSheetSample/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:BottomSheetSample"
x:Class="BottomSheetSample.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
15 changes: 15 additions & 0 deletions BottomSheetSample/BottomSheetSample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace BottomSheetSample
{
public partial class App : Application
{
public App()
{
InitializeComponent();
}

protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new AppShell());
}
}
}
14 changes: 14 additions & 0 deletions BottomSheetSample/BottomSheetSample/AppShell.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="BottomSheetSample.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:BottomSheetSample"
Shell.FlyoutBehavior="Flyout"
Title="BottomSheetSample">

<ShellContent
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />

</Shell>
10 changes: 10 additions & 0 deletions BottomSheetSample/BottomSheetSample/AppShell.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace BottomSheetSample
{
public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
}
}
}
75 changes: 75 additions & 0 deletions BottomSheetSample/BottomSheetSample/BottomSheetSample.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->

<!-- Note for MacCatalyst:
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->

<OutputType>Exe</OutputType>
<RootNamespace>BottomSheetSample</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<!-- Display name -->
<ApplicationTitle>BottomSheetSample</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>com.companyname.bottomsheetsample</ApplicationId>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
<WindowsPackageType>None</WindowsPackageType>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />

<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />

<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.70" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.5" />
<PackageReference Include="Syncfusion.Maui.ListView" Version="*" />
<PackageReference Include="Syncfusion.Maui.Toolkit" Version="*" />
</ItemGroup>

<ItemGroup>
<MauiXaml Update="FavoritesPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup>

</Project>
19 changes: 19 additions & 0 deletions BottomSheetSample/BottomSheetSample/FavoritesPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:listview="clr-namespace:Syncfusion.Maui.ListView;assembly=Syncfusion.Maui.ListView"
x:Class="BottomSheet.FavoritesPage"
Title="Favorites Page">
<listview:SfListView ItemsSource="{Binding FavoriteBooks}" SelectionMode="None">
<listview:SfListView.ItemTemplate>
<DataTemplate>
<Border>
<VerticalStackLayout>
<Label Text="{Binding Title}" FontAttributes="Bold" FontSize="20"/>
<Label Text="{Binding Description}" FontSize="14" TextColor="Gray"/>
</VerticalStackLayout>
</Border>
</DataTemplate>
</listview:SfListView.ItemTemplate>
</listview:SfListView>
</ContentPage>
14 changes: 14 additions & 0 deletions BottomSheetSample/BottomSheetSample/FavoritesPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using BottomSheetSample;

namespace BottomSheet;

public partial class FavoritesPage : ContentPage
{
public List<Book> FavoriteBooks { get; set; }
public FavoritesPage()
{
InitializeComponent();
FavoriteBooks = BookFavorites.FavoriteBooks;
BindingContext = this;
}
}
74 changes: 74 additions & 0 deletions BottomSheetSample/BottomSheetSample/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:bottomSheet="clr-namespace:Syncfusion.Maui.Toolkit.BottomSheet;assembly=Syncfusion.Maui.Toolkit"
xmlns:listview="clr-namespace:Syncfusion.Maui.ListView;assembly=Syncfusion.Maui.ListView"
xmlns:local="clr-namespace:BottomSheetSample"
x:Class="BottomSheetSample.MainPage">

<ContentPage.BindingContext>
<local:BookViewModel/>
</ContentPage.BindingContext>

<ContentPage.ToolbarItems>
<ToolbarItem Text="Favorites" Clicked="OnFavoritesClicked" />
</ContentPage.ToolbarItems>

<Grid>
<listview:SfListView ItemsSource="{Binding Books}" SelectionMode="None" AutoFitMode="DynamicHeight">
<listview:SfListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<VerticalStackLayout Padding="10">
<Label Text="{Binding Title}" FontSize="20" FontAttributes="Bold">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="BookTitleTapped"/>
</Label.GestureRecognizers>
</Label>
<Label Text="{Binding Description}" FontSize="14"
TextColor="Gray"/>
</VerticalStackLayout>
</ViewCell>
</DataTemplate>
</listview:SfListView.ItemTemplate>
</listview:SfListView>

<bottomSheet:SfBottomSheet x:Name="bottomSheet">
<bottomSheet:SfBottomSheet.BottomSheetContent>
<VerticalStackLayout x:Name="bottomSheetContent" Spacing="5">
<Grid ColumnDefinitions="120,*" ColumnSpacing="10">
<Label Text="Title:" FontSize="18" FontAttributes="Bold"/>
<Label Text="{Binding Title}" FontSize="18"
VerticalTextAlignment="Center" Grid.Column="1"/>
</Grid>
<Grid ColumnDefinitions="120, *" ColumnSpacing="10">
<Label Text="Genre:" FontSize="18" FontAttributes="Bold"/>
<Label Text="{Binding Genre}" FontSize="18" VerticalTextAlignment="Center" Grid.Column="1"/>
</Grid>
<Grid ColumnDefinitions="120, *" ColumnSpacing="10">
<Label Text="Published:" FontSize="18" FontAttributes="Bold"/>
<Label Text="{Binding Published}" FontSize="18" VerticalTextAlignment="Center" Grid.Column="1"/>
</Grid>
<Grid ColumnDefinitions="120, *" ColumnSpacing="10">
<Label Text="Description:" FontSize="18" FontAttributes="Bold"/>
<Label Text="{Binding Description}" FontSize="18" VerticalTextAlignment="Center" Grid.Column="1"/>
</Grid>
<Grid ColumnDefinitions="120,*" ColumnSpacing="10">
<Label Text="Price:" FontSize="18" FontAttributes="Bold"/>
<Label FontSize="18" VerticalTextAlignment="Center" Grid.Column="1">
<Label.FormattedText>
<FormattedString>
<Span Text="$" FontAttributes="Bold"/>
<Span Text="{Binding Price, StringFormat='{0:F2}'}"/>
</FormattedString>
</Label.FormattedText>
</Label>
</Grid>

<Button Text="Add to Favorites" Clicked="AddToFavoritesClicked" Margin="0,10,0,0"/>
</VerticalStackLayout>
</bottomSheet:SfBottomSheet.BottomSheetContent>
</bottomSheet:SfBottomSheet>
</Grid>

</ContentPage>
Loading