Remove the old samples
@@ -1,31 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="ShellDemo.App">
|
|
||||||
<Application.Resources>
|
|
||||||
<ResourceDictionary>
|
|
||||||
<!-- Primary Colors -->
|
|
||||||
<Color x:Key="PrimaryColor">#03A9F4</Color>
|
|
||||||
<Color x:Key="PrimaryDarkColor">#0288D1</Color>
|
|
||||||
|
|
||||||
<!-- Semantic Colors -->
|
|
||||||
<Color x:Key="SuccessColor">#4CAF50</Color>
|
|
||||||
<Color x:Key="WarningColor">#FF9800</Color>
|
|
||||||
<Color x:Key="DangerColor">#F44336</Color>
|
|
||||||
<Color x:Key="PurpleColor">#9C27B0</Color>
|
|
||||||
<Color x:Key="DeepPurpleColor">#673AB7</Color>
|
|
||||||
|
|
||||||
<!-- Background Colors -->
|
|
||||||
<Color x:Key="PageBackground">#F5F5F5</Color>
|
|
||||||
<Color x:Key="CardBackground">#FFFFFF</Color>
|
|
||||||
<Color x:Key="ThemeToggleBackground">#E1F5FE</Color>
|
|
||||||
|
|
||||||
<!-- Text Colors -->
|
|
||||||
<Color x:Key="TextPrimary">#212121</Color>
|
|
||||||
<Color x:Key="TextSecondary">#757575</Color>
|
|
||||||
|
|
||||||
<!-- Border Colors -->
|
|
||||||
<Color x:Key="BorderColor">#E0E0E0</Color>
|
|
||||||
</ResourceDictionary>
|
|
||||||
</Application.Resources>
|
|
||||||
</Application>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo;
|
|
||||||
|
|
||||||
public partial class App : Application
|
|
||||||
{
|
|
||||||
public App()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
MainPage = new AppShell();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<Shell xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
||||||
xmlns:pages="clr-namespace:ShellDemo.Pages"
|
|
||||||
x:Class="ShellDemo.AppShell"
|
|
||||||
Title="OpenMaui Controls Demo"
|
|
||||||
FlyoutBehavior="Flyout"
|
|
||||||
Shell.BackgroundColor="{StaticResource PrimaryColor}"
|
|
||||||
Shell.ForegroundColor="White"
|
|
||||||
Shell.TitleColor="White">
|
|
||||||
|
|
||||||
<FlyoutItem Title="Home" Route="Home">
|
|
||||||
<ShellContent ContentTemplate="{DataTemplate pages:HomePage}" />
|
|
||||||
</FlyoutItem>
|
|
||||||
|
|
||||||
<FlyoutItem Title="Buttons" Route="Buttons">
|
|
||||||
<ShellContent ContentTemplate="{DataTemplate pages:ButtonsPage}" />
|
|
||||||
</FlyoutItem>
|
|
||||||
|
|
||||||
<FlyoutItem Title="Text Input" Route="TextInput">
|
|
||||||
<ShellContent ContentTemplate="{DataTemplate pages:TextInputPage}" />
|
|
||||||
</FlyoutItem>
|
|
||||||
|
|
||||||
<FlyoutItem Title="Selection" Route="Selection">
|
|
||||||
<ShellContent ContentTemplate="{DataTemplate pages:SelectionPage}" />
|
|
||||||
</FlyoutItem>
|
|
||||||
|
|
||||||
<FlyoutItem Title="Pickers" Route="Pickers">
|
|
||||||
<ShellContent ContentTemplate="{DataTemplate pages:PickersPage}" />
|
|
||||||
</FlyoutItem>
|
|
||||||
|
|
||||||
<FlyoutItem Title="Lists" Route="Lists">
|
|
||||||
<ShellContent ContentTemplate="{DataTemplate pages:ListsPage}" />
|
|
||||||
</FlyoutItem>
|
|
||||||
|
|
||||||
<FlyoutItem Title="Progress" Route="Progress">
|
|
||||||
<ShellContent ContentTemplate="{DataTemplate pages:ProgressPage}" />
|
|
||||||
</FlyoutItem>
|
|
||||||
|
|
||||||
<FlyoutItem Title="Grids" Route="Grids">
|
|
||||||
<ShellContent ContentTemplate="{DataTemplate pages:GridsPage}" />
|
|
||||||
</FlyoutItem>
|
|
||||||
|
|
||||||
<FlyoutItem Title="Dialogs" Route="Dialogs">
|
|
||||||
<ShellContent ContentTemplate="{DataTemplate pages:DialogsPage}" />
|
|
||||||
</FlyoutItem>
|
|
||||||
|
|
||||||
<FlyoutItem Title="More Controls" Route="MoreControls">
|
|
||||||
<ShellContent ContentTemplate="{DataTemplate pages:MoreControlsPage}" />
|
|
||||||
</FlyoutItem>
|
|
||||||
|
|
||||||
<FlyoutItem Title="About" Route="About">
|
|
||||||
<ShellContent ContentTemplate="{DataTemplate pages:AboutPage}" />
|
|
||||||
</FlyoutItem>
|
|
||||||
|
|
||||||
</Shell>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo;
|
|
||||||
|
|
||||||
public partial class AppShell : Shell
|
|
||||||
{
|
|
||||||
public AppShell()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
Routing.RegisterRoute("detail", typeof(Pages.DetailPage));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using Microsoft.Maui;
|
|
||||||
using Microsoft.Maui.Controls.Hosting;
|
|
||||||
using Microsoft.Maui.Hosting;
|
|
||||||
using Microsoft.Maui.Platform.Linux.Hosting;
|
|
||||||
|
|
||||||
namespace ShellDemo;
|
|
||||||
|
|
||||||
public static class MauiProgram
|
|
||||||
{
|
|
||||||
public static MauiApp CreateMauiApp()
|
|
||||||
{
|
|
||||||
var builder = MauiApp.CreateBuilder();
|
|
||||||
builder
|
|
||||||
.UseMauiApp<App>()
|
|
||||||
.UseLinuxPlatform()
|
|
||||||
.ConfigureFonts(fonts =>
|
|
||||||
{
|
|
||||||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
|
||||||
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
|
|
||||||
});
|
|
||||||
|
|
||||||
return builder.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="ShellDemo.Pages.AboutPage"
|
|
||||||
Title="About"
|
|
||||||
BackgroundColor="{StaticResource PageBackground}">
|
|
||||||
|
|
||||||
<ScrollView>
|
|
||||||
<VerticalStackLayout Padding="20" Spacing="20">
|
|
||||||
|
|
||||||
<Label Text="OpenMaui Linux"
|
|
||||||
FontSize="32"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="#1A237E"
|
|
||||||
HorizontalOptions="Center" />
|
|
||||||
|
|
||||||
<Label Text="Version 1.0.0"
|
|
||||||
FontSize="16"
|
|
||||||
TextColor="{StaticResource TextSecondary}"
|
|
||||||
HorizontalOptions="Center" />
|
|
||||||
|
|
||||||
<BoxView HeightRequest="1" Color="LightGray" />
|
|
||||||
|
|
||||||
<Label Text="OpenMaui Linux brings .NET MAUI to Linux desktops using SkiaSharp for rendering. It provides a native Linux experience while maintaining compatibility with MAUI's cross-platform API."
|
|
||||||
FontSize="14"
|
|
||||||
LineBreakMode="WordWrap" />
|
|
||||||
|
|
||||||
<!-- Info Cards -->
|
|
||||||
<Border BackgroundColor="#F5F5F5" Padding="15" StrokeThickness="0">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<HorizontalStackLayout>
|
|
||||||
<Label Text="Platform:" FontAttributes="Bold" WidthRequest="100" />
|
|
||||||
<Label Text="Linux (X11/Wayland)" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<Border BackgroundColor="#F5F5F5" Padding="15" StrokeThickness="0">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<HorizontalStackLayout>
|
|
||||||
<Label Text="Rendering:" FontAttributes="Bold" WidthRequest="100" />
|
|
||||||
<Label Text="SkiaSharp" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<Border BackgroundColor="#F5F5F5" Padding="15" StrokeThickness="0">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<HorizontalStackLayout>
|
|
||||||
<Label Text="Framework:" FontAttributes="Bold" WidthRequest="100" />
|
|
||||||
<Label Text=".NET MAUI" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<Border BackgroundColor="#F5F5F5" Padding="15" StrokeThickness="0">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<HorizontalStackLayout>
|
|
||||||
<Label Text="License:" FontAttributes="Bold" WidthRequest="100" />
|
|
||||||
<Label Text="MIT License" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<BoxView HeightRequest="1" Color="LightGray" />
|
|
||||||
|
|
||||||
<Label Text="Features"
|
|
||||||
FontSize="20"
|
|
||||||
FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<!-- Feature Items -->
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<Label Text="✓" TextColor="#4CAF50" FontSize="16" />
|
|
||||||
<Label Text="Full XAML support with styles and resources" FontSize="14" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<Label Text="✓" TextColor="#4CAF50" FontSize="16" />
|
|
||||||
<Label Text="Shell navigation with flyout menus" FontSize="14" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<Label Text="✓" TextColor="#4CAF50" FontSize="16" />
|
|
||||||
<Label Text="All standard MAUI controls" FontSize="14" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<Label Text="✓" TextColor="#4CAF50" FontSize="16" />
|
|
||||||
<Label Text="Data binding and MVVM" FontSize="14" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<Label Text="✓" TextColor="#4CAF50" FontSize="16" />
|
|
||||||
<Label Text="Keyboard and mouse input" FontSize="14" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<Label Text="✓" TextColor="#4CAF50" FontSize="16" />
|
|
||||||
<Label Text="High DPI support" FontSize="14" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<BoxView HeightRequest="1" Color="LightGray" />
|
|
||||||
|
|
||||||
<Label Text="https://github.com/pablotoledo/OpenMaui-Linux"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="Blue"
|
|
||||||
HorizontalOptions="Center" />
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</ScrollView>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo.Pages;
|
|
||||||
|
|
||||||
public partial class AboutPage : ContentPage
|
|
||||||
{
|
|
||||||
public AboutPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,176 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="ShellDemo.Pages.ButtonsPage"
|
|
||||||
Title="Buttons"
|
|
||||||
BackgroundColor="{StaticResource PageBackground}">
|
|
||||||
|
|
||||||
<Grid RowDefinitions="*,Auto">
|
|
||||||
<!-- Main Content -->
|
|
||||||
<ScrollView Grid.Row="0">
|
|
||||||
<VerticalStackLayout Padding="20" Spacing="20">
|
|
||||||
|
|
||||||
<Label Text="Button Styles & Events"
|
|
||||||
FontSize="24"
|
|
||||||
FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<!-- Basic Buttons Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="12">
|
|
||||||
<Label Text="Basic Buttons"
|
|
||||||
FontSize="16"
|
|
||||||
FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Button x:Name="DefaultButton"
|
|
||||||
Text="Default Button"
|
|
||||||
BackgroundColor="{StaticResource PrimaryColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnDefaultButtonClicked"
|
|
||||||
Pressed="OnDefaultButtonPressed"
|
|
||||||
Released="OnDefaultButtonReleased" />
|
|
||||||
|
|
||||||
<Button Text="Text Only"
|
|
||||||
BackgroundColor="Transparent"
|
|
||||||
TextColor="{StaticResource PrimaryColor}"
|
|
||||||
Clicked="OnTextButtonClicked" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Styled Buttons Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="12">
|
|
||||||
<Label Text="Styled Buttons"
|
|
||||||
FontSize="16"
|
|
||||||
FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="8">
|
|
||||||
<Button Text="Primary"
|
|
||||||
BackgroundColor="{StaticResource PrimaryColor}"
|
|
||||||
TextColor="White"
|
|
||||||
CornerRadius="5"
|
|
||||||
Clicked="OnPrimaryClicked" />
|
|
||||||
<Button Text="Success"
|
|
||||||
BackgroundColor="{StaticResource SuccessColor}"
|
|
||||||
TextColor="White"
|
|
||||||
CornerRadius="5"
|
|
||||||
Clicked="OnSuccessClicked" />
|
|
||||||
<Button Text="Warning"
|
|
||||||
BackgroundColor="{StaticResource WarningColor}"
|
|
||||||
TextColor="White"
|
|
||||||
CornerRadius="5"
|
|
||||||
Clicked="OnWarningClicked" />
|
|
||||||
<Button Text="Danger"
|
|
||||||
BackgroundColor="{StaticResource DangerColor}"
|
|
||||||
TextColor="White"
|
|
||||||
CornerRadius="5"
|
|
||||||
Clicked="OnDangerClicked" />
|
|
||||||
<Button Text="Purple"
|
|
||||||
BackgroundColor="{StaticResource PurpleColor}"
|
|
||||||
TextColor="White"
|
|
||||||
CornerRadius="5"
|
|
||||||
Clicked="OnPurpleClicked" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Button States Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="12">
|
|
||||||
<Label Text="Button States"
|
|
||||||
FontSize="16"
|
|
||||||
FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Button Text="Enabled Button"
|
|
||||||
BackgroundColor="{StaticResource PrimaryColor}"
|
|
||||||
TextColor="White"
|
|
||||||
IsEnabled="True"
|
|
||||||
Clicked="OnEnabledClicked" />
|
|
||||||
|
|
||||||
<Button x:Name="DisabledButton"
|
|
||||||
Text="Disabled Button"
|
|
||||||
IsEnabled="False" />
|
|
||||||
|
|
||||||
<Button Text="Toggle Above Button"
|
|
||||||
BackgroundColor="{StaticResource PrimaryColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnToggleClicked" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Button Variations Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="12">
|
|
||||||
<Label Text="Button Variations"
|
|
||||||
FontSize="16"
|
|
||||||
FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Button Text="Wide Button"
|
|
||||||
BackgroundColor="{StaticResource DeepPurpleColor}"
|
|
||||||
TextColor="White"
|
|
||||||
HorizontalOptions="Fill"
|
|
||||||
Clicked="OnWideClicked" />
|
|
||||||
|
|
||||||
<Button Text="Tall Button"
|
|
||||||
BackgroundColor="#009688"
|
|
||||||
TextColor="White"
|
|
||||||
HeightRequest="60"
|
|
||||||
Clicked="OnTallClicked" />
|
|
||||||
|
|
||||||
<Button Text="Round"
|
|
||||||
BackgroundColor="#E91E63"
|
|
||||||
TextColor="White"
|
|
||||||
WidthRequest="80"
|
|
||||||
HeightRequest="80"
|
|
||||||
CornerRadius="40"
|
|
||||||
HorizontalOptions="Start"
|
|
||||||
Clicked="OnRoundClicked" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<!-- Event Log Panel -->
|
|
||||||
<Border Grid.Row="1"
|
|
||||||
BackgroundColor="#F5F5F5"
|
|
||||||
Padding="12"
|
|
||||||
StrokeThickness="0">
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Event Log:"
|
|
||||||
FontSize="12"
|
|
||||||
FontAttributes="Bold" />
|
|
||||||
<ScrollView HeightRequest="60">
|
|
||||||
<Label x:Name="EventLog"
|
|
||||||
Text="Events will appear here..."
|
|
||||||
FontSize="11"
|
|
||||||
TextColor="{StaticResource TextSecondary}"
|
|
||||||
LineBreakMode="WordWrap" />
|
|
||||||
</ScrollView>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo.Pages;
|
|
||||||
|
|
||||||
public partial class ButtonsPage : ContentPage
|
|
||||||
{
|
|
||||||
private int _eventCount = 0;
|
|
||||||
|
|
||||||
public ButtonsPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LogEvent(string message)
|
|
||||||
{
|
|
||||||
_eventCount++;
|
|
||||||
var timestamp = DateTime.Now.ToString("HH:mm:ss");
|
|
||||||
EventLog.Text = $"[{timestamp}] {_eventCount}. {message}\n{EventLog.Text}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDefaultButtonClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Default Button clicked");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDefaultButtonPressed(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Default Button pressed");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDefaultButtonReleased(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Default Button released");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnTextButtonClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Text Button clicked");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPrimaryClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Primary button clicked");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnSuccessClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Success button clicked");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnWarningClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Warning button clicked");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDangerClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Danger button clicked");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPurpleClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Purple button clicked");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnEnabledClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Enabled button clicked");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnToggleClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
DisabledButton.IsEnabled = !DisabledButton.IsEnabled;
|
|
||||||
DisabledButton.Text = DisabledButton.IsEnabled ? "Now Enabled!" : "Disabled Button";
|
|
||||||
LogEvent($"Toggled button to: {(DisabledButton.IsEnabled ? "Enabled" : "Disabled")}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnWideClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Wide button clicked");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnTallClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Tall button clicked");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnRoundClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Round button clicked");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="ShellDemo.Pages.DetailPage"
|
|
||||||
Title="Detail Page"
|
|
||||||
BackgroundColor="{StaticResource PageBackground}">
|
|
||||||
|
|
||||||
<VerticalStackLayout Padding="30"
|
|
||||||
Spacing="20"
|
|
||||||
VerticalOptions="Center">
|
|
||||||
|
|
||||||
<Label Text="Pushed Page"
|
|
||||||
FontSize="28"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
HorizontalOptions="Center"
|
|
||||||
TextColor="{StaticResource PurpleColor}" />
|
|
||||||
|
|
||||||
<Label x:Name="ItemLabel"
|
|
||||||
Text="You navigated to: Detail Item"
|
|
||||||
FontSize="16"
|
|
||||||
HorizontalOptions="Center" />
|
|
||||||
|
|
||||||
<Label Text="This page was pushed onto the navigation stack using Shell.Current.GoToAsync()"
|
|
||||||
FontSize="14"
|
|
||||||
TextColor="{StaticResource TextSecondary}"
|
|
||||||
HorizontalTextAlignment="Center"
|
|
||||||
LineBreakMode="WordWrap" />
|
|
||||||
|
|
||||||
<BoxView HeightRequest="2"
|
|
||||||
Color="#E0E0E0"
|
|
||||||
Margin="0,20" />
|
|
||||||
|
|
||||||
<Button Text="Go Back (Pop)"
|
|
||||||
BackgroundColor="{StaticResource PurpleColor}"
|
|
||||||
TextColor="White"
|
|
||||||
HorizontalOptions="Center"
|
|
||||||
Padding="30,10"
|
|
||||||
Clicked="OnGoBackClicked" />
|
|
||||||
|
|
||||||
<Label Text="Use the back button above or the hardware/gesture back to pop this page"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}"
|
|
||||||
HorizontalTextAlignment="Center"
|
|
||||||
Margin="0,20,0,0" />
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo.Pages;
|
|
||||||
|
|
||||||
[QueryProperty(nameof(ItemName), "item")]
|
|
||||||
public partial class DetailPage : ContentPage
|
|
||||||
{
|
|
||||||
private string _itemName = "Detail Item";
|
|
||||||
|
|
||||||
public string ItemName
|
|
||||||
{
|
|
||||||
get => _itemName;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_itemName = value;
|
|
||||||
Title = $"Detail: {value}";
|
|
||||||
if (ItemLabel != null)
|
|
||||||
{
|
|
||||||
ItemLabel.Text = $"You navigated to: {value}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public DetailPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnGoBackClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
await Shell.Current.GoToAsync("..");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,137 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="ShellDemo.Pages.DialogsPage"
|
|
||||||
Title="Dialogs"
|
|
||||||
BackgroundColor="{StaticResource PageBackground}">
|
|
||||||
|
|
||||||
<Grid RowDefinitions="*,Auto">
|
|
||||||
<ScrollView Grid.Row="0">
|
|
||||||
<VerticalStackLayout Padding="20" Spacing="20">
|
|
||||||
|
|
||||||
<Label Text="Dialogs & File Pickers" FontSize="24" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<!-- Alert Dialogs -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="12">
|
|
||||||
<Label Text="Alert Dialogs" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Button Text="Simple Alert"
|
|
||||||
BackgroundColor="{StaticResource PrimaryColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnSimpleAlertClicked" />
|
|
||||||
|
|
||||||
<Button Text="Confirmation (Yes/No)"
|
|
||||||
BackgroundColor="{StaticResource WarningColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnConfirmationClicked" />
|
|
||||||
|
|
||||||
<Label x:Name="AlertResultLabel" Text="Result: (none)" TextColor="{StaticResource TextSecondary}" FontSize="12" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Action Sheet -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="12">
|
|
||||||
<Label Text="Action Sheet" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Button Text="Show Action Sheet"
|
|
||||||
BackgroundColor="{StaticResource PurpleColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnActionSheetClicked" />
|
|
||||||
|
|
||||||
<Button Text="With Destructive Option"
|
|
||||||
BackgroundColor="{StaticResource DangerColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnDestructiveActionSheetClicked" />
|
|
||||||
|
|
||||||
<Label x:Name="ActionResultLabel" Text="Selection: (none)" TextColor="{StaticResource TextSecondary}" FontSize="12" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Prompt Dialog -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="12">
|
|
||||||
<Label Text="Input Prompts" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Button Text="Text Input Prompt"
|
|
||||||
BackgroundColor="{StaticResource SuccessColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnTextPromptClicked" />
|
|
||||||
|
|
||||||
<Button Text="Numeric Prompt"
|
|
||||||
BackgroundColor="{StaticResource SuccessColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnNumericPromptClicked" />
|
|
||||||
|
|
||||||
<Label x:Name="PromptResultLabel" Text="Input: (none)" TextColor="{StaticResource TextSecondary}" FontSize="12" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- File Pickers -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="12">
|
|
||||||
<Label Text="File Pickers" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Button Text="Pick a File"
|
|
||||||
BackgroundColor="#795548"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnPickFileClicked" />
|
|
||||||
|
|
||||||
<Button Text="Pick Multiple Files"
|
|
||||||
BackgroundColor="#795548"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnPickMultipleFilesClicked" />
|
|
||||||
|
|
||||||
<Button Text="Pick Image"
|
|
||||||
BackgroundColor="#E91E63"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnPickImageClicked" />
|
|
||||||
|
|
||||||
<Button Text="Pick Folder"
|
|
||||||
BackgroundColor="#607D8B"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnPickFolderClicked" />
|
|
||||||
|
|
||||||
<Label x:Name="FileResultLabel" Text="Selected: (none)" TextColor="{StaticResource TextSecondary}" FontSize="12" LineBreakMode="TailTruncation" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<!-- Event Log -->
|
|
||||||
<Border Grid.Row="1" BackgroundColor="#F5F5F5" Padding="12" StrokeThickness="0">
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Event Log:" FontSize="12" FontAttributes="Bold" />
|
|
||||||
<ScrollView HeightRequest="60">
|
|
||||||
<Label x:Name="EventLog" Text="Events will appear here..." FontSize="11" TextColor="{StaticResource TextSecondary}" LineBreakMode="WordWrap" />
|
|
||||||
</ScrollView>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,165 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
using Microsoft.Maui.Storage;
|
|
||||||
|
|
||||||
namespace ShellDemo.Pages;
|
|
||||||
|
|
||||||
public partial class DialogsPage : ContentPage
|
|
||||||
{
|
|
||||||
private int _eventCount = 0;
|
|
||||||
|
|
||||||
public DialogsPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LogEvent(string message)
|
|
||||||
{
|
|
||||||
_eventCount++;
|
|
||||||
var timestamp = DateTime.Now.ToString("HH:mm:ss");
|
|
||||||
EventLog.Text = $"[{timestamp}] {_eventCount}. {message}\n{EventLog.Text}";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Alert Dialogs
|
|
||||||
private async void OnSimpleAlertClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
await DisplayAlert("Information", "This is a simple alert dialog.", "OK");
|
|
||||||
AlertResultLabel.Text = "Result: Alert dismissed";
|
|
||||||
LogEvent("Simple alert shown");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnConfirmationClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
bool answer = await DisplayAlert("Confirm", "Do you want to proceed with this action?", "Yes", "No");
|
|
||||||
AlertResultLabel.Text = $"Result: {(answer ? "Yes" : "No")}";
|
|
||||||
LogEvent($"Confirmation: {(answer ? "Yes" : "No")}");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action Sheets
|
|
||||||
private async void OnActionSheetClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string action = await DisplayActionSheet("Choose an option", "Cancel", null, "Option 1", "Option 2", "Option 3");
|
|
||||||
ActionResultLabel.Text = $"Selection: {action ?? "None"}";
|
|
||||||
LogEvent($"Action sheet: {action ?? "Cancelled"}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnDestructiveActionSheetClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string action = await DisplayActionSheet("Danger Zone", "Cancel", "Delete Everything", "Edit", "Share", "Archive");
|
|
||||||
ActionResultLabel.Text = $"Selection: {action ?? "None"}";
|
|
||||||
LogEvent($"Destructive action: {action ?? "Cancelled"}");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prompts
|
|
||||||
private async void OnTextPromptClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string result = await DisplayPromptAsync("Name", "What is your name?", placeholder: "Enter name");
|
|
||||||
PromptResultLabel.Text = $"Input: {result ?? "(cancelled)"}";
|
|
||||||
LogEvent($"Text prompt: {result ?? "Cancelled"}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnNumericPromptClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string result = await DisplayPromptAsync("Age", "Enter your age:", keyboard: Keyboard.Numeric, placeholder: "0");
|
|
||||||
PromptResultLabel.Text = $"Input: {result ?? "(cancelled)"}";
|
|
||||||
LogEvent($"Numeric prompt: {result ?? "Cancelled"}");
|
|
||||||
}
|
|
||||||
|
|
||||||
// File Pickers
|
|
||||||
private async void OnPickFileClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var result = await FilePicker.Default.PickAsync();
|
|
||||||
if (result != null)
|
|
||||||
{
|
|
||||||
FileResultLabel.Text = $"Selected: {result.FileName}";
|
|
||||||
LogEvent($"File: {result.FileName}");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FileResultLabel.Text = "Selected: (cancelled)";
|
|
||||||
LogEvent("File picker cancelled");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
FileResultLabel.Text = $"Error: {ex.Message}";
|
|
||||||
LogEvent($"File picker error: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnPickMultipleFilesClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var results = await FilePicker.Default.PickMultipleAsync();
|
|
||||||
if (results != null && results.Any())
|
|
||||||
{
|
|
||||||
FileResultLabel.Text = $"Selected: {results.Count()} files";
|
|
||||||
LogEvent($"Multiple files: {results.Count()} selected");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FileResultLabel.Text = "Selected: (cancelled)";
|
|
||||||
LogEvent("Multiple file picker cancelled");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
FileResultLabel.Text = $"Error: {ex.Message}";
|
|
||||||
LogEvent($"Multiple file picker error: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnPickImageClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var options = new PickOptions
|
|
||||||
{
|
|
||||||
PickerTitle = "Select an image",
|
|
||||||
FileTypes = FilePickerFileType.Images
|
|
||||||
};
|
|
||||||
var result = await FilePicker.Default.PickAsync(options);
|
|
||||||
if (result != null)
|
|
||||||
{
|
|
||||||
FileResultLabel.Text = $"Selected: {result.FileName}";
|
|
||||||
LogEvent($"Image: {result.FileName}");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FileResultLabel.Text = "Selected: (cancelled)";
|
|
||||||
LogEvent("Image picker cancelled");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
FileResultLabel.Text = $"Error: {ex.Message}";
|
|
||||||
LogEvent($"Image picker error: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnPickFolderClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var result = await FolderPicker.Default.PickAsync();
|
|
||||||
if (result.IsSuccessful)
|
|
||||||
{
|
|
||||||
FileResultLabel.Text = $"Selected: {result.Folder?.Path}";
|
|
||||||
LogEvent($"Folder: {result.Folder?.Name}");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FileResultLabel.Text = "Selected: (cancelled)";
|
|
||||||
LogEvent("Folder picker cancelled");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
FileResultLabel.Text = $"Error: {ex.Message}";
|
|
||||||
LogEvent($"Folder picker error: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,195 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="ShellDemo.Pages.GridsPage"
|
|
||||||
Title="Grids"
|
|
||||||
BackgroundColor="{StaticResource PageBackground}">
|
|
||||||
|
|
||||||
<ScrollView Orientation="Both">
|
|
||||||
<VerticalStackLayout Spacing="25" Padding="20">
|
|
||||||
|
|
||||||
<!-- Basic Grid -->
|
|
||||||
<Label Text="Basic Grid (2x2)" FontSize="18" FontAttributes="Bold" TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
<Label Text="Equal columns using Star sizing" FontSize="12" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,Auto" BackgroundColor="#F5F5F5">
|
|
||||||
<Border Grid.Row="0" Grid.Column="0" BackgroundColor="#E3F2FD" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="Row 0, Col 0" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="0" Grid.Column="1" BackgroundColor="#E8F5E9" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="Row 0, Col 1" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="1" Grid.Column="0" BackgroundColor="#FFF3E0" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="Row 1, Col 0" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="1" Grid.Column="1" BackgroundColor="#FCE4EC" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="Row 1, Col 1" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Column Definitions -->
|
|
||||||
<Label Text="Column Definitions" FontSize="18" FontAttributes="Bold" TextColor="{StaticResource PrimaryColor}" Margin="0,10,0,0" />
|
|
||||||
|
|
||||||
<Label Text="Auto: Sizes to content" FontSize="12" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
<Grid ColumnDefinitions="Auto,Auto,Auto" BackgroundColor="#F5F5F5">
|
|
||||||
<Border Grid.Column="0" BackgroundColor="#BBDEFB" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="Auto" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Column="1" BackgroundColor="#C8E6C9" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="Auto Width" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Column="2" BackgroundColor="#FFECB3" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="A" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Label Text="Absolute: Fixed pixel widths (50, 100, 150)" FontSize="12" TextColor="{StaticResource TextSecondary}" Margin="0,10,0,0" />
|
|
||||||
<Grid ColumnDefinitions="50,100,150" BackgroundColor="#F5F5F5">
|
|
||||||
<Border Grid.Column="0" BackgroundColor="#BBDEFB" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="50px" HorizontalTextAlignment="Center" FontSize="10" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Column="1" BackgroundColor="#C8E6C9" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="100px" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Column="2" BackgroundColor="#FFECB3" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="150px" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Star Sizing -->
|
|
||||||
<Label Text="Star Sizing (Proportional)" FontSize="18" FontAttributes="Bold" TextColor="{StaticResource PrimaryColor}" Margin="0,10,0,0" />
|
|
||||||
<Label Text="Star proportions: 1* | 2* | 1* = 25% | 50% | 25%" FontSize="12" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
<Grid ColumnDefinitions="*,2*,*" BackgroundColor="#F5F5F5">
|
|
||||||
<Border Grid.Column="0" BackgroundColor="#BBDEFB" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="1*" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Column="1" BackgroundColor="#C8E6C9" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="2* (double)" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Column="2" BackgroundColor="#FFECB3" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="1*" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Row & Column Spacing -->
|
|
||||||
<Label Text="Row & Column Spacing" FontSize="18" FontAttributes="Bold" TextColor="{StaticResource PrimaryColor}" Margin="0,10,0,0" />
|
|
||||||
|
|
||||||
<Label Text="No spacing (RowSpacing=0, ColumnSpacing=0)" FontSize="12" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,Auto" RowSpacing="0" ColumnSpacing="0">
|
|
||||||
<Border Grid.Row="0" Grid.Column="0" BackgroundColor="#BBDEFB" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="0,0" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="0" Grid.Column="1" BackgroundColor="#C8E6C9" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="0,1" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="1" Grid.Column="0" BackgroundColor="#FFECB3" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="1,0" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="1" Grid.Column="1" BackgroundColor="#F8BBD9" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="1,1" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Label Text="With spacing (RowSpacing=10, ColumnSpacing=10)" FontSize="12" TextColor="{StaticResource TextSecondary}" Margin="0,10,0,0" />
|
|
||||||
<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,Auto" RowSpacing="10" ColumnSpacing="10">
|
|
||||||
<Border Grid.Row="0" Grid.Column="0" BackgroundColor="#BBDEFB" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="0,0" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="0" Grid.Column="1" BackgroundColor="#C8E6C9" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="0,1" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="1" Grid.Column="0" BackgroundColor="#FFECB3" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="1,0" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="1" Grid.Column="1" BackgroundColor="#F8BBD9" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="1,1" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Row & Column Span -->
|
|
||||||
<Label Text="Row & Column Span" FontSize="18" FontAttributes="Bold" TextColor="{StaticResource PrimaryColor}" Margin="0,10,0,0" />
|
|
||||||
<Label Text="Header spans 3 columns, Sidebar spans 2 rows" FontSize="12" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
<Grid ColumnDefinitions="*,*,*" RowDefinitions="Auto,Auto,Auto" RowSpacing="5" ColumnSpacing="5">
|
|
||||||
<!-- Header spanning 3 columns -->
|
|
||||||
<Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" BackgroundColor="#1976D2" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="ColumnSpan=3 (Header)" TextColor="White" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<!-- Sidebar spanning 2 rows -->
|
|
||||||
<Border Grid.Row="1" Grid.Column="0" Grid.RowSpan="2" BackgroundColor="#388E3C" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="RowSpan=2 (Sidebar)" TextColor="White" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<!-- Content cells -->
|
|
||||||
<Border Grid.Row="1" Grid.Column="1" BackgroundColor="#E3F2FD" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="Content 1" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="1" Grid.Column="2" BackgroundColor="#E8F5E9" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="Content 2" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="2" Grid.Column="1" BackgroundColor="#FFF3E0" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="Content 3" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="2" Grid.Column="2" BackgroundColor="#FCE4EC" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="Content 4" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Mixed Sizing -->
|
|
||||||
<Label Text="Mixed Sizing" FontSize="18" FontAttributes="Bold" TextColor="{StaticResource PrimaryColor}" Margin="0,10,0,0" />
|
|
||||||
<Label Text="Mixed: 60px | Star | Auto | 60px" FontSize="12" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
<Grid ColumnDefinitions="60,*,Auto,60" ColumnSpacing="5" BackgroundColor="#F5F5F5">
|
|
||||||
<Border Grid.Column="0" BackgroundColor="#BBDEFB" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="60px" HorizontalTextAlignment="Center" FontSize="10" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Column="1" BackgroundColor="#C8E6C9" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="Star (fills remaining)" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Column="2" BackgroundColor="#FFECB3" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="Auto" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Column="3" BackgroundColor="#F8BBD9" Padding="10,8" StrokeThickness="0">
|
|
||||||
<Label Text="60px" HorizontalTextAlignment="Center" FontSize="10" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Nested Grids -->
|
|
||||||
<Label Text="Nested Grids" FontSize="18" FontAttributes="Bold" TextColor="{StaticResource PrimaryColor}" Margin="0,10,0,0" />
|
|
||||||
<Label Text="Outer grid contains two nested 2x2 grids" FontSize="12" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,Auto" RowSpacing="10" ColumnSpacing="10" BackgroundColor="#E0E0E0" Padding="10">
|
|
||||||
<!-- Nested Grid 1 -->
|
|
||||||
<Grid Grid.Row="0" Grid.Column="0" ColumnDefinitions="*,*" RowDefinitions="Auto,Auto" RowSpacing="2" ColumnSpacing="2">
|
|
||||||
<Border Grid.Row="0" Grid.Column="0" BackgroundColor="#BBDEFB" Padding="8" StrokeThickness="0">
|
|
||||||
<Label Text="A" FontSize="10" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="0" Grid.Column="1" BackgroundColor="#90CAF9" Padding="8" StrokeThickness="0">
|
|
||||||
<Label Text="B" FontSize="10" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="1" Grid.Column="0" BackgroundColor="#64B5F6" Padding="8" StrokeThickness="0">
|
|
||||||
<Label Text="C" FontSize="10" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="1" Grid.Column="1" BackgroundColor="#42A5F5" Padding="8" StrokeThickness="0">
|
|
||||||
<Label Text="D" FontSize="10" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
<!-- Nested Grid 2 -->
|
|
||||||
<Grid Grid.Row="0" Grid.Column="1" ColumnDefinitions="*,*" RowDefinitions="Auto,Auto" RowSpacing="2" ColumnSpacing="2">
|
|
||||||
<Border Grid.Row="0" Grid.Column="0" BackgroundColor="#C8E6C9" Padding="8" StrokeThickness="0">
|
|
||||||
<Label Text="1" FontSize="10" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="0" Grid.Column="1" BackgroundColor="#A5D6A7" Padding="8" StrokeThickness="0">
|
|
||||||
<Label Text="2" FontSize="10" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="1" Grid.Column="0" BackgroundColor="#81C784" Padding="8" StrokeThickness="0">
|
|
||||||
<Label Text="3" FontSize="10" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="1" Grid.Column="1" BackgroundColor="#66BB6A" Padding="8" StrokeThickness="0">
|
|
||||||
<Label Text="4" FontSize="10" HorizontalTextAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
<Label Grid.Row="1" Grid.Column="0" Text="Outer Grid Row 1" HorizontalOptions="Center" />
|
|
||||||
<Label Grid.Row="1" Grid.Column="1" Text="Spans both columns" HorizontalOptions="Center" />
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<BoxView HeightRequest="20" />
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</ScrollView>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo.Pages;
|
|
||||||
|
|
||||||
public partial class GridsPage : ContentPage
|
|
||||||
{
|
|
||||||
public GridsPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,257 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="ShellDemo.Pages.HomePage"
|
|
||||||
Title="Home"
|
|
||||||
BackgroundColor="{StaticResource PageBackground}">
|
|
||||||
|
|
||||||
<ScrollView>
|
|
||||||
<VerticalStackLayout Padding="20" Spacing="20">
|
|
||||||
|
|
||||||
<!-- Title -->
|
|
||||||
<Label Text="OpenMaui Linux"
|
|
||||||
FontSize="32"
|
|
||||||
FontAttributes="Bold,Italic"
|
|
||||||
TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
|
|
||||||
<Label Text="Controls Demo"
|
|
||||||
FontSize="20"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
|
|
||||||
<!-- Placeholder Box -->
|
|
||||||
<BoxView HeightRequest="60"
|
|
||||||
BackgroundColor="#E0E0E0"
|
|
||||||
CornerRadius="4" />
|
|
||||||
|
|
||||||
<!-- Welcome Text -->
|
|
||||||
<Label Text="Welcome to the comprehensive controls demonstration for OpenMaui Linux. This app showcases all the major UI controls available in the framework."
|
|
||||||
FontSize="14"
|
|
||||||
TextColor="{StaticResource TextPrimary}"
|
|
||||||
LineBreakMode="WordWrap"
|
|
||||||
HorizontalTextAlignment="Center" />
|
|
||||||
|
|
||||||
<!-- Toggle Theme Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource ThemeToggleBackground}"
|
|
||||||
Padding="20"
|
|
||||||
StrokeThickness="0">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<HorizontalStackLayout Spacing="12" VerticalOptions="Center">
|
|
||||||
<Label Text="☀"
|
|
||||||
FontSize="24"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
<Label Text="Toggle Theme"
|
|
||||||
FontSize="16"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{StaticResource PrimaryColor}"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
<Switch x:Name="ThemeSwitch"
|
|
||||||
Toggled="OnThemeToggled"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Feature Cards Grid -->
|
|
||||||
<Grid ColumnDefinitions="*,*"
|
|
||||||
RowDefinitions="Auto,Auto,Auto"
|
|
||||||
ColumnSpacing="12"
|
|
||||||
RowSpacing="12">
|
|
||||||
|
|
||||||
<!-- Buttons Card -->
|
|
||||||
<Border Grid.Row="0" Grid.Column="0"
|
|
||||||
BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<Border.GestureRecognizers>
|
|
||||||
<TapGestureRecognizer Tapped="OnButtonsCardTapped" />
|
|
||||||
</Border.GestureRecognizers>
|
|
||||||
<HorizontalStackLayout Spacing="12">
|
|
||||||
<Label Text="👆"
|
|
||||||
FontSize="24"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Buttons"
|
|
||||||
FontSize="16"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
<Label Text="Various button styles"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Text Input Card -->
|
|
||||||
<Border Grid.Row="0" Grid.Column="1"
|
|
||||||
BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<Border.GestureRecognizers>
|
|
||||||
<TapGestureRecognizer Tapped="OnTextInputCardTapped" />
|
|
||||||
</Border.GestureRecognizers>
|
|
||||||
<HorizontalStackLayout Spacing="12">
|
|
||||||
<Label Text="Tt"
|
|
||||||
FontSize="24"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Text Input"
|
|
||||||
FontSize="16"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
<Label Text="Entry, Editor, SearchBar"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Selection Card -->
|
|
||||||
<Border Grid.Row="1" Grid.Column="0"
|
|
||||||
BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<Border.GestureRecognizers>
|
|
||||||
<TapGestureRecognizer Tapped="OnSelectionCardTapped" />
|
|
||||||
</Border.GestureRecognizers>
|
|
||||||
<HorizontalStackLayout Spacing="12">
|
|
||||||
<Label Text="☑"
|
|
||||||
FontSize="24"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Selection"
|
|
||||||
FontSize="16"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
<Label Text="CheckBox, Switch, Slider"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Pickers Card -->
|
|
||||||
<Border Grid.Row="1" Grid.Column="1"
|
|
||||||
BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<Border.GestureRecognizers>
|
|
||||||
<TapGestureRecognizer Tapped="OnPickersCardTapped" />
|
|
||||||
</Border.GestureRecognizers>
|
|
||||||
<HorizontalStackLayout Spacing="12">
|
|
||||||
<Label Text="📅"
|
|
||||||
FontSize="24"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Pickers"
|
|
||||||
FontSize="16"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
<Label Text="Date, Time, Picker"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Lists Card -->
|
|
||||||
<Border Grid.Row="2" Grid.Column="0"
|
|
||||||
BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<Border.GestureRecognizers>
|
|
||||||
<TapGestureRecognizer Tapped="OnListsCardTapped" />
|
|
||||||
</Border.GestureRecognizers>
|
|
||||||
<HorizontalStackLayout Spacing="12">
|
|
||||||
<Label Text="☰"
|
|
||||||
FontSize="24"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Lists"
|
|
||||||
FontSize="16"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
<Label Text="CollectionView"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Progress Card -->
|
|
||||||
<Border Grid.Row="2" Grid.Column="1"
|
|
||||||
BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<Border.GestureRecognizers>
|
|
||||||
<TapGestureRecognizer Tapped="OnProgressCardTapped" />
|
|
||||||
</Border.GestureRecognizers>
|
|
||||||
<HorizontalStackLayout Spacing="12">
|
|
||||||
<Label Text="⌛"
|
|
||||||
FontSize="24"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Progress"
|
|
||||||
FontSize="16"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
<Label Text="ProgressBar"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Footer Text -->
|
|
||||||
<Label Text="Use the flyout menu to navigate between different control demos."
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}"
|
|
||||||
HorizontalTextAlignment="Center" />
|
|
||||||
|
|
||||||
<!-- Quick Actions -->
|
|
||||||
<Label Text="Quick Actions"
|
|
||||||
FontSize="18"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
HorizontalOptions="Center"
|
|
||||||
Margin="0,10,0,0" />
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="12" HorizontalOptions="Center">
|
|
||||||
<Button Text="Try Buttons"
|
|
||||||
BackgroundColor="{StaticResource PrimaryColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnTryButtonsClicked" />
|
|
||||||
<Button Text="Try Lists"
|
|
||||||
BackgroundColor="{StaticResource SuccessColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnTryListsClicked" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</ScrollView>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Maui.ApplicationModel;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo.Pages;
|
|
||||||
|
|
||||||
public partial class HomePage : ContentPage
|
|
||||||
{
|
|
||||||
public HomePage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
ThemeSwitch.IsToggled = Application.Current?.UserAppTheme == AppTheme.Dark;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnThemeToggled(object? sender, ToggledEventArgs e)
|
|
||||||
{
|
|
||||||
if (Application.Current != null)
|
|
||||||
{
|
|
||||||
Application.Current.UserAppTheme = e.Value ? AppTheme.Dark : AppTheme.Light;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnButtonsCardTapped(object? sender, TappedEventArgs e)
|
|
||||||
{
|
|
||||||
await Shell.Current.GoToAsync("//Buttons");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnTextInputCardTapped(object? sender, TappedEventArgs e)
|
|
||||||
{
|
|
||||||
await Shell.Current.GoToAsync("//TextInput");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnSelectionCardTapped(object? sender, TappedEventArgs e)
|
|
||||||
{
|
|
||||||
await Shell.Current.GoToAsync("//Selection");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnPickersCardTapped(object? sender, TappedEventArgs e)
|
|
||||||
{
|
|
||||||
await Shell.Current.GoToAsync("//Pickers");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnListsCardTapped(object? sender, TappedEventArgs e)
|
|
||||||
{
|
|
||||||
await Shell.Current.GoToAsync("//Lists");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnProgressCardTapped(object? sender, TappedEventArgs e)
|
|
||||||
{
|
|
||||||
await Shell.Current.GoToAsync("//Progress");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnTryButtonsClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
await Shell.Current.GoToAsync("//Buttons");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnTryListsClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
await Shell.Current.GoToAsync("//Lists");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
<?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:local="clr-namespace:ShellDemo.Pages"
|
|
||||||
x:Class="ShellDemo.Pages.ListsPage"
|
|
||||||
Title="Lists"
|
|
||||||
BackgroundColor="{StaticResource PageBackground}">
|
|
||||||
|
|
||||||
<Grid RowDefinitions="*,Auto">
|
|
||||||
<ScrollView Grid.Row="0">
|
|
||||||
<VerticalStackLayout Padding="20" Spacing="20">
|
|
||||||
|
|
||||||
<Label Text="List Controls" FontSize="24" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<!-- Fruits CollectionView -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="10">
|
|
||||||
<Label Text="CollectionView - Fruits" FontSize="16" FontAttributes="Bold" />
|
|
||||||
<CollectionView x:Name="FruitsCollectionView"
|
|
||||||
HeightRequest="200"
|
|
||||||
SelectionMode="Single"
|
|
||||||
BackgroundColor="#FAFAFA"
|
|
||||||
SelectionChanged="OnFruitSelected" />
|
|
||||||
<Label x:Name="FruitSelectedLabel" Text="Tap a fruit to select" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Colors CollectionView -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="10">
|
|
||||||
<Label Text="CollectionView - Colors" FontSize="16" FontAttributes="Bold" />
|
|
||||||
<CollectionView x:Name="ColorsCollectionView"
|
|
||||||
HeightRequest="180"
|
|
||||||
SelectionMode="Single"
|
|
||||||
BackgroundColor="White"
|
|
||||||
SelectionChanged="OnColorSelected" />
|
|
||||||
<Label Text="Scroll to see all colors" FontSize="11" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Contacts CollectionView -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="10">
|
|
||||||
<Label Text="CollectionView - Contacts" FontSize="16" FontAttributes="Bold" />
|
|
||||||
<CollectionView x:Name="ContactsCollectionView"
|
|
||||||
HeightRequest="200"
|
|
||||||
SelectionMode="Single"
|
|
||||||
BackgroundColor="White"
|
|
||||||
SelectionChanged="OnContactSelected" />
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<Button Text="Add Contact"
|
|
||||||
BackgroundColor="Green"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnAddContactClicked" />
|
|
||||||
<Button Text="Delete Selected"
|
|
||||||
BackgroundColor="Red"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnDeleteContactClicked" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<!-- Event Log Panel -->
|
|
||||||
<Border Grid.Row="1" BackgroundColor="#F5F5F5" Padding="12" StrokeThickness="0">
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Event Log:" FontSize="12" FontAttributes="Bold" />
|
|
||||||
<ScrollView HeightRequest="60">
|
|
||||||
<Label x:Name="EventLog"
|
|
||||||
Text="Events will appear here..."
|
|
||||||
FontSize="11"
|
|
||||||
TextColor="{StaticResource TextSecondary}"
|
|
||||||
LineBreakMode="WordWrap" />
|
|
||||||
</ScrollView>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo.Pages;
|
|
||||||
|
|
||||||
public partial class ListsPage : ContentPage
|
|
||||||
{
|
|
||||||
private int _eventCount = 0;
|
|
||||||
|
|
||||||
public ListsPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
LoadData();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LoadData()
|
|
||||||
{
|
|
||||||
// Fruits
|
|
||||||
var fruits = new List<string>
|
|
||||||
{
|
|
||||||
"Apple", "Banana", "Cherry", "Date", "Elderberry",
|
|
||||||
"Fig", "Grape", "Honeydew", "Kiwi", "Lemon",
|
|
||||||
"Mango", "Nectarine", "Orange", "Papaya", "Quince"
|
|
||||||
};
|
|
||||||
FruitsCollectionView.ItemsSource = fruits;
|
|
||||||
|
|
||||||
// Colors
|
|
||||||
var colors = new List<ColorItem>
|
|
||||||
{
|
|
||||||
new("Red", "#F44336"),
|
|
||||||
new("Pink", "#E91E63"),
|
|
||||||
new("Purple", "#9C27B0"),
|
|
||||||
new("Deep Purple", "#673AB7"),
|
|
||||||
new("Indigo", "#3F51B5"),
|
|
||||||
new("Blue", "#2196F3"),
|
|
||||||
new("Cyan", "#00BCD4"),
|
|
||||||
new("Teal", "#009688"),
|
|
||||||
new("Green", "#4CAF50"),
|
|
||||||
new("Light Green", "#8BC34A"),
|
|
||||||
new("Lime", "#CDDC39"),
|
|
||||||
new("Yellow", "#FFEB3B"),
|
|
||||||
new("Amber", "#FFC107"),
|
|
||||||
new("Orange", "#FF9800"),
|
|
||||||
new("Deep Orange", "#FF5722")
|
|
||||||
};
|
|
||||||
ColorsCollectionView.ItemsSource = colors;
|
|
||||||
|
|
||||||
// Contacts
|
|
||||||
var contacts = new List<ContactItem>
|
|
||||||
{
|
|
||||||
new("Alice Johnson", "alice@example.com", "Engineering"),
|
|
||||||
new("Bob Smith", "bob@example.com", "Marketing"),
|
|
||||||
new("Carol Williams", "carol@example.com", "Design"),
|
|
||||||
new("David Brown", "david@example.com", "Sales"),
|
|
||||||
new("Eva Martinez", "eva@example.com", "Engineering"),
|
|
||||||
new("Frank Lee", "frank@example.com", "Support"),
|
|
||||||
new("Grace Kim", "grace@example.com", "HR"),
|
|
||||||
new("Henry Wilson", "henry@example.com", "Finance")
|
|
||||||
};
|
|
||||||
ContactsCollectionView.ItemsSource = contacts;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LogEvent(string message)
|
|
||||||
{
|
|
||||||
_eventCount++;
|
|
||||||
var timestamp = DateTime.Now.ToString("HH:mm:ss");
|
|
||||||
EventLog.Text = $"[{timestamp}] {_eventCount}. {message}\n{EventLog.Text}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnFruitSelected(object? sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.CurrentSelection.Count > 0)
|
|
||||||
{
|
|
||||||
var item = e.CurrentSelection[0]?.ToString();
|
|
||||||
FruitSelectedLabel.Text = $"Selected: {item}";
|
|
||||||
LogEvent($"Fruit selected: {item}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnColorSelected(object? sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.CurrentSelection.Count > 0 && e.CurrentSelection[0] is ColorItem item)
|
|
||||||
{
|
|
||||||
LogEvent($"Color selected: {item.Name} ({item.Hex})");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnContactSelected(object? sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.CurrentSelection.Count > 0 && e.CurrentSelection[0] is ContactItem contact)
|
|
||||||
{
|
|
||||||
LogEvent($"Contact: {contact.Name} - {contact.Department}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnAddContactClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Add contact clicked");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDeleteContactClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent("Delete contact clicked");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public record ColorItem(string Name, string Hex)
|
|
||||||
{
|
|
||||||
public override string ToString() => Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public record ContactItem(string Name, string Email, string Department)
|
|
||||||
{
|
|
||||||
public override string ToString() => $"{Name} ({Department})";
|
|
||||||
}
|
|
||||||
@@ -1,197 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="ShellDemo.Pages.MoreControlsPage"
|
|
||||||
Title="More Controls"
|
|
||||||
BackgroundColor="{StaticResource PageBackground}">
|
|
||||||
|
|
||||||
<Grid RowDefinitions="*,Auto">
|
|
||||||
<ScrollView Grid.Row="0">
|
|
||||||
<VerticalStackLayout Padding="20" Spacing="20">
|
|
||||||
|
|
||||||
<Label Text="More Controls" FontSize="24" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<!-- Stepper -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="Stepper" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="15">
|
|
||||||
<Stepper x:Name="BasicStepper" Minimum="0" Maximum="10" Increment="1" ValueChanged="OnStepperChanged" />
|
|
||||||
<Label x:Name="StepperValueLabel" Text="Value: 0" VerticalOptions="Center" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<Label Text="Custom Range (0-100, step 5):" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<HorizontalStackLayout Spacing="15">
|
|
||||||
<Stepper x:Name="CustomStepper" Minimum="0" Maximum="100" Increment="5" Value="50" ValueChanged="OnCustomStepperChanged" />
|
|
||||||
<Label x:Name="CustomStepperLabel" Text="Value: 50" VerticalOptions="Center" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- RadioButton -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="RadioButton" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Label Text="Select a size:" FontSize="12" />
|
|
||||||
<VerticalStackLayout RadioButtonGroup.GroupName="SizeGroup" Spacing="5">
|
|
||||||
<RadioButton Content="Small" Value="S" CheckedChanged="OnRadioChanged" />
|
|
||||||
<RadioButton Content="Medium" Value="M" IsChecked="True" CheckedChanged="OnRadioChanged" />
|
|
||||||
<RadioButton Content="Large" Value="L" CheckedChanged="OnRadioChanged" />
|
|
||||||
<RadioButton Content="Extra Large" Value="XL" CheckedChanged="OnRadioChanged" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
<Label x:Name="RadioResultLabel" Text="Selected: Medium" TextColor="{StaticResource TextSecondary}" FontSize="12" />
|
|
||||||
|
|
||||||
<Label Text="Horizontal Radio Group:" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<HorizontalStackLayout RadioButtonGroup.GroupName="ColorGroup" Spacing="10">
|
|
||||||
<RadioButton Content="Red" CheckedChanged="OnColorRadioChanged" />
|
|
||||||
<RadioButton Content="Green" CheckedChanged="OnColorRadioChanged" />
|
|
||||||
<RadioButton Content="Blue" IsChecked="True" CheckedChanged="OnColorRadioChanged" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Image -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="Image & ImageButton" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Label Text="Image with different aspects:" FontSize="12" />
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<BoxView WidthRequest="80" HeightRequest="80" BackgroundColor="#E3F2FD" />
|
|
||||||
<Label Text="AspectFit" FontSize="10" HorizontalOptions="Center" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<BoxView WidthRequest="80" HeightRequest="80" BackgroundColor="#E8F5E9" />
|
|
||||||
<Label Text="AspectFill" FontSize="10" HorizontalOptions="Center" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<BoxView WidthRequest="80" HeightRequest="80" BackgroundColor="#FFF3E0" />
|
|
||||||
<Label Text="Fill" FontSize="10" HorizontalOptions="Center" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<Label Text="Note: Replace BoxView with Image when you have image assets" FontSize="11" TextColor="{StaticResource TextSecondary}" FontAttributes="Italic" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Clipboard -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="12">
|
|
||||||
<Label Text="Clipboard" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Entry x:Name="ClipboardEntry" Placeholder="Type text to copy..." />
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<Button Text="Copy"
|
|
||||||
BackgroundColor="{StaticResource PrimaryColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnCopyClicked" />
|
|
||||||
<Button Text="Paste"
|
|
||||||
BackgroundColor="{StaticResource SuccessColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnPasteClicked" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<Label x:Name="ClipboardResultLabel" Text="Clipboard: (empty)" TextColor="{StaticResource TextSecondary}" FontSize="12" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Share -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="12">
|
|
||||||
<Label Text="Share & Launcher" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Button Text="Share Text"
|
|
||||||
BackgroundColor="{StaticResource PurpleColor}"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnShareTextClicked" />
|
|
||||||
|
|
||||||
<Button Text="Open URL in Browser"
|
|
||||||
BackgroundColor="#FF5722"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnOpenUrlClicked" />
|
|
||||||
|
|
||||||
<Button Text="Open Email Client"
|
|
||||||
BackgroundColor="#795548"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnOpenEmailClicked" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- BoxView & Shapes -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="BoxView & Shapes" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="15">
|
|
||||||
<BoxView WidthRequest="50" HeightRequest="50" BackgroundColor="Red" />
|
|
||||||
<BoxView WidthRequest="50" HeightRequest="50" BackgroundColor="Green" CornerRadius="10" />
|
|
||||||
<BoxView WidthRequest="50" HeightRequest="50" BackgroundColor="Blue" CornerRadius="25" />
|
|
||||||
<BoxView WidthRequest="80" HeightRequest="50" BackgroundColor="Orange" CornerRadius="5" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<Label Text="BoxView as divider:" FontSize="12" />
|
|
||||||
<BoxView HeightRequest="2" BackgroundColor="{StaticResource BorderColor}" />
|
|
||||||
|
|
||||||
<Label Text="BoxView with gradient-like effect (stacked):" FontSize="12" />
|
|
||||||
<Grid HeightRequest="30">
|
|
||||||
<BoxView BackgroundColor="#E3F2FD" />
|
|
||||||
<BoxView BackgroundColor="#BBDEFB" Margin="0,0,0,10" />
|
|
||||||
<BoxView BackgroundColor="#90CAF9" Margin="0,0,0,20" />
|
|
||||||
</Grid>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<!-- Event Log -->
|
|
||||||
<Border Grid.Row="1" BackgroundColor="#F5F5F5" Padding="12" StrokeThickness="0">
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Event Log:" FontSize="12" FontAttributes="Bold" />
|
|
||||||
<ScrollView HeightRequest="60">
|
|
||||||
<Label x:Name="EventLog" Text="Events will appear here..." FontSize="11" TextColor="{StaticResource TextSecondary}" LineBreakMode="WordWrap" />
|
|
||||||
</ScrollView>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Maui.ApplicationModel;
|
|
||||||
using Microsoft.Maui.ApplicationModel.DataTransfer;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo.Pages;
|
|
||||||
|
|
||||||
public partial class MoreControlsPage : ContentPage
|
|
||||||
{
|
|
||||||
private int _eventCount = 0;
|
|
||||||
|
|
||||||
public MoreControlsPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LogEvent(string message)
|
|
||||||
{
|
|
||||||
_eventCount++;
|
|
||||||
var timestamp = DateTime.Now.ToString("HH:mm:ss");
|
|
||||||
EventLog.Text = $"[{timestamp}] {_eventCount}. {message}\n{EventLog.Text}";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Stepper
|
|
||||||
private void OnStepperChanged(object? sender, ValueChangedEventArgs e)
|
|
||||||
{
|
|
||||||
StepperValueLabel.Text = $"Value: {(int)e.NewValue}";
|
|
||||||
LogEvent($"Stepper: {(int)e.NewValue}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnCustomStepperChanged(object? sender, ValueChangedEventArgs e)
|
|
||||||
{
|
|
||||||
CustomStepperLabel.Text = $"Value: {(int)e.NewValue}";
|
|
||||||
LogEvent($"Custom Stepper: {(int)e.NewValue}");
|
|
||||||
}
|
|
||||||
|
|
||||||
// RadioButton
|
|
||||||
private void OnRadioChanged(object? sender, CheckedChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.Value && sender is RadioButton rb)
|
|
||||||
{
|
|
||||||
RadioResultLabel.Text = $"Selected: {rb.Content}";
|
|
||||||
LogEvent($"Size: {rb.Content}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnColorRadioChanged(object? sender, CheckedChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.Value && sender is RadioButton rb)
|
|
||||||
{
|
|
||||||
LogEvent($"Color: {rb.Content}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clipboard
|
|
||||||
private async void OnCopyClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var text = ClipboardEntry.Text;
|
|
||||||
if (!string.IsNullOrEmpty(text))
|
|
||||||
{
|
|
||||||
await Clipboard.Default.SetTextAsync(text);
|
|
||||||
ClipboardResultLabel.Text = $"Copied: {text}";
|
|
||||||
LogEvent($"Copied to clipboard: {text}");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ClipboardResultLabel.Text = "Nothing to copy";
|
|
||||||
LogEvent("Copy failed: empty text");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnPasteClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (Clipboard.Default.HasText)
|
|
||||||
{
|
|
||||||
var text = await Clipboard.Default.GetTextAsync();
|
|
||||||
ClipboardEntry.Text = text;
|
|
||||||
ClipboardResultLabel.Text = $"Pasted: {text}";
|
|
||||||
LogEvent($"Pasted from clipboard: {text}");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ClipboardResultLabel.Text = "Clipboard is empty";
|
|
||||||
LogEvent("Paste failed: clipboard empty");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Share & Launcher
|
|
||||||
private async void OnShareTextClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await Share.Default.RequestAsync(new ShareTextRequest
|
|
||||||
{
|
|
||||||
Text = "Check out OpenMaui Linux - .NET MAUI for Linux!",
|
|
||||||
Title = "Share OpenMaui"
|
|
||||||
});
|
|
||||||
LogEvent("Share dialog opened");
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
LogEvent($"Share error: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnOpenUrlClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await Launcher.Default.OpenAsync("https://github.com/pablotoledo/OpenMaui-Linux");
|
|
||||||
LogEvent("Opened URL in browser");
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
LogEvent($"Launcher error: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnOpenEmailClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await Launcher.Default.OpenAsync("mailto:info@example.com?subject=OpenMaui%20Feedback");
|
|
||||||
LogEvent("Opened email client");
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
LogEvent($"Email error: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="ShellDemo.Pages.PickersPage"
|
|
||||||
Title="Pickers"
|
|
||||||
BackgroundColor="{StaticResource PageBackground}">
|
|
||||||
|
|
||||||
<Grid RowDefinitions="*,Auto">
|
|
||||||
<ScrollView Grid.Row="0">
|
|
||||||
<VerticalStackLayout Padding="20" Spacing="20">
|
|
||||||
|
|
||||||
<Label Text="Picker Controls" FontSize="24" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<!-- Picker Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="Picker" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Picker x:Name="FruitPicker"
|
|
||||||
Title="Select a fruit"
|
|
||||||
SelectedIndexChanged="OnFruitPickerChanged">
|
|
||||||
<Picker.ItemsSource>
|
|
||||||
<x:Array Type="{x:Type x:String}">
|
|
||||||
<x:String>Apple</x:String>
|
|
||||||
<x:String>Banana</x:String>
|
|
||||||
<x:String>Cherry</x:String>
|
|
||||||
<x:String>Date</x:String>
|
|
||||||
<x:String>Elderberry</x:String>
|
|
||||||
<x:String>Fig</x:String>
|
|
||||||
<x:String>Grape</x:String>
|
|
||||||
</x:Array>
|
|
||||||
</Picker.ItemsSource>
|
|
||||||
</Picker>
|
|
||||||
<Label x:Name="FruitSelectedLabel" Text="Selected: (none)" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
|
|
||||||
<Label Text="With Default Selection:" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<Picker x:Name="ColorPicker"
|
|
||||||
Title="Select a color"
|
|
||||||
SelectedIndex="2"
|
|
||||||
SelectedIndexChanged="OnColorPickerChanged">
|
|
||||||
<Picker.ItemsSource>
|
|
||||||
<x:Array Type="{x:Type x:String}">
|
|
||||||
<x:String>Red</x:String>
|
|
||||||
<x:String>Green</x:String>
|
|
||||||
<x:String>Blue</x:String>
|
|
||||||
<x:String>Yellow</x:String>
|
|
||||||
<x:String>Purple</x:String>
|
|
||||||
</x:Array>
|
|
||||||
</Picker.ItemsSource>
|
|
||||||
</Picker>
|
|
||||||
|
|
||||||
<Label Text="Styled Picker:" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<Picker Title="Select size"
|
|
||||||
TextColor="DarkBlue"
|
|
||||||
TitleColor="Gray"
|
|
||||||
SelectedIndexChanged="OnSizePickerChanged">
|
|
||||||
<Picker.ItemsSource>
|
|
||||||
<x:Array Type="{x:Type x:String}">
|
|
||||||
<x:String>Small</x:String>
|
|
||||||
<x:String>Medium</x:String>
|
|
||||||
<x:String>Large</x:String>
|
|
||||||
<x:String>Extra Large</x:String>
|
|
||||||
</x:Array>
|
|
||||||
</Picker.ItemsSource>
|
|
||||||
</Picker>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- DatePicker Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="DatePicker" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<DatePicker x:Name="BasicDatePicker" DateSelected="OnDateSelected" />
|
|
||||||
<Label x:Name="DateSelectedLabel" Text="Selected date will appear here" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
|
|
||||||
<Label Text="With Date Range (this month only):" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<DatePicker x:Name="RangeDatePicker" DateSelected="OnRangeDateSelected" />
|
|
||||||
|
|
||||||
<Label Text="Styled DatePicker:" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<DatePicker TextColor="DarkGreen" DateSelected="OnStyledDateSelected" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- TimePicker Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="TimePicker" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<TimePicker x:Name="BasicTimePicker" PropertyChanged="OnTimeChanged" />
|
|
||||||
<Label x:Name="TimeSelectedLabel" Text="Selected time will appear here" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
|
|
||||||
<Label Text="Styled TimePicker:" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<TimePicker Time="14:30:00" TextColor="DarkBlue" PropertyChanged="OnStyledTimeChanged" />
|
|
||||||
|
|
||||||
<Label Text="Alarm Time:" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<TimePicker x:Name="AlarmTimePicker" Time="07:00:00" />
|
|
||||||
<Button Text="Set Alarm"
|
|
||||||
BackgroundColor="Orange"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnSetAlarmClicked" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<!-- Event Log Panel -->
|
|
||||||
<Border Grid.Row="1" BackgroundColor="#F5F5F5" Padding="12" StrokeThickness="0">
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Event Log:" FontSize="12" FontAttributes="Bold" />
|
|
||||||
<ScrollView HeightRequest="60">
|
|
||||||
<Label x:Name="EventLog"
|
|
||||||
Text="Events will appear here..."
|
|
||||||
FontSize="11"
|
|
||||||
TextColor="{StaticResource TextSecondary}"
|
|
||||||
LineBreakMode="WordWrap" />
|
|
||||||
</ScrollView>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo.Pages;
|
|
||||||
|
|
||||||
public partial class PickersPage : ContentPage
|
|
||||||
{
|
|
||||||
private int _eventCount = 0;
|
|
||||||
|
|
||||||
public PickersPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
// Set date range for the range picker
|
|
||||||
var startOfMonth = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
|
|
||||||
var endOfMonth = startOfMonth.AddMonths(1).AddDays(-1);
|
|
||||||
RangeDatePicker.MinimumDate = startOfMonth;
|
|
||||||
RangeDatePicker.MaximumDate = endOfMonth;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LogEvent(string message)
|
|
||||||
{
|
|
||||||
_eventCount++;
|
|
||||||
var timestamp = DateTime.Now.ToString("HH:mm:ss");
|
|
||||||
EventLog.Text = $"[{timestamp}] {_eventCount}. {message}\n{EventLog.Text}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnFruitPickerChanged(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (FruitPicker.SelectedIndex >= 0)
|
|
||||||
{
|
|
||||||
var item = FruitPicker.ItemsSource[FruitPicker.SelectedIndex]?.ToString();
|
|
||||||
FruitSelectedLabel.Text = $"Selected: {item}";
|
|
||||||
LogEvent($"Fruit selected: {item}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnColorPickerChanged(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (ColorPicker.SelectedIndex >= 0)
|
|
||||||
{
|
|
||||||
LogEvent($"Color selected: {ColorPicker.ItemsSource[ColorPicker.SelectedIndex]}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnSizePickerChanged(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (sender is Picker picker && picker.SelectedIndex >= 0)
|
|
||||||
{
|
|
||||||
LogEvent($"Size selected: {picker.ItemsSource[picker.SelectedIndex]}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDateSelected(object? sender, DateChangedEventArgs e)
|
|
||||||
{
|
|
||||||
DateSelectedLabel.Text = $"Selected: {e.NewDate:d}";
|
|
||||||
LogEvent($"Date selected: {e.NewDate:d}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnRangeDateSelected(object? sender, DateChangedEventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent($"Date (limited): {e.NewDate:d}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnStyledDateSelected(object? sender, DateChangedEventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent($"Styled date: {e.NewDate:d}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnTimeChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.PropertyName == nameof(TimePicker.Time))
|
|
||||||
{
|
|
||||||
var time = BasicTimePicker.Time;
|
|
||||||
TimeSelectedLabel.Text = $"Selected: {time:hh\\:mm}";
|
|
||||||
LogEvent($"Time selected: {time:hh\\:mm}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnStyledTimeChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.PropertyName == nameof(TimePicker.Time) && sender is TimePicker picker)
|
|
||||||
{
|
|
||||||
LogEvent($"Styled time: {picker.Time:hh\\:mm}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnSetAlarmClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent($"Alarm set for {AlarmTimePicker.Time:hh\\:mm}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="ShellDemo.Pages.ProgressPage"
|
|
||||||
Title="Progress"
|
|
||||||
BackgroundColor="{StaticResource PageBackground}">
|
|
||||||
|
|
||||||
<Grid RowDefinitions="*,Auto">
|
|
||||||
<ScrollView Grid.Row="0">
|
|
||||||
<VerticalStackLayout Padding="20" Spacing="20">
|
|
||||||
|
|
||||||
<Label Text="Progress Indicators" FontSize="24" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<!-- ProgressBar Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="ProgressBar" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<!-- Various progress values -->
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<ProgressBar Progress="0" WidthRequest="200" />
|
|
||||||
<Label Text="0%" VerticalOptions="Center" WidthRequest="50" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<ProgressBar Progress="0.25" WidthRequest="200" />
|
|
||||||
<Label Text="25%" VerticalOptions="Center" WidthRequest="50" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<ProgressBar Progress="0.5" WidthRequest="200" />
|
|
||||||
<Label Text="50%" VerticalOptions="Center" WidthRequest="50" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<ProgressBar Progress="0.75" WidthRequest="200" />
|
|
||||||
<Label Text="75%" VerticalOptions="Center" WidthRequest="50" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<ProgressBar Progress="1" WidthRequest="200" />
|
|
||||||
<Label Text="100%" VerticalOptions="Center" WidthRequest="50" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<Label Text="Colored Progress Bars:" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<ProgressBar Progress="0.7" ProgressColor="Red" />
|
|
||||||
<ProgressBar Progress="0.7" ProgressColor="Green" />
|
|
||||||
<ProgressBar Progress="0.7" ProgressColor="Blue" />
|
|
||||||
<ProgressBar Progress="0.7" ProgressColor="Orange" />
|
|
||||||
<ProgressBar Progress="0.7" ProgressColor="Purple" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- ActivityIndicator Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="ActivityIndicator" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="15">
|
|
||||||
<ActivityIndicator IsRunning="True" />
|
|
||||||
<Label Text="Loading..." VerticalOptions="Center" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="15">
|
|
||||||
<ActivityIndicator x:Name="ToggleIndicator" IsRunning="False" />
|
|
||||||
<Button Text="Start/Stop" Clicked="OnToggleIndicatorClicked" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<Label Text="Colored Indicators:" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<HorizontalStackLayout Spacing="20">
|
|
||||||
<ActivityIndicator IsRunning="True" Color="Red" />
|
|
||||||
<ActivityIndicator IsRunning="True" Color="Green" />
|
|
||||||
<ActivityIndicator IsRunning="True" Color="Blue" />
|
|
||||||
<ActivityIndicator IsRunning="True" Color="Orange" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Interactive Demo Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="Interactive Demo" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<ProgressBar x:Name="AnimatedProgress" Progress="0.5" />
|
|
||||||
<Slider x:Name="ProgressSlider" Minimum="0" Maximum="100" Value="50" ValueChanged="OnProgressSliderChanged" />
|
|
||||||
<Label x:Name="ProgressLabel" Text="Progress: 50%" />
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="10" Margin="0,10,0,0">
|
|
||||||
<Button Text="Reset"
|
|
||||||
BackgroundColor="Gray"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnResetClicked" />
|
|
||||||
<Button Text="Animate to 100%"
|
|
||||||
BackgroundColor="Blue"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnAnimateClicked" />
|
|
||||||
<Button Text="Simulate Download"
|
|
||||||
BackgroundColor="Green"
|
|
||||||
TextColor="White"
|
|
||||||
Clicked="OnSimulateClicked" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<!-- Event Log Panel -->
|
|
||||||
<Border Grid.Row="1" BackgroundColor="#F5F5F5" Padding="12" StrokeThickness="0">
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Event Log:" FontSize="12" FontAttributes="Bold" />
|
|
||||||
<ScrollView HeightRequest="60">
|
|
||||||
<Label x:Name="EventLog"
|
|
||||||
Text="Events will appear here..."
|
|
||||||
FontSize="11"
|
|
||||||
TextColor="{StaticResource TextSecondary}"
|
|
||||||
LineBreakMode="WordWrap" />
|
|
||||||
</ScrollView>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo.Pages;
|
|
||||||
|
|
||||||
public partial class ProgressPage : ContentPage
|
|
||||||
{
|
|
||||||
private int _eventCount = 0;
|
|
||||||
private bool _isAnimating = false;
|
|
||||||
|
|
||||||
public ProgressPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LogEvent(string message)
|
|
||||||
{
|
|
||||||
_eventCount++;
|
|
||||||
var timestamp = DateTime.Now.ToString("HH:mm:ss");
|
|
||||||
EventLog.Text = $"[{timestamp}] {_eventCount}. {message}\n{EventLog.Text}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnToggleIndicatorClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
ToggleIndicator.IsRunning = !ToggleIndicator.IsRunning;
|
|
||||||
LogEvent($"ActivityIndicator: {(ToggleIndicator.IsRunning ? "Started" : "Stopped")}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnProgressSliderChanged(object? sender, ValueChangedEventArgs e)
|
|
||||||
{
|
|
||||||
var value = e.NewValue / 100.0;
|
|
||||||
AnimatedProgress.Progress = value;
|
|
||||||
ProgressLabel.Text = $"Progress: {e.NewValue:0}%";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnResetClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
AnimatedProgress.Progress = 0;
|
|
||||||
ProgressSlider.Value = 0;
|
|
||||||
LogEvent("Progress reset to 0%");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnAnimateClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (_isAnimating) return;
|
|
||||||
_isAnimating = true;
|
|
||||||
LogEvent("Animation started");
|
|
||||||
|
|
||||||
for (int i = (int)ProgressSlider.Value; i <= 100; i += 5)
|
|
||||||
{
|
|
||||||
AnimatedProgress.Progress = i / 100.0;
|
|
||||||
ProgressSlider.Value = i;
|
|
||||||
await Task.Delay(100);
|
|
||||||
}
|
|
||||||
|
|
||||||
_isAnimating = false;
|
|
||||||
LogEvent("Animation completed");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnSimulateClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (_isAnimating) return;
|
|
||||||
_isAnimating = true;
|
|
||||||
LogEvent("Download simulation started");
|
|
||||||
|
|
||||||
AnimatedProgress.Progress = 0;
|
|
||||||
ProgressSlider.Value = 0;
|
|
||||||
|
|
||||||
var random = new Random();
|
|
||||||
double progress = 0;
|
|
||||||
while (progress < 1.0)
|
|
||||||
{
|
|
||||||
progress += random.NextDouble() * 0.1;
|
|
||||||
if (progress > 1.0) progress = 1.0;
|
|
||||||
AnimatedProgress.Progress = progress;
|
|
||||||
ProgressSlider.Value = progress * 100;
|
|
||||||
await Task.Delay(200 + random.Next(300));
|
|
||||||
}
|
|
||||||
|
|
||||||
_isAnimating = false;
|
|
||||||
LogEvent("Download simulation completed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="ShellDemo.Pages.SelectionPage"
|
|
||||||
Title="Selection"
|
|
||||||
BackgroundColor="{StaticResource PageBackground}">
|
|
||||||
|
|
||||||
<Grid RowDefinitions="*,Auto">
|
|
||||||
<!-- Main Content -->
|
|
||||||
<ScrollView Grid.Row="0">
|
|
||||||
<VerticalStackLayout Padding="20" Spacing="20">
|
|
||||||
|
|
||||||
<Label Text="Selection Controls"
|
|
||||||
FontSize="24"
|
|
||||||
FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<!-- CheckBox Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="CheckBox" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="20">
|
|
||||||
<CheckBox x:Name="Checkbox1" CheckedChanged="OnCheckbox1Changed" />
|
|
||||||
<Label Text="Option 1" VerticalOptions="Center" />
|
|
||||||
<CheckBox x:Name="Checkbox2" IsChecked="True" CheckedChanged="OnCheckbox2Changed" />
|
|
||||||
<Label Text="Option 2 (default checked)" VerticalOptions="Center" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<Label Text="Colored Checkboxes:" FontSize="12" />
|
|
||||||
<HorizontalStackLayout Spacing="20">
|
|
||||||
<CheckBox Color="Red" IsChecked="True" CheckedChanged="OnColoredCheckboxChanged" />
|
|
||||||
<CheckBox Color="Green" IsChecked="True" CheckedChanged="OnColoredCheckboxChanged" />
|
|
||||||
<CheckBox Color="Blue" IsChecked="True" CheckedChanged="OnColoredCheckboxChanged" />
|
|
||||||
<CheckBox Color="Purple" IsChecked="True" CheckedChanged="OnColoredCheckboxChanged" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<CheckBox IsChecked="True" IsEnabled="False" />
|
|
||||||
<Label Text="Disabled (checked)" VerticalOptions="Center" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Switch Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="Switch" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="15">
|
|
||||||
<Switch x:Name="BasicSwitch" Toggled="OnBasicSwitchToggled" />
|
|
||||||
<Label x:Name="SwitchStatusLabel" Text="Off" VerticalOptions="Center" WidthRequest="50" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<Label Text="Colored Switches:" FontSize="12" />
|
|
||||||
<HorizontalStackLayout Spacing="20">
|
|
||||||
<Switch IsToggled="True" OnColor="Green" Toggled="OnColoredSwitchToggled" />
|
|
||||||
<Switch IsToggled="True" OnColor="Orange" Toggled="OnColoredSwitchToggled" />
|
|
||||||
<Switch IsToggled="True" OnColor="Purple" Toggled="OnColoredSwitchToggled" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
|
|
||||||
<HorizontalStackLayout Spacing="10">
|
|
||||||
<Switch IsToggled="True" IsEnabled="False" />
|
|
||||||
<Label Text="Disabled (on)" VerticalOptions="Center" TextColor="{StaticResource TextSecondary}" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Slider Section -->
|
|
||||||
<Border BackgroundColor="{StaticResource CardBackground}"
|
|
||||||
Stroke="{StaticResource BorderColor}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="15">
|
|
||||||
<Label Text="Slider" FontSize="16" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Slider x:Name="BasicSlider" Minimum="0" Maximum="100" Value="50" ValueChanged="OnBasicSliderChanged" />
|
|
||||||
<Label x:Name="SliderValueLabel" Text="Value: 50" />
|
|
||||||
|
|
||||||
<Label Text="Temperature (0-40C):" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<Slider x:Name="TempSlider" Minimum="0" Maximum="40" Value="20" ValueChanged="OnTempSliderChanged" />
|
|
||||||
<Label x:Name="TempLabel" Text="20C" />
|
|
||||||
|
|
||||||
<Label Text="Colored Slider:" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<Slider Minimum="0" Maximum="100" Value="75"
|
|
||||||
MinimumTrackColor="Green"
|
|
||||||
MaximumTrackColor="LightGray"
|
|
||||||
ThumbColor="DarkGreen"
|
|
||||||
ValueChanged="OnColoredSliderChanged" />
|
|
||||||
|
|
||||||
<Label Text="Disabled Slider:" FontSize="12" Margin="0,10,0,0" />
|
|
||||||
<Slider Minimum="0" Maximum="100" Value="30" IsEnabled="False" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<!-- Event Log Panel -->
|
|
||||||
<Border Grid.Row="1"
|
|
||||||
BackgroundColor="#F5F5F5"
|
|
||||||
Padding="12"
|
|
||||||
StrokeThickness="0">
|
|
||||||
<VerticalStackLayout>
|
|
||||||
<Label Text="Event Log:" FontSize="12" FontAttributes="Bold" />
|
|
||||||
<ScrollView HeightRequest="60">
|
|
||||||
<Label x:Name="EventLog"
|
|
||||||
Text="Events will appear here..."
|
|
||||||
FontSize="11"
|
|
||||||
TextColor="{StaticResource TextSecondary}"
|
|
||||||
LineBreakMode="WordWrap" />
|
|
||||||
</ScrollView>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo.Pages;
|
|
||||||
|
|
||||||
public partial class SelectionPage : ContentPage
|
|
||||||
{
|
|
||||||
private int _eventCount = 0;
|
|
||||||
|
|
||||||
public SelectionPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LogEvent(string message)
|
|
||||||
{
|
|
||||||
_eventCount++;
|
|
||||||
var timestamp = DateTime.Now.ToString("HH:mm:ss");
|
|
||||||
EventLog.Text = $"[{timestamp}] {_eventCount}. {message}\n{EventLog.Text}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnCheckbox1Changed(object? sender, CheckedChangedEventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent($"Checkbox 1: {(e.Value ? "Checked" : "Unchecked")}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnCheckbox2Changed(object? sender, CheckedChangedEventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent($"Checkbox 2: {(e.Value ? "Checked" : "Unchecked")}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnColoredCheckboxChanged(object? sender, CheckedChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (sender is CheckBox cb)
|
|
||||||
{
|
|
||||||
LogEvent($"{cb.Color} checkbox: {(e.Value ? "Checked" : "Unchecked")}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnBasicSwitchToggled(object? sender, ToggledEventArgs e)
|
|
||||||
{
|
|
||||||
SwitchStatusLabel.Text = e.Value ? "On" : "Off";
|
|
||||||
LogEvent($"Switch toggled: {(e.Value ? "ON" : "OFF")}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnColoredSwitchToggled(object? sender, ToggledEventArgs e)
|
|
||||||
{
|
|
||||||
if (sender is Switch sw)
|
|
||||||
{
|
|
||||||
LogEvent($"{sw.OnColor} switch: {(e.Value ? "ON" : "OFF")}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnBasicSliderChanged(object? sender, ValueChangedEventArgs e)
|
|
||||||
{
|
|
||||||
SliderValueLabel.Text = $"Value: {(int)e.NewValue}";
|
|
||||||
LogEvent($"Slider value: {(int)e.NewValue}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnTempSliderChanged(object? sender, ValueChangedEventArgs e)
|
|
||||||
{
|
|
||||||
TempLabel.Text = $"{(int)e.NewValue}C";
|
|
||||||
LogEvent($"Temperature: {(int)e.NewValue}C");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnColoredSliderChanged(object? sender, ValueChangedEventArgs e)
|
|
||||||
{
|
|
||||||
LogEvent($"Colored slider: {(int)e.NewValue}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="ShellDemo.Pages.TextInputPage"
|
|
||||||
Title="Text Input"
|
|
||||||
BackgroundColor="{StaticResource PageBackground}">
|
|
||||||
|
|
||||||
<ScrollView>
|
|
||||||
<VerticalStackLayout Padding="20" Spacing="15">
|
|
||||||
|
|
||||||
<Label Text="Text Input Controls"
|
|
||||||
FontSize="24"
|
|
||||||
FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Label Text="Click on any field and start typing. All keyboard input is handled by the framework."
|
|
||||||
FontSize="14"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
|
|
||||||
<!-- Entry Section -->
|
|
||||||
<BoxView HeightRequest="1" Color="#E0E0E0" />
|
|
||||||
<Label Text="Entry (Single Line)" FontSize="18" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Entry x:Name="NameEntry"
|
|
||||||
Placeholder="Enter your name..."
|
|
||||||
FontSize="14"
|
|
||||||
TextChanged="OnNameEntryTextChanged" />
|
|
||||||
<Label x:Name="EntryOutput"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
|
|
||||||
<Entry Placeholder="Enter your email..."
|
|
||||||
FontSize="14"
|
|
||||||
Keyboard="Email" />
|
|
||||||
<Label Text="Email keyboard type"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
|
|
||||||
<Entry Placeholder="Enter password..."
|
|
||||||
FontSize="14"
|
|
||||||
IsPassword="True" />
|
|
||||||
<Label Text="Password field (text hidden)"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
|
|
||||||
<!-- SearchBar Section -->
|
|
||||||
<BoxView HeightRequest="1" Color="#E0E0E0" />
|
|
||||||
<Label Text="SearchBar" FontSize="18" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<SearchBar x:Name="DemoSearchBar"
|
|
||||||
Placeholder="Search for items..."
|
|
||||||
TextChanged="OnSearchTextChanged"
|
|
||||||
SearchButtonPressed="OnSearchButtonPressed" />
|
|
||||||
<Label x:Name="SearchOutput"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
|
|
||||||
<!-- Editor Section -->
|
|
||||||
<BoxView HeightRequest="1" Color="#E0E0E0" />
|
|
||||||
<Label Text="Editor (Multi-line)" FontSize="18" FontAttributes="Bold" />
|
|
||||||
|
|
||||||
<Editor x:Name="DemoEditor"
|
|
||||||
Placeholder="Enter multiple lines of text here... Press Enter to create new lines."
|
|
||||||
HeightRequest="120"
|
|
||||||
FontSize="14"
|
|
||||||
TextChanged="OnEditorTextChanged" />
|
|
||||||
<Label x:Name="EditorOutput"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{StaticResource TextSecondary}" />
|
|
||||||
|
|
||||||
<!-- Keyboard Shortcuts Info -->
|
|
||||||
<BoxView HeightRequest="1" Color="#E0E0E0" />
|
|
||||||
<Border BackgroundColor="#E3F2FD"
|
|
||||||
Padding="15"
|
|
||||||
StrokeThickness="0">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<VerticalStackLayout Spacing="5">
|
|
||||||
<Label Text="Keyboard Shortcuts" FontAttributes="Bold" />
|
|
||||||
<Label Text="Ctrl+A: Select all" />
|
|
||||||
<Label Text="Ctrl+C: Copy" />
|
|
||||||
<Label Text="Ctrl+V: Paste" />
|
|
||||||
<Label Text="Ctrl+X: Cut" />
|
|
||||||
<Label Text="Home/End: Move to start/end" />
|
|
||||||
<Label Text="Shift+Arrow: Select text" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</ScrollView>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace ShellDemo.Pages;
|
|
||||||
|
|
||||||
public partial class TextInputPage : ContentPage
|
|
||||||
{
|
|
||||||
public TextInputPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnNameEntryTextChanged(object? sender, TextChangedEventArgs e)
|
|
||||||
{
|
|
||||||
EntryOutput.Text = $"You typed: {e.NewTextValue}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnSearchTextChanged(object? sender, TextChangedEventArgs e)
|
|
||||||
{
|
|
||||||
SearchOutput.Text = $"Searching: {e.NewTextValue}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnSearchButtonPressed(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
SearchOutput.Text = $"Search submitted: {DemoSearchBar.Text}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnEditorTextChanged(object? sender, TextChangedEventArgs e)
|
|
||||||
{
|
|
||||||
var lineCount = string.IsNullOrEmpty(e.NewTextValue) ? 0 : e.NewTextValue.Split('\n').Length;
|
|
||||||
EditorOutput.Text = $"Lines: {lineCount}, Characters: {e.NewTextValue?.Length ?? 0}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using Microsoft.Maui.Platform.Linux.Hosting;
|
|
||||||
|
|
||||||
namespace ShellDemo;
|
|
||||||
|
|
||||||
public class Program
|
|
||||||
{
|
|
||||||
[STAThread]
|
|
||||||
public static void Main(string[] args)
|
|
||||||
{
|
|
||||||
LinuxProgramHost.Run(args, MauiProgram.CreateMauiApp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<RootNamespace>ShellDemo</RootNamespace>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<UseMaui>true</UseMaui>
|
|
||||||
<ApplicationTitle>OpenMaui Controls Demo</ApplicationTitle>
|
|
||||||
<ApplicationId>com.openmaui.shelldemo</ApplicationId>
|
|
||||||
<ApplicationVersion>1.0</ApplicationVersion>
|
|
||||||
<SupportedOSPlatformVersion>9.0</SupportedOSPlatformVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\OpenMaui.Controls.Linux.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="TodoApp.App">
|
|
||||||
<Application.Resources>
|
|
||||||
<ResourceDictionary>
|
|
||||||
<!-- Primary Colors -->
|
|
||||||
<Color x:Key="PrimaryColor">#5C6BC0</Color>
|
|
||||||
<Color x:Key="PrimaryDarkColor">#3949AB</Color>
|
|
||||||
<Color x:Key="AccentColor">#26A69A</Color>
|
|
||||||
<Color x:Key="DangerColor">#EF5350</Color>
|
|
||||||
|
|
||||||
<!-- Page Backgrounds -->
|
|
||||||
<Color x:Key="PageBackgroundLight">#F5F5F5</Color>
|
|
||||||
<Color x:Key="PageBackgroundDark">#1E1E1E</Color>
|
|
||||||
|
|
||||||
<!-- Card/Surface Backgrounds -->
|
|
||||||
<Color x:Key="CardBackgroundLight">#FFFFFF</Color>
|
|
||||||
<Color x:Key="CardBackgroundDark">#2D2D2D</Color>
|
|
||||||
|
|
||||||
<!-- Input Backgrounds -->
|
|
||||||
<Color x:Key="InputBackgroundLight">#FFFFFF</Color>
|
|
||||||
<Color x:Key="InputBackgroundDark">#3D3D3D</Color>
|
|
||||||
|
|
||||||
<!-- Text Colors -->
|
|
||||||
<Color x:Key="TextPrimaryLight">#212121</Color>
|
|
||||||
<Color x:Key="TextPrimaryDark">#FFFFFF</Color>
|
|
||||||
<Color x:Key="TextSecondaryLight">#757575</Color>
|
|
||||||
<Color x:Key="TextSecondaryDark">#B0B0B0</Color>
|
|
||||||
|
|
||||||
<!-- Border Colors -->
|
|
||||||
<Color x:Key="BorderLight">#E0E0E0</Color>
|
|
||||||
<Color x:Key="BorderDark">#424242</Color>
|
|
||||||
|
|
||||||
<!-- Footer/Status Bar -->
|
|
||||||
<Color x:Key="FooterBackgroundLight">#5C6BC0</Color>
|
|
||||||
<Color x:Key="FooterBackgroundDark">#3949AB</Color>
|
|
||||||
</ResourceDictionary>
|
|
||||||
</Application.Resources>
|
|
||||||
</Application>
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
using Microsoft.Maui.ApplicationModel;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace TodoApp;
|
|
||||||
|
|
||||||
public partial class App : Application
|
|
||||||
{
|
|
||||||
public App()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
UserAppTheme = AppTheme.Light;
|
|
||||||
MainPage = new NavigationPage(new TodoListPage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using Microsoft.Maui;
|
|
||||||
using Microsoft.Maui.Controls.Hosting;
|
|
||||||
using Microsoft.Maui.Hosting;
|
|
||||||
using Microsoft.Maui.Platform.Linux.Hosting;
|
|
||||||
|
|
||||||
namespace TodoApp;
|
|
||||||
|
|
||||||
public static class MauiProgram
|
|
||||||
{
|
|
||||||
public static MauiApp CreateMauiApp()
|
|
||||||
{
|
|
||||||
var builder = MauiApp.CreateBuilder();
|
|
||||||
builder
|
|
||||||
.UseMauiApp<App>()
|
|
||||||
.UseLinuxPlatform()
|
|
||||||
.ConfigureFonts(fonts =>
|
|
||||||
{
|
|
||||||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
|
||||||
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
|
|
||||||
});
|
|
||||||
|
|
||||||
return builder.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="TodoApp.NewTodoPage"
|
|
||||||
Title="New Task"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource PageBackgroundLight}, Dark={StaticResource PageBackgroundDark}}">
|
|
||||||
|
|
||||||
<ContentPage.ToolbarItems>
|
|
||||||
<ToolbarItem IconImageSource="icon_save_light.svg" Clicked="OnSaveClicked" />
|
|
||||||
</ContentPage.ToolbarItems>
|
|
||||||
|
|
||||||
<Grid RowDefinitions="Auto,Auto,*"
|
|
||||||
RowSpacing="16"
|
|
||||||
Padding="20">
|
|
||||||
|
|
||||||
<!-- Title Section -->
|
|
||||||
<VerticalStackLayout Grid.Row="0" Spacing="8">
|
|
||||||
<Label Text="TITLE"
|
|
||||||
FontSize="13"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
|
|
||||||
<Border BackgroundColor="{AppThemeBinding Light={StaticResource CardBackgroundLight}, Dark={StaticResource CardBackgroundDark}}"
|
|
||||||
Stroke="{AppThemeBinding Light={StaticResource BorderLight}, Dark={StaticResource BorderDark}}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16,12">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="10" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<Entry x:Name="TitleEntry"
|
|
||||||
Placeholder="What needs to be done?"
|
|
||||||
FontSize="18"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource InputBackgroundLight}, Dark={StaticResource InputBackgroundDark}}"
|
|
||||||
TextColor="{AppThemeBinding Light={StaticResource TextPrimaryLight}, Dark={StaticResource TextPrimaryDark}}"
|
|
||||||
PlaceholderColor="{AppThemeBinding Light={StaticResource TextSecondaryLight}, Dark={StaticResource TextSecondaryDark}}" />
|
|
||||||
</Border>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
|
|
||||||
<!-- Notes Label -->
|
|
||||||
<Label Grid.Row="1"
|
|
||||||
Text="NOTES"
|
|
||||||
FontSize="13"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
|
|
||||||
<!-- Notes Section -->
|
|
||||||
<Border Grid.Row="2"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource CardBackgroundLight}, Dark={StaticResource CardBackgroundDark}}"
|
|
||||||
Stroke="{AppThemeBinding Light={StaticResource BorderLight}, Dark={StaticResource BorderDark}}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16,12">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="10" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<Editor x:Name="NotesEditor"
|
|
||||||
Placeholder="Add notes (optional)..."
|
|
||||||
FontSize="14"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource InputBackgroundLight}, Dark={StaticResource InputBackgroundDark}}"
|
|
||||||
TextColor="{AppThemeBinding Light={StaticResource TextPrimaryLight}, Dark={StaticResource TextPrimaryDark}}"
|
|
||||||
PlaceholderColor="{AppThemeBinding Light={StaticResource TextSecondaryLight}, Dark={StaticResource TextSecondaryDark}}"
|
|
||||||
VerticalOptions="Fill" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
using Microsoft.Maui.Graphics;
|
|
||||||
|
|
||||||
namespace TodoApp;
|
|
||||||
|
|
||||||
public partial class NewTodoPage : ContentPage
|
|
||||||
{
|
|
||||||
private readonly TodoService _service = TodoService.Instance;
|
|
||||||
|
|
||||||
public NewTodoPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnSaveClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var title = TitleEntry.Text?.Trim();
|
|
||||||
if (string.IsNullOrEmpty(title))
|
|
||||||
{
|
|
||||||
TitleEntry.Placeholder = "Title is required!";
|
|
||||||
TitleEntry.PlaceholderColor = Colors.Red;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_service.AddTodo(title, NotesEditor.Text ?? "");
|
|
||||||
await Navigation.PopAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using Microsoft.Maui.Platform.Linux.Hosting;
|
|
||||||
|
|
||||||
namespace TodoApp;
|
|
||||||
|
|
||||||
public class Program
|
|
||||||
{
|
|
||||||
[STAThread]
|
|
||||||
public static void Main(string[] args)
|
|
||||||
{
|
|
||||||
LinuxProgramHost.Run(args, MauiProgram.CreateMauiApp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#5C6BC0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
||||||
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
||||||
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 278 B |
@@ -1,6 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#E57373" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
||||||
<polyline points="3 6 5 6 21 6"></polyline>
|
|
||||||
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
|
||||||
<line x1="10" y1="11" x2="10" y2="17"></line>
|
|
||||||
<line x1="14" y1="11" x2="14" y2="17"></line>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 425 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#5C6BC0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
||||||
<polyline points="20 6 9 17 4 12"></polyline>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 232 B |
@@ -1,24 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<RootNamespace>TodoApp</RootNamespace>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<UseMaui>true</UseMaui>
|
|
||||||
<ApplicationTitle>Todo App</ApplicationTitle>
|
|
||||||
<ApplicationId>com.openmaui.todoapp</ApplicationId>
|
|
||||||
<ApplicationVersion>1.0</ApplicationVersion>
|
|
||||||
<SupportedOSPlatformVersion>9.0</SupportedOSPlatformVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\OpenMaui.Controls.Linux.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<MauiImage Include="Resources\Images\*" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="TodoApp.TodoDetailPage"
|
|
||||||
Title="Task Details"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource PageBackgroundLight}, Dark={StaticResource PageBackgroundDark}}">
|
|
||||||
|
|
||||||
<ContentPage.ToolbarItems>
|
|
||||||
<ToolbarItem IconImageSource="icon_delete_light.svg" Clicked="OnDeleteClicked" />
|
|
||||||
<ToolbarItem IconImageSource="icon_save_light.svg" Clicked="OnSaveClicked" />
|
|
||||||
</ContentPage.ToolbarItems>
|
|
||||||
|
|
||||||
<Grid RowDefinitions="Auto,Auto,*,Auto,Auto"
|
|
||||||
RowSpacing="16"
|
|
||||||
Padding="20">
|
|
||||||
|
|
||||||
<!-- Title Section -->
|
|
||||||
<VerticalStackLayout Grid.Row="0" Spacing="8">
|
|
||||||
<Label Text="TITLE"
|
|
||||||
FontSize="13"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
|
|
||||||
<Border BackgroundColor="{AppThemeBinding Light={StaticResource CardBackgroundLight}, Dark={StaticResource CardBackgroundDark}}"
|
|
||||||
Stroke="{AppThemeBinding Light={StaticResource BorderLight}, Dark={StaticResource BorderDark}}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16,12">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="10" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<Entry x:Name="TitleEntry"
|
|
||||||
FontSize="18"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource InputBackgroundLight}, Dark={StaticResource InputBackgroundDark}}"
|
|
||||||
TextColor="{AppThemeBinding Light={StaticResource TextPrimaryLight}, Dark={StaticResource TextPrimaryDark}}" />
|
|
||||||
</Border>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
|
|
||||||
<!-- Notes Label -->
|
|
||||||
<Label Grid.Row="1"
|
|
||||||
Text="NOTES"
|
|
||||||
FontSize="13"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
|
|
||||||
<!-- Notes Section -->
|
|
||||||
<Border Grid.Row="2"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource CardBackgroundLight}, Dark={StaticResource CardBackgroundDark}}"
|
|
||||||
Stroke="{AppThemeBinding Light={StaticResource BorderLight}, Dark={StaticResource BorderDark}}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16,12">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="10" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<Editor x:Name="NotesEditor"
|
|
||||||
FontSize="14"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource InputBackgroundLight}, Dark={StaticResource InputBackgroundDark}}"
|
|
||||||
TextColor="{AppThemeBinding Light={StaticResource TextPrimaryLight}, Dark={StaticResource TextPrimaryDark}}"
|
|
||||||
VerticalOptions="Fill" />
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Status Section -->
|
|
||||||
<VerticalStackLayout Grid.Row="3" Spacing="8">
|
|
||||||
<Label Text="STATUS"
|
|
||||||
FontSize="13"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{StaticResource PrimaryColor}" />
|
|
||||||
|
|
||||||
<Border BackgroundColor="{AppThemeBinding Light={StaticResource CardBackgroundLight}, Dark={StaticResource CardBackgroundDark}}"
|
|
||||||
Stroke="{AppThemeBinding Light={StaticResource BorderLight}, Dark={StaticResource BorderDark}}"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Padding="16,12">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="10" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<HorizontalStackLayout Spacing="12">
|
|
||||||
<CheckBox x:Name="CompletedCheckBox"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
<Label Text="In Progress"
|
|
||||||
FontSize="16"
|
|
||||||
VerticalOptions="Center"
|
|
||||||
TextColor="{AppThemeBinding Light={StaticResource TextPrimaryLight}, Dark={StaticResource TextPrimaryDark}}" />
|
|
||||||
</HorizontalStackLayout>
|
|
||||||
</Border>
|
|
||||||
</VerticalStackLayout>
|
|
||||||
|
|
||||||
<!-- Created Date -->
|
|
||||||
<Label x:Name="CreatedLabel"
|
|
||||||
Grid.Row="4"
|
|
||||||
HorizontalOptions="Center"
|
|
||||||
FontSize="12"
|
|
||||||
TextColor="{AppThemeBinding Light={StaticResource TextSecondaryLight}, Dark={StaticResource TextSecondaryDark}}" />
|
|
||||||
</Grid>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace TodoApp;
|
|
||||||
|
|
||||||
public partial class TodoDetailPage : ContentPage
|
|
||||||
{
|
|
||||||
private readonly TodoService _service = TodoService.Instance;
|
|
||||||
private readonly TodoItem _item;
|
|
||||||
|
|
||||||
public TodoDetailPage(TodoItem item)
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
_item = item;
|
|
||||||
|
|
||||||
TitleEntry.Text = item.Title;
|
|
||||||
NotesEditor.Text = item.Notes;
|
|
||||||
CompletedCheckBox.IsChecked = item.IsCompleted;
|
|
||||||
CreatedLabel.Text = $"Created {item.CreatedAt:MMMM d, yyyy} at {item.CreatedAt:h:mm tt}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnSaveClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
_item.Title = TitleEntry.Text ?? "";
|
|
||||||
_item.Notes = NotesEditor.Text ?? "";
|
|
||||||
_item.IsCompleted = CompletedCheckBox.IsChecked;
|
|
||||||
await Navigation.PopAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnDeleteClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
bool confirm = await DisplayAlert("Delete Task",
|
|
||||||
"Are you sure you want to delete this task?",
|
|
||||||
"Delete", "Cancel");
|
|
||||||
|
|
||||||
if (confirm)
|
|
||||||
{
|
|
||||||
_service.RemoveTodo(_item);
|
|
||||||
await Navigation.PopAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.ComponentModel;
|
|
||||||
|
|
||||||
namespace TodoApp;
|
|
||||||
|
|
||||||
public class TodoItem : INotifyPropertyChanged
|
|
||||||
{
|
|
||||||
private string _title = "";
|
|
||||||
private string _notes = "";
|
|
||||||
private bool _isCompleted;
|
|
||||||
private int _index;
|
|
||||||
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
public int Index
|
|
||||||
{
|
|
||||||
get => _index;
|
|
||||||
set { if (_index != value) { _index = value; OnPropertyChanged(nameof(Index)); } }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Title
|
|
||||||
{
|
|
||||||
get => _title;
|
|
||||||
set { if (_title != value) { _title = value; OnPropertyChanged(nameof(Title)); } }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Notes
|
|
||||||
{
|
|
||||||
get => _notes;
|
|
||||||
set { if (_notes != value) { _notes = value; OnPropertyChanged(nameof(Notes)); } }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsCompleted
|
|
||||||
{
|
|
||||||
get => _isCompleted;
|
|
||||||
set { if (_isCompleted != value) { _isCompleted = value; OnPropertyChanged(nameof(IsCompleted)); } }
|
|
||||||
}
|
|
||||||
|
|
||||||
public DateTime CreatedAt { get; set; } = DateTime.Now;
|
|
||||||
|
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
|
||||||
|
|
||||||
protected void OnPropertyChanged(string propertyName)
|
|
||||||
{
|
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
<?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:local="clr-namespace:TodoApp"
|
|
||||||
x:Class="TodoApp.TodoListPage"
|
|
||||||
Title="My Tasks"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource PageBackgroundLight}, Dark={StaticResource PageBackgroundDark}}">
|
|
||||||
|
|
||||||
<ContentPage.ToolbarItems>
|
|
||||||
<ToolbarItem Text="+" Clicked="OnAddClicked" />
|
|
||||||
</ContentPage.ToolbarItems>
|
|
||||||
|
|
||||||
<Grid RowDefinitions="*,Auto">
|
|
||||||
<!-- Task List -->
|
|
||||||
<CollectionView x:Name="TodoCollectionView"
|
|
||||||
Grid.Row="0"
|
|
||||||
SelectionMode="None">
|
|
||||||
<CollectionView.ItemTemplate>
|
|
||||||
<DataTemplate x:DataType="local:TodoItem">
|
|
||||||
<Grid Padding="16,8">
|
|
||||||
<Border BackgroundColor="{AppThemeBinding Light={StaticResource CardBackgroundLight}, Dark={StaticResource CardBackgroundDark}}"
|
|
||||||
Stroke="{AppThemeBinding Light={StaticResource BorderLight}, Dark={StaticResource BorderDark}}"
|
|
||||||
StrokeThickness="0"
|
|
||||||
Padding="0">
|
|
||||||
<Border.StrokeShape>
|
|
||||||
<RoundRectangle CornerRadius="8" />
|
|
||||||
</Border.StrokeShape>
|
|
||||||
<Grid ColumnDefinitions="4,*">
|
|
||||||
<!-- Accent Border -->
|
|
||||||
<BoxView Grid.Column="0"
|
|
||||||
Color="{StaticResource PrimaryColor}"
|
|
||||||
WidthRequest="4" />
|
|
||||||
|
|
||||||
<!-- Content -->
|
|
||||||
<VerticalStackLayout Grid.Column="1"
|
|
||||||
Padding="16,12"
|
|
||||||
Spacing="4">
|
|
||||||
<Label Text="{Binding Title}"
|
|
||||||
FontSize="16"
|
|
||||||
FontAttributes="Bold"
|
|
||||||
TextColor="{AppThemeBinding Light={StaticResource TextPrimaryLight}, Dark={StaticResource TextPrimaryDark}}" />
|
|
||||||
<Label Text="{Binding Notes}"
|
|
||||||
FontSize="14"
|
|
||||||
MaxLines="2"
|
|
||||||
LineBreakMode="TailTruncation"
|
|
||||||
TextColor="{AppThemeBinding Light={StaticResource TextSecondaryLight}, Dark={StaticResource TextSecondaryDark}}" />
|
|
||||||
</VerticalStackLayout>
|
|
||||||
</Grid>
|
|
||||||
<Border.GestureRecognizers>
|
|
||||||
<TapGestureRecognizer Tapped="OnItemTapped" CommandParameter="{Binding .}" />
|
|
||||||
</Border.GestureRecognizers>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</CollectionView.ItemTemplate>
|
|
||||||
</CollectionView>
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<Grid Grid.Row="1"
|
|
||||||
ColumnDefinitions="*,Auto,Auto"
|
|
||||||
Padding="16,12"
|
|
||||||
ColumnSpacing="16"
|
|
||||||
BackgroundColor="{StaticResource PrimaryColor}">
|
|
||||||
|
|
||||||
<Label x:Name="StatsLabel"
|
|
||||||
Grid.Column="0"
|
|
||||||
Text="Tasks: 0 of 3"
|
|
||||||
TextColor="White"
|
|
||||||
FontSize="14"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
|
|
||||||
<Label Grid.Column="1"
|
|
||||||
Text="💡"
|
|
||||||
FontSize="20"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
|
|
||||||
<Switch x:Name="ThemeSwitch"
|
|
||||||
Grid.Column="2"
|
|
||||||
Toggled="OnThemeToggled"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Maui.ApplicationModel;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace TodoApp;
|
|
||||||
|
|
||||||
public partial class TodoListPage : ContentPage
|
|
||||||
{
|
|
||||||
private readonly TodoService _service = TodoService.Instance;
|
|
||||||
private bool _isNavigating;
|
|
||||||
|
|
||||||
public TodoListPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
TodoCollectionView.ItemsSource = _service.Todos;
|
|
||||||
UpdateStats();
|
|
||||||
ThemeSwitch.IsToggled = Application.Current?.UserAppTheme == AppTheme.Dark;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnAppearing()
|
|
||||||
{
|
|
||||||
base.OnAppearing();
|
|
||||||
_isNavigating = false;
|
|
||||||
_service.RefreshIndexes();
|
|
||||||
TodoCollectionView.ItemsSource = null;
|
|
||||||
TodoCollectionView.ItemsSource = _service.Todos;
|
|
||||||
UpdateStats();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnThemeToggled(object? sender, ToggledEventArgs e)
|
|
||||||
{
|
|
||||||
if (Application.Current != null)
|
|
||||||
{
|
|
||||||
Application.Current.UserAppTheme = e.Value ? AppTheme.Dark : AppTheme.Light;
|
|
||||||
// Refresh to apply theme
|
|
||||||
var items = TodoCollectionView.ItemsSource;
|
|
||||||
TodoCollectionView.ItemsSource = null;
|
|
||||||
TodoCollectionView.ItemsSource = items;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnAddClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
await Navigation.PushAsync(new NewTodoPage());
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnItemTapped(object? sender, TappedEventArgs e)
|
|
||||||
{
|
|
||||||
if (_isNavigating || e.Parameter is not TodoItem todoItem)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_isNavigating = true;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await Navigation.PushAsync(new TodoDetailPage(todoItem));
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
_isNavigating = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateStats()
|
|
||||||
{
|
|
||||||
int completed = _service.CompletedCount;
|
|
||||||
int total = _service.TotalCount;
|
|
||||||
StatsLabel.Text = total == 0 ? "" : $"Tasks: {completed} of {total}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace TodoApp;
|
|
||||||
|
|
||||||
public class TodoService
|
|
||||||
{
|
|
||||||
private static TodoService? _instance;
|
|
||||||
public static TodoService Instance => _instance ??= new TodoService();
|
|
||||||
|
|
||||||
public ObservableCollection<TodoItem> Todos { get; } = new();
|
|
||||||
|
|
||||||
private int _nextId = 1;
|
|
||||||
|
|
||||||
private TodoService()
|
|
||||||
{
|
|
||||||
// Add sample data
|
|
||||||
AddTodo("Learn OpenMaui Linux",
|
|
||||||
"Explore the SkiaSharp-based rendering engine for .NET MAUI on Linux desktop. " +
|
|
||||||
"This is a very long description that should wrap to multiple lines and demonstrate " +
|
|
||||||
"the ellipsis truncation feature when MaxLines is set to 2.");
|
|
||||||
AddTodo("Build amazing apps",
|
|
||||||
"Create cross-platform applications that run on Windows, macOS, iOS, Android, and Linux! " +
|
|
||||||
"With OpenMaui, you can write once and deploy everywhere.");
|
|
||||||
AddTodo("Share with the community",
|
|
||||||
"Contribute to the open-source project and help others build great Linux apps. " +
|
|
||||||
"Join our growing community of developers who are passionate about bringing .NET MAUI to Linux.");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddTodo(string title, string notes)
|
|
||||||
{
|
|
||||||
var todo = new TodoItem
|
|
||||||
{
|
|
||||||
Id = _nextId++,
|
|
||||||
Title = title,
|
|
||||||
Notes = notes,
|
|
||||||
Index = Todos.Count
|
|
||||||
};
|
|
||||||
Todos.Add(todo);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RemoveTodo(TodoItem item)
|
|
||||||
{
|
|
||||||
Todos.Remove(item);
|
|
||||||
RefreshIndexes();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RefreshIndexes()
|
|
||||||
{
|
|
||||||
for (int i = 0; i < Todos.Count; i++)
|
|
||||||
{
|
|
||||||
Todos[i].Index = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int CompletedCount => Todos.Count(t => t.IsCompleted);
|
|
||||||
public int TotalCount => Todos.Count;
|
|
||||||
}
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="XamlBrowser.BrowserApp">
|
|
||||||
<Application.Resources>
|
|
||||||
<ResourceDictionary>
|
|
||||||
<!-- Primary Colors -->
|
|
||||||
<Color x:Key="PrimaryColor">#1A73E8</Color>
|
|
||||||
<Color x:Key="PrimaryDarkColor">#8AB4F8</Color>
|
|
||||||
|
|
||||||
<!-- Page Backgrounds -->
|
|
||||||
<Color x:Key="PageBackgroundLight">#FFFFFF</Color>
|
|
||||||
<Color x:Key="PageBackgroundDark">#202124</Color>
|
|
||||||
|
|
||||||
<!-- Toolbar Backgrounds -->
|
|
||||||
<Color x:Key="ToolbarBackgroundLight">#FFFFFF</Color>
|
|
||||||
<Color x:Key="ToolbarBackgroundDark">#292A2D</Color>
|
|
||||||
|
|
||||||
<!-- Entry Backgrounds -->
|
|
||||||
<Color x:Key="EntryBackgroundLight">#F1F3F4</Color>
|
|
||||||
<Color x:Key="EntryBackgroundDark">#3C4043</Color>
|
|
||||||
|
|
||||||
<!-- Button Backgrounds -->
|
|
||||||
<Color x:Key="ButtonBackgroundLight">#F1F3F4</Color>
|
|
||||||
<Color x:Key="ButtonBackgroundDark">#202124</Color>
|
|
||||||
|
|
||||||
<!-- Text Colors -->
|
|
||||||
<Color x:Key="TextPrimaryLight">#202124</Color>
|
|
||||||
<Color x:Key="TextPrimaryDark">#E8EAED</Color>
|
|
||||||
<Color x:Key="TextSecondaryLight">#5F6368</Color>
|
|
||||||
<Color x:Key="TextSecondaryDark">#9AA0A6</Color>
|
|
||||||
|
|
||||||
<!-- Placeholder Colors -->
|
|
||||||
<Color x:Key="PlaceholderLight">#80868B</Color>
|
|
||||||
<Color x:Key="PlaceholderDark">#9AA0A6</Color>
|
|
||||||
|
|
||||||
<!-- Status Bar Backgrounds -->
|
|
||||||
<Color x:Key="StatusBackgroundLight">#F8F9FA</Color>
|
|
||||||
<Color x:Key="StatusBackgroundDark">#35363A</Color>
|
|
||||||
|
|
||||||
<!-- Navigation Button Style -->
|
|
||||||
<Style x:Key="NavButtonStyle" TargetType="Button">
|
|
||||||
<Setter Property="WidthRequest" Value="40" />
|
|
||||||
<Setter Property="HeightRequest" Value="40" />
|
|
||||||
<Setter Property="CornerRadius" Value="20" />
|
|
||||||
<Setter Property="FontSize" Value="18" />
|
|
||||||
<Setter Property="FontFamily" Value="Segoe UI Symbol, Symbola, DejaVu Sans, sans-serif" />
|
|
||||||
<Setter Property="Padding" Value="0" />
|
|
||||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource ButtonBackgroundLight}, Dark={StaticResource ButtonBackgroundDark}}" />
|
|
||||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource TextPrimaryLight}, Dark={StaticResource TextPrimaryDark}}" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<!-- Go Button Style -->
|
|
||||||
<Style x:Key="GoButtonStyle" TargetType="Button">
|
|
||||||
<Setter Property="WidthRequest" Value="60" />
|
|
||||||
<Setter Property="HeightRequest" Value="36" />
|
|
||||||
<Setter Property="CornerRadius" Value="18" />
|
|
||||||
<Setter Property="FontSize" Value="14" />
|
|
||||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource PrimaryColor}, Dark={StaticResource PrimaryDarkColor}}" />
|
|
||||||
<Setter Property="TextColor" Value="{AppThemeBinding Light=White, Dark=#202124}" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<!-- Address Bar Style -->
|
|
||||||
<Style x:Key="AddressBarStyle" TargetType="Entry">
|
|
||||||
<Setter Property="FontSize" Value="14" />
|
|
||||||
<Setter Property="HeightRequest" Value="36" />
|
|
||||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource EntryBackgroundLight}, Dark={StaticResource EntryBackgroundDark}}" />
|
|
||||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource TextPrimaryLight}, Dark={StaticResource TextPrimaryDark}}" />
|
|
||||||
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource PlaceholderLight}, Dark={StaticResource PlaceholderDark}}" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<!-- Status Label Style -->
|
|
||||||
<Style x:Key="StatusLabelStyle" TargetType="Label">
|
|
||||||
<Setter Property="FontSize" Value="12" />
|
|
||||||
<Setter Property="Padding" Value="8,4" />
|
|
||||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource TextSecondaryLight}, Dark={StaticResource TextSecondaryDark}}" />
|
|
||||||
</Style>
|
|
||||||
</ResourceDictionary>
|
|
||||||
</Application.Resources>
|
|
||||||
</Application>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
using Microsoft.Maui;
|
|
||||||
using Microsoft.Maui.ApplicationModel;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace XamlBrowser;
|
|
||||||
|
|
||||||
public partial class BrowserApp : Application
|
|
||||||
{
|
|
||||||
public BrowserApp()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
UserAppTheme = AppTheme.Dark;
|
|
||||||
MainPage = new MainPage();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ToggleTheme()
|
|
||||||
{
|
|
||||||
UserAppTheme = UserAppTheme == AppTheme.Light ? AppTheme.Dark : AppTheme.Light;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
<?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"
|
|
||||||
x:Class="XamlBrowser.MainPage"
|
|
||||||
Title="XAML Browser"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource PageBackgroundLight}, Dark={StaticResource PageBackgroundDark}}">
|
|
||||||
|
|
||||||
<Grid RowDefinitions="Auto,Auto,*,Auto">
|
|
||||||
|
|
||||||
<!-- Toolbar -->
|
|
||||||
<Grid Grid.Row="0"
|
|
||||||
ColumnDefinitions="Auto,Auto,Auto,Auto,Auto,*,Auto"
|
|
||||||
Padding="12,8"
|
|
||||||
ColumnSpacing="8"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource ToolbarBackgroundLight}, Dark={StaticResource ToolbarBackgroundDark}}">
|
|
||||||
|
|
||||||
<!-- Back Button -->
|
|
||||||
<ImageButton Grid.Column="0"
|
|
||||||
Source="{AppThemeBinding Light=arrow_back_dark.png, Dark=arrow_back_light.png}"
|
|
||||||
WidthRequest="40"
|
|
||||||
HeightRequest="40"
|
|
||||||
CornerRadius="20"
|
|
||||||
Padding="8"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource ButtonBackgroundLight}, Dark={StaticResource ButtonBackgroundDark}}"
|
|
||||||
Clicked="OnBackClicked"
|
|
||||||
AutomationId="BackButton"
|
|
||||||
ToolTipProperties.Text="Go Back" />
|
|
||||||
|
|
||||||
<!-- Forward Button -->
|
|
||||||
<ImageButton Grid.Column="1"
|
|
||||||
Source="{AppThemeBinding Light=arrow_forward_dark.png, Dark=arrow_forward_light.png}"
|
|
||||||
WidthRequest="40"
|
|
||||||
HeightRequest="40"
|
|
||||||
CornerRadius="20"
|
|
||||||
Padding="8"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource ButtonBackgroundLight}, Dark={StaticResource ButtonBackgroundDark}}"
|
|
||||||
Clicked="OnForwardClicked"
|
|
||||||
AutomationId="ForwardButton"
|
|
||||||
ToolTipProperties.Text="Go Forward" />
|
|
||||||
|
|
||||||
<!-- Refresh Button -->
|
|
||||||
<ImageButton Grid.Column="2"
|
|
||||||
Source="{AppThemeBinding Light=refresh_dark.png, Dark=refresh_light.png}"
|
|
||||||
WidthRequest="40"
|
|
||||||
HeightRequest="40"
|
|
||||||
CornerRadius="20"
|
|
||||||
Padding="8"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource ButtonBackgroundLight}, Dark={StaticResource ButtonBackgroundDark}}"
|
|
||||||
Clicked="OnRefreshClicked"
|
|
||||||
AutomationId="RefreshButton"
|
|
||||||
ToolTipProperties.Text="Refresh" />
|
|
||||||
|
|
||||||
<!-- Stop Button -->
|
|
||||||
<ImageButton Grid.Column="3"
|
|
||||||
Source="{AppThemeBinding Light=close_dark.png, Dark=close_light.png}"
|
|
||||||
WidthRequest="40"
|
|
||||||
HeightRequest="40"
|
|
||||||
CornerRadius="20"
|
|
||||||
Padding="8"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource ButtonBackgroundLight}, Dark={StaticResource ButtonBackgroundDark}}"
|
|
||||||
Clicked="OnStopClicked"
|
|
||||||
AutomationId="StopButton"
|
|
||||||
ToolTipProperties.Text="Stop" />
|
|
||||||
|
|
||||||
<!-- Home Button -->
|
|
||||||
<ImageButton Grid.Column="4"
|
|
||||||
Source="{AppThemeBinding Light=home_dark.png, Dark=home_light.png}"
|
|
||||||
WidthRequest="40"
|
|
||||||
HeightRequest="40"
|
|
||||||
CornerRadius="20"
|
|
||||||
Padding="8"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource ButtonBackgroundLight}, Dark={StaticResource ButtonBackgroundDark}}"
|
|
||||||
Clicked="OnHomeClicked"
|
|
||||||
AutomationId="HomeButton"
|
|
||||||
ToolTipProperties.Text="Go Home" />
|
|
||||||
|
|
||||||
<!-- Address Bar -->
|
|
||||||
<Entry x:Name="AddressBar"
|
|
||||||
Grid.Column="5"
|
|
||||||
Style="{StaticResource AddressBarStyle}"
|
|
||||||
Placeholder="Enter URL or search..."
|
|
||||||
Completed="OnAddressBarCompleted"
|
|
||||||
AutomationId="AddressBar" />
|
|
||||||
|
|
||||||
<!-- Go Button -->
|
|
||||||
<Button Grid.Column="6"
|
|
||||||
Text="Go"
|
|
||||||
Style="{StaticResource GoButtonStyle}"
|
|
||||||
Clicked="OnGoClicked"
|
|
||||||
AutomationId="GoButton" />
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<!-- Loading Progress Bar -->
|
|
||||||
<ProgressBar x:Name="LoadingProgress"
|
|
||||||
Grid.Row="1"
|
|
||||||
IsVisible="False"
|
|
||||||
HeightRequest="3"
|
|
||||||
ProgressColor="{AppThemeBinding Light={StaticResource PrimaryColor}, Dark={StaticResource PrimaryDarkColor}}"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource EntryBackgroundLight}, Dark={StaticResource EntryBackgroundDark}}" />
|
|
||||||
|
|
||||||
<!-- WebView -->
|
|
||||||
<WebView x:Name="BrowserWebView"
|
|
||||||
Grid.Row="2"
|
|
||||||
Source="https://openmaui.net"
|
|
||||||
Navigating="OnWebViewNavigating"
|
|
||||||
Navigated="OnWebViewNavigated" />
|
|
||||||
|
|
||||||
<!-- Status Bar -->
|
|
||||||
<Grid Grid.Row="3"
|
|
||||||
ColumnDefinitions="*,Auto"
|
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource StatusBackgroundLight}, Dark={StaticResource StatusBackgroundDark}}">
|
|
||||||
|
|
||||||
<Label x:Name="StatusLabel"
|
|
||||||
Grid.Column="0"
|
|
||||||
Text="Ready"
|
|
||||||
Style="{StaticResource StatusLabelStyle}"
|
|
||||||
VerticalOptions="Center" />
|
|
||||||
|
|
||||||
<ImageButton x:Name="ThemeToggle"
|
|
||||||
Grid.Column="1"
|
|
||||||
Source="{AppThemeBinding Light=dark_mode_dark.png, Dark=light_mode_light.png}"
|
|
||||||
WidthRequest="32"
|
|
||||||
HeightRequest="32"
|
|
||||||
CornerRadius="16"
|
|
||||||
Padding="6"
|
|
||||||
Margin="4"
|
|
||||||
BackgroundColor="Transparent"
|
|
||||||
Clicked="OnThemeToggleClicked"
|
|
||||||
AutomationId="ThemeToggle"
|
|
||||||
ToolTipProperties.Text="Toggle Theme" />
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,128 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Maui;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
|
|
||||||
namespace XamlBrowser;
|
|
||||||
|
|
||||||
public partial class MainPage : ContentPage
|
|
||||||
{
|
|
||||||
private const string HomeUrl = "https://openmaui.net";
|
|
||||||
|
|
||||||
public MainPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
AddressBar.Text = HomeUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnBackClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"[MainPage] OnBackClicked, CanGoBack={BrowserWebView.CanGoBack}");
|
|
||||||
if (BrowserWebView.CanGoBack)
|
|
||||||
{
|
|
||||||
BrowserWebView.GoBack();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnForwardClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"[MainPage] OnForwardClicked, CanGoForward={BrowserWebView.CanGoForward}");
|
|
||||||
if (BrowserWebView.CanGoForward)
|
|
||||||
{
|
|
||||||
BrowserWebView.GoForward();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnRefreshClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Console.WriteLine("[MainPage] OnRefreshClicked");
|
|
||||||
BrowserWebView.Reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnStopClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
LoadingProgress.IsVisible = false;
|
|
||||||
StatusLabel.Text = "Stopped";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnHomeClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
NavigateTo(HomeUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnAddressBarCompleted(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
NavigateTo(AddressBar.Text);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnGoClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
NavigateTo(AddressBar.Text);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NavigateTo(string? url)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(url))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Add protocol if missing
|
|
||||||
if (!url.StartsWith("http://", StringComparison.OrdinalIgnoreCase) &&
|
|
||||||
!url.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
// If it looks like a URL (contains dot and no spaces), add https
|
|
||||||
// Otherwise treat as a search query
|
|
||||||
url = url.Contains('.') && !url.Contains(' ')
|
|
||||||
? "https://" + url
|
|
||||||
: "https://www.google.com/search?q=" + Uri.EscapeDataString(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
AddressBar.Text = url;
|
|
||||||
BrowserWebView.Source = new UrlWebViewSource { Url = url };
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnWebViewNavigating(object? sender, WebNavigatingEventArgs e)
|
|
||||||
{
|
|
||||||
Console.WriteLine("[MainPage] Navigating to: " + e.Url);
|
|
||||||
StatusLabel.Text = $"Loading {e.Url}...";
|
|
||||||
|
|
||||||
// Reset and show progress bar with animation
|
|
||||||
LoadingProgress.AbortAnimation("Progress");
|
|
||||||
LoadingProgress.Progress = 0;
|
|
||||||
LoadingProgress.IsVisible = true;
|
|
||||||
|
|
||||||
// Animate progress from 0 to 90%
|
|
||||||
LoadingProgress.Animate("Progress",
|
|
||||||
new Animation(v => LoadingProgress.Progress = v, 0, 0.9),
|
|
||||||
length: 2000,
|
|
||||||
easing: Easing.CubicOut);
|
|
||||||
|
|
||||||
AddressBar.Text = e.Url;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnWebViewNavigated(object? sender, WebNavigatedEventArgs e)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"[MainPage] Navigated: {e.Url} - Result: {e.Result}");
|
|
||||||
|
|
||||||
StatusLabel.Text = e.Result == WebNavigationResult.Success ? "Done" : $"Error: {e.Result}";
|
|
||||||
|
|
||||||
// Complete progress bar
|
|
||||||
LoadingProgress.AbortAnimation("Progress");
|
|
||||||
LoadingProgress.Progress = 1;
|
|
||||||
AddressBar.Text = e.Url;
|
|
||||||
|
|
||||||
// Hide progress bar after a short delay
|
|
||||||
Dispatcher.DispatchDelayed(TimeSpan.FromMilliseconds(300), () =>
|
|
||||||
{
|
|
||||||
LoadingProgress.IsVisible = false;
|
|
||||||
LoadingProgress.Progress = 0;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnThemeToggleClicked(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (Application.Current is BrowserApp app)
|
|
||||||
{
|
|
||||||
app.ToggleTheme();
|
|
||||||
Console.WriteLine($"[MainPage] Theme changed to: {Application.Current.UserAppTheme}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using Microsoft.Maui;
|
|
||||||
using Microsoft.Maui.Controls.Hosting;
|
|
||||||
using Microsoft.Maui.Hosting;
|
|
||||||
using Microsoft.Maui.Platform.Linux.Hosting;
|
|
||||||
|
|
||||||
namespace XamlBrowser;
|
|
||||||
|
|
||||||
public static class MauiProgram
|
|
||||||
{
|
|
||||||
public static MauiApp CreateMauiApp()
|
|
||||||
{
|
|
||||||
var builder = MauiApp.CreateBuilder();
|
|
||||||
builder
|
|
||||||
.UseMauiApp<BrowserApp>()
|
|
||||||
.UseLinuxPlatform()
|
|
||||||
.ConfigureFonts(fonts =>
|
|
||||||
{
|
|
||||||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
|
||||||
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
|
|
||||||
});
|
|
||||||
|
|
||||||
return builder.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using Microsoft.Maui.Platform.Linux;
|
|
||||||
using Microsoft.Maui.Platform.Linux.Hosting;
|
|
||||||
|
|
||||||
namespace XamlBrowser;
|
|
||||||
|
|
||||||
public class Program
|
|
||||||
{
|
|
||||||
public static void Main(string[] args)
|
|
||||||
{
|
|
||||||
LinuxProgramHost.Run(args, MauiProgram.CreateMauiApp, new LinuxApplicationOptions
|
|
||||||
{
|
|
||||||
Title = "XAML Browser",
|
|
||||||
Width = 1280,
|
|
||||||
Height = 800,
|
|
||||||
UseGtk = true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
||||||
<path fill="#202124" d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 181 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
||||||
<path fill="#E8EAED" d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 181 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
||||||
<path fill="#202124" d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 182 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
||||||
<path fill="#E8EAED" d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 182 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
||||||
<path fill="#202124" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 230 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
||||||
<path fill="#E8EAED" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 230 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
||||||
<path fill="#202124" d="M12 3a9 9 0 109 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 01-4.4 2.26 5.403 5.403 0 01-3.14-9.8c-.44-.06-.9-.1-1.36-.1z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 236 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
||||||
<path fill="#202124" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8h5z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 158 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
||||||
<path fill="#E8EAED" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8h5z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 158 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
||||||
<path fill="#E8EAED" d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 000-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 884 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
||||||
<path fill="#202124" d="M17.65 6.35A7.958 7.958 0 0012 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0112 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 319 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
||||||
<path fill="#E8EAED" d="M17.65 6.35A7.958 7.958 0 0012 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0112 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 319 B |
@@ -1,24 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<RootNamespace>XamlBrowser</RootNamespace>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<UseMaui>true</UseMaui>
|
|
||||||
<ApplicationTitle>XAML Browser</ApplicationTitle>
|
|
||||||
<ApplicationId>com.openmaui.xamlbrowser</ApplicationId>
|
|
||||||
<ApplicationVersion>1.0</ApplicationVersion>
|
|
||||||
<SupportedOSPlatformVersion>9.0</SupportedOSPlatformVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\OpenMaui.Controls.Linux.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<MauiImage Include="Resources\Images\*" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||