Reconstruct XamlBrowser sample with XAML from decompiled code
Created complete XamlBrowser sample application: - App.xaml: Colors and styles for light/dark theme support - App.xaml.cs: BrowserApp with ToggleTheme() - MainPage.xaml: Toolbar (Back, Forward, Refresh, Stop, Home), address bar, Go button, WebView, status bar with theme toggle - MainPage.xaml.cs: Navigation logic, URL handling, progress animation - MauiProgram.cs: UseLinuxPlatform() configuration - Program.cs: LinuxProgramHost entry point - Resources/Images: 10 SVG icons for toolbar (dark/light variants) UI matches screenshot provided by user: - Dark gray toolbar with navigation buttons - Entry field for URL with rounded corners - Green "Go" button - WebView displaying content - Status bar with theme toggle 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
11
CLAUDE.md
@@ -54,12 +54,17 @@ git branch # Should show: * final
|
|||||||
| NewTodoPage.xaml | [ ] | Add new todo form |
|
| NewTodoPage.xaml | [ ] | Add new todo form |
|
||||||
| TodoDetailPage.xaml | [ ] | Edit todo details |
|
| TodoDetailPage.xaml | [ ] | Edit todo details |
|
||||||
|
|
||||||
### XamlBrowser (app + 1 page)
|
### XamlBrowser (app + 1 page) - COMPLETE
|
||||||
|
|
||||||
| File | Status | Notes |
|
| File | Status | Notes |
|
||||||
|------|--------|-------|
|
|------|--------|-------|
|
||||||
| BrowserApp.xaml | [ ] | Basic app setup |
|
| App.xaml | [x] | Colors, styles (NavButtonStyle, GoButtonStyle, AddressBarStyle, StatusLabelStyle) |
|
||||||
| MainPage.xaml | [ ] | WebView browser |
|
| App.xaml.cs | [x] | BrowserApp with ToggleTheme() |
|
||||||
|
| MainPage.xaml | [x] | Toolbar with nav buttons, address bar, WebView, status bar |
|
||||||
|
| MainPage.xaml.cs | [x] | Navigation logic, progress animation, theme toggle |
|
||||||
|
| MauiProgram.cs | [x] | UseLinuxPlatform() setup |
|
||||||
|
| Program.cs | [x] | LinuxProgramHost entry point |
|
||||||
|
| Resources/Images/*.svg | [x] | 10 toolbar icons (dark/light variants) |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
80
samples/XamlBrowser/App.xaml
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<?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>
|
||||||
20
samples/XamlBrowser/App.xaml.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
133
samples/XamlBrowser/MainPage.xaml
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
<?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>
|
||||||
128
samples/XamlBrowser/MainPage.xaml.cs
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
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}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
24
samples/XamlBrowser/MauiProgram.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
18
samples/XamlBrowser/Program.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
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
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
3
samples/XamlBrowser/Resources/Images/arrow_back_dark.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 181 B |
@@ -0,0 +1,3 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 181 B |
@@ -0,0 +1,3 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 182 B |
@@ -0,0 +1,3 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 182 B |
3
samples/XamlBrowser/Resources/Images/close_dark.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 230 B |
3
samples/XamlBrowser/Resources/Images/close_light.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 230 B |
3
samples/XamlBrowser/Resources/Images/dark_mode_dark.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 236 B |
3
samples/XamlBrowser/Resources/Images/home_dark.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 158 B |
3
samples/XamlBrowser/Resources/Images/home_light.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 158 B |
@@ -0,0 +1,3 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 884 B |
3
samples/XamlBrowser/Resources/Images/refresh_dark.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 319 B |
3
samples/XamlBrowser/Resources/Images/refresh_light.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 319 B |
24
samples/XamlBrowser/XamlBrowser.csproj
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<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>
|
||||||