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
27 changes: 0 additions & 27 deletions GettingStarted/GettingStarted.sln

This file was deleted.

12 changes: 0 additions & 12 deletions GettingStarted/GettingStarted/App.xaml.cs

This file was deleted.

75 changes: 0 additions & 75 deletions GettingStarted/GettingStarted/MainPage.xaml

This file was deleted.

30 changes: 0 additions & 30 deletions GettingStarted/GettingStarted/MainPage.xaml.cs

This file was deleted.

11 changes: 0 additions & 11 deletions GettingStarted/GettingStarted/Platforms/Android/MainActivity.cs

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?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:GettingStarted"
x:Class="GettingStarted.App">
xmlns:local="clr-namespace:NavigationDrawerGettingStarted"
x:Class="NavigationDrawerGettingStarted.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand Down
15 changes: 15 additions & 0 deletions NavigationDrawerGettingStarted/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace NavigationDrawerGettingStarted
{
public partial class App : Application
{
public App()
{
InitializeComponent();
}

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

<ShellContent
ContentTemplate="{DataTemplate local:MainPage}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GettingStarted
namespace NavigationDrawerGettingStarted
{
public partial class AppShell : Shell
{
Expand Down
83 changes: 83 additions & 0 deletions NavigationDrawerGettingStarted/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?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:navigationDrawer="clr-namespace:Syncfusion.Maui.NavigationDrawer;assembly=Syncfusion.Maui.NavigationDrawer"
x:Class="NavigationDrawerGettingStarted.MainPage">

<navigationDrawer:SfNavigationDrawer x:Name="navigationDrawer">
<navigationDrawer:SfNavigationDrawer.DrawerSettings>
<navigationDrawer:DrawerSettings DrawerWidth="250"
DrawerHeaderHeight="160">
<navigationDrawer:DrawerSettings.DrawerHeaderView>
<Grid BackgroundColor="#6750A4" RowDefinitions="120,40">
<Image Source="user.png"
HeightRequest="110"
Margin="0,10,0,0"
BackgroundColor="#6750A4"
VerticalOptions="Center"
HorizontalOptions="Center"/>
<Label Text="James Pollock"
Grid.Row="1"
HorizontalTextAlignment="Center"
HorizontalOptions="Center"
FontSize="20"
TextColor="White"/>
</Grid>
</navigationDrawer:DrawerSettings.DrawerHeaderView>
<navigationDrawer:DrawerSettings.DrawerContentView>
<CollectionView x:Name="collectionView" SelectionMode="Single"
SelectionChanged="collectionView_SelectionChanged">
<CollectionView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Home</x:String>
<x:String>Profile</x:String>
<x:String>Inbox</x:String>
<x:String>Outbox</x:String>
<x:String>Sent</x:String>
<x:String>Draft</x:String>
</x:Array>
</CollectionView.ItemsSource>
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout HeightRequest="40">
<Label Margin="10,7,0,0"
Text="{Binding}"
FontSize="16"
TextColor="Black"/>
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</navigationDrawer:DrawerSettings.DrawerContentView>
</navigationDrawer:DrawerSettings>
</navigationDrawer:SfNavigationDrawer.DrawerSettings>
<navigationDrawer:SfNavigationDrawer.ContentView>
<Grid x:Name="mainContentView"
BackgroundColor="White" RowDefinitions="Auto,*">
<HorizontalStackLayout BackgroundColor="#6750A4" Spacing="10" Padding="5,0,0,0">
<ImageButton x:Name="hamburgerButton"
HeightRequest="50"
WidthRequest="50"
HorizontalOptions="Start"
Source="hamburgericon.png"
BackgroundColor="#6750A4"
Clicked="hamburgerButton_Clicked"/>
<Label x:Name="headerLabel"
HeightRequest="50"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
Text="Home" FontSize="16"
TextColor="White"
BackgroundColor="#6750A4"/>
</HorizontalStackLayout>
<Label Grid.Row="1"
x:Name="contentLabel"
VerticalOptions="Center"
HorizontalOptions="Center"
Text="Content View"
FontSize="14"
TextColor="Black"/>
</Grid>
</navigationDrawer:SfNavigationDrawer.ContentView>
</navigationDrawer:SfNavigationDrawer>
</ContentPage>
28 changes: 28 additions & 0 deletions NavigationDrawerGettingStarted/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

namespace NavigationDrawerGettingStarted
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}

private void hamburgerButton_Clicked(object sender, EventArgs e)
{
navigationDrawer.ToggleDrawer();
}

private void collectionView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{

if (e.CurrentSelection.FirstOrDefault() is string selectedItem)
{
headerLabel.Text = selectedItem;
contentLabel.Text = $"{selectedItem} Content";
navigationDrawer.ToggleDrawer();
}
}
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Syncfusion.Maui.Core.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging;
using Syncfusion.Maui.Core.Hosting;

namespace GettingStarted
namespace NavigationDrawerGettingStarted
{
public static class MauiProgram
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<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);net8.0-tizen</TargetFrameworks> -->
<!-- <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.
Expand All @@ -14,24 +14,27 @@
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->

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

<!-- Display name -->
<ApplicationTitle>GettingStarted</ApplicationTitle>
<ApplicationTitle>NavigationDrawerGettingStarted</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>com.companyname.gettingstarted</ApplicationId>
<ApplicationId>com.companyname.navigationdrawergettingstarted</ApplicationId>

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

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<!-- 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>
Expand All @@ -56,16 +59,9 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\Images\hamburgericon.png" />
<None Remove="Resources\Images\user.png" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="Syncfusion.Maui.Core" Version="*" />
<PackageReference Include="Syncfusion.Maui.NavigationDrawer" Version="*" />
</ItemGroup>

Expand Down
Loading