8000 Add project files. · Netcode-Hub/DemoBottomSheet@d623449 · GitHub
[go: up one dir, main page]

Skip to content

Commit d623449

Browse files
Netcode-HubNetcode-Hub
authored andcommitted
Add project files.
1 parent a6a0d4e commit d623449

Some content is hidden

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

43 files changed

+1183
-0
lines changed

DemoBottomSheet.sln

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.8.34004.107
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DemoBottomSheet", "DemoBottomSheet\DemoBottomSheet.csproj", "{6AC8AFFE-3FFD-42C6-A734-1D3CE5477DD7}"
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+
{6AC8AFFE-3FFD-42C6-A734-1D3CE5477DD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{6AC8AFFE-3FFD-42C6-A734-1D3CE5477DD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{6AC8AFFE-3FFD-42C6-A734-1D3CE5477DD7}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{6AC8AFFE-3FFD-42C6-A734-1D3CE5477DD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{6AC8AFFE-3FFD-42C6-A734-1D3CE5477DD7}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{6AC8AFFE-3FFD-42C6-A734-1D3CE5477DD7}.Release|Any CPU.Deploy.0 = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(SolutionProperties) = preSolution
22+
HideSolutionNode = FALSE
23+
EndGlobalSection
24+
GlobalSection(ExtensibilityGlobals) = postSolution
25+
SolutionGuid = {BF06A3D2-EDC2-402D-B9AF-54200DFDC254}
26+
EndGlobalSection
27+
EndGlobal

DemoBottomSheet/App.xaml

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:DemoBottomSheet"
5+
x:Class="DemoBottomSheet.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>

DemoBottomSheet/App.xaml.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace DemoBottomSheet
2+
{
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
9+
MainPage = new AppShell();
10+
}
11+
}
12+
}

DemoBottomSheet/AppShell.xaml

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="DemoBottomSheet.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:DemoBottomSheet"
7+
Shell.FlyoutBehavior="Disabled">
8+
9+
<ShellContent
10+
Title="Home"
11+
ContentTemplate="{DataTemplate local:MainPage}"
12+
Route="MainPage" />
13+
14+
</Shell>

DemoBottomSheet/AppShell.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace DemoBottomSheet
2+
{
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
10+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.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);net7.0-tizen</TargetFrameworks> -->
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>DemoBottomSheet</RootNamespace>
10+
<UseMaui>true</UseMaui>
11+
<SingleProject>true</SingleProject>
12+
<ImplicitUsings>enable</ImplicitUsings>
13+
14+
<!-- Display name -->
15+
<ApplicationTitle>DemoBottomSheet</ApplicationTitle>
16+
17+
<!-- App Identifier -->
18+
<ApplicationId>com.companyname.demobottomsheet</ApplicationId>
19+
<ApplicationIdGuid>dcbd52f3-583e-45ac-a4ef-0684b4e4a2ba</ApplicationIdGuid>
20+
21+
<!-- Versions -->
22+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
23+
<ApplicationVersion>1</ApplicationVersion>
24+
25+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
26+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
27+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
28+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
29+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
30+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
31+
</PropertyGroup>
32+
33+
<ItemGroup>
34+
<!-- App Icon -->
35+
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
36+
37+
<!-- Splash Screen -->
38+
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
39+
40+
<!-- Images -->
41+
<MauiImage Include="Resources\Images\*" />
42+
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
43+
44+
<!-- Custom Fonts -->
45+
<MauiFont Include="Resources\Fonts\*" />
46+
47+
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
48+
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
49+
</ItemGroup>
50+
51+
<ItemGroup>
52+
<None Remove="Platforms\Android\Resources\values\theme.xml" />
53+
<None Remove="Resources\Images\copy.png" />
54+
<None Remove="Resources\Images\delete.png" />
55+
<None Remove="Resources\Images\minus.png" />
56+
<None Remove="Resources\Images\paste.png" />
57+
<None Remove="Resources\Images\share.png" />
58+
</ItemGroup>
59+
60+
<ItemGroup>
61+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
62+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
63+
<PackageReference Include="The49.Maui.BottomSheet" Version="1.0.1" />
64+
<PackageReference Include="The49.Maui.ContextMenu" Version="1.0.0-alpha1" />
65+
</ItemGroup>
66+
67+
<ItemGroup>
68+
<MauiXaml Update="MySheet.xaml">
69+
<Generator>MSBuild:Compile</Generator>
70+
</MauiXaml>
71+
</ItemGroup>
72+
73+
</Project>

DemoBottomSheet/MainPage.xaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
x:Class="DemoBottomSheet.MainPage"
5+
xmlns:viewmodel="clr-namespace:DemoBottomSheet"
6+
x:DataType="viewmodel:MainPageViewModel">
7+
8+
<ScrollView>
9+
<VerticalStackLayout
10+
Spacing="25"
11+
Padding="30,0"
12+
VerticalOptions="Center">
13+
14+
<Image
15+
Source="dotnet_bot.png"
16+
SemanticProperties.Description="Cute dot net bot waving hi to you!"
17+
HeightRequest="200"
18+
HorizontalOptions="Center" />
19+
20+
<Label
21+
Text="Hello, World!"
22+
SemanticProperties.HeadingLevel="Level1"
23+
FontSize="32"
24+
HorizontalOptions="Center" />
25+
26+
<Label
27+
Text="Welcome to .NET Multi-platform App UI"
28+
SemanticProperties.HeadingLevel="Level2"
29+
SemanticProperties.Description="Welcome to dot net Multi platform App U I"
30+
FontSize="18"
31+
HorizontalOptions="Center" />
32+
33+
<Button
34+
Text="Click me"
35+
SemanticProperties.Hint="Counts the number of times you click"
36+
HorizontalOptions="Center"
37+
Command="{Binding ShowCommand}"/>
38+
39+
</VerticalStackLayout>
40+
</ScrollView>
41+
42+
</ContentPage>

DemoBottomSheet/MainPage.xaml.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
namespace DemoBottomSheet
2+
{
3+
public partial class MainPage : ContentPage
4+
{
5+
// int count = 0;
6+
7+
public MainPage(MainPageViewModel mainPageViewModel)
8+
{
9+
InitializeComponent();
10+
BindingContext = mainPageViewModel;
11+
}
12+
13+
private void OnCounterClicked(object sender, EventArgs e)
14+
{
15+
//count++;
16+
17+
//if (count == 1)
18+
// CounterBtn.Text = $"Clicked {count} time";
19+
//else
20+
// CounterBtn.Text = $"Clicked {count} times";
21+
22+
//SemanticScreenReader.Announce(CounterBtn.Text);
23+
24+
//MySheet sheet = new MySheet();
25+
//sheet.ShowAsync();
26+
27+
}
28+
}
29+
30+
}

DemoBottomSheet/MainPageViewModel.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
using CommunityToolkit.Mvvm.Input;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace DemoBottomSheet
10+
{
11+
public partial class MainPageViewModel : ObservableObject
12+
{
13+
[RelayCommand]
14+
void Show()
15+
{
16+
MySheet sheet = new MySheet();
17+
sheet.ShowAsync();
18+
}
19+
}
20+
}

DemoBottomSheet/MauiProgram.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Microsoft.Extensions.Logging;
2+
using The49.Maui.BottomSheet;
3+
4+
namespace DemoBottomSheet
5+
{
6+
public static class MauiProgram
7+
{
8+
public static MauiApp CreateMauiApp()
9+
{
10+
var builder = MauiApp.CreateBuilder();
11+
builder
12+
.UseMauiApp<App>()
13+
.UseBottomSheet()
14+
.ConfigureFonts(fonts =>
15+
{
16+
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
17+
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
18+
});
19+
builder.Services.AddSingleton<MainPageViewModel>();
20+
builder.Services.AddSingleton<MainPage>();
21+
#if DEBUG
22+
builder.Logging.AddDebug();
23+
#endif
24+
25+
return builder.Build();
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)
0