From 8a36a44341ac7c79a0e63945eedf8c4695ceadec Mon Sep 17 00:00:00 2001 From: Dave Friedel Date: Thu, 1 Jan 2026 18:32:08 -0500 Subject: [PATCH] Reconstruct XamlBrowser sample with XAML from decompiled code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- CLAUDE.md | 11 +- samples/XamlBrowser/App.xaml | 80 +++++++++++ samples/XamlBrowser/App.xaml.cs | 20 +++ samples/XamlBrowser/MainPage.xaml | 133 ++++++++++++++++++ samples/XamlBrowser/MainPage.xaml.cs | 128 +++++++++++++++++ samples/XamlBrowser/MauiProgram.cs | 24 ++++ samples/XamlBrowser/Program.cs | 18 +++ .../Resources/Images/arrow_back_dark.svg | 3 + .../Resources/Images/arrow_back_light.svg | 3 + .../Resources/Images/arrow_forward_dark.svg | 3 + .../Resources/Images/arrow_forward_light.svg | 3 + .../Resources/Images/close_dark.svg | 3 + .../Resources/Images/close_light.svg | 3 + .../Resources/Images/dark_mode_dark.svg | 3 + .../Resources/Images/home_dark.svg | 3 + .../Resources/Images/home_light.svg | 3 + .../Resources/Images/light_mode_light.svg | 3 + .../Resources/Images/refresh_dark.svg | 3 + .../Resources/Images/refresh_light.svg | 3 + samples/XamlBrowser/XamlBrowser.csproj | 24 ++++ 20 files changed, 471 insertions(+), 3 deletions(-) create mode 100644 samples/XamlBrowser/App.xaml create mode 100644 samples/XamlBrowser/App.xaml.cs create mode 100644 samples/XamlBrowser/MainPage.xaml create mode 100644 samples/XamlBrowser/MainPage.xaml.cs create mode 100644 samples/XamlBrowser/MauiProgram.cs create mode 100644 samples/XamlBrowser/Program.cs create mode 100644 samples/XamlBrowser/Resources/Images/arrow_back_dark.svg create mode 100644 samples/XamlBrowser/Resources/Images/arrow_back_light.svg create mode 100644 samples/XamlBrowser/Resources/Images/arrow_forward_dark.svg create mode 100644 samples/XamlBrowser/Resources/Images/arrow_forward_light.svg create mode 100644 samples/XamlBrowser/Resources/Images/close_dark.svg create mode 100644 samples/XamlBrowser/Resources/Images/close_light.svg create mode 100644 samples/XamlBrowser/Resources/Images/dark_mode_dark.svg create mode 100644 samples/XamlBrowser/Resources/Images/home_dark.svg create mode 100644 samples/XamlBrowser/Resources/Images/home_light.svg create mode 100644 samples/XamlBrowser/Resources/Images/light_mode_light.svg create mode 100644 samples/XamlBrowser/Resources/Images/refresh_dark.svg create mode 100644 samples/XamlBrowser/Resources/Images/refresh_light.svg create mode 100644 samples/XamlBrowser/XamlBrowser.csproj diff --git a/CLAUDE.md b/CLAUDE.md index b6160ba..a93d930 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -54,12 +54,17 @@ git branch # Should show: * final | NewTodoPage.xaml | [ ] | Add new todo form | | TodoDetailPage.xaml | [ ] | Edit todo details | -### XamlBrowser (app + 1 page) +### XamlBrowser (app + 1 page) - COMPLETE | File | Status | Notes | |------|--------|-------| -| BrowserApp.xaml | [ ] | Basic app setup | -| MainPage.xaml | [ ] | WebView browser | +| App.xaml | [x] | Colors, styles (NavButtonStyle, GoButtonStyle, AddressBarStyle, StatusLabelStyle) | +| 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) | --- diff --git a/samples/XamlBrowser/App.xaml b/samples/XamlBrowser/App.xaml new file mode 100644 index 0000000..2a41fdf --- /dev/null +++ b/samples/XamlBrowser/App.xaml @@ -0,0 +1,80 @@ + + + + + + #1A73E8 + #8AB4F8 + + + #FFFFFF + #202124 + + + #FFFFFF + #292A2D + + + #F1F3F4 + #3C4043 + + + #F1F3F4 + #202124 + + + #202124 + #E8EAED + #5F6368 + #9AA0A6 + + + #80868B + #9AA0A6 + + + #F8F9FA + #35363A + + + + + + + + + + + + + + + diff --git a/samples/XamlBrowser/App.xaml.cs b/samples/XamlBrowser/App.xaml.cs new file mode 100644 index 0000000..e5e8da6 --- /dev/null +++ b/samples/XamlBrowser/App.xaml.cs @@ -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; + } +} diff --git a/samples/XamlBrowser/MainPage.xaml b/samples/XamlBrowser/MainPage.xaml new file mode 100644 index 0000000..b8a849f --- /dev/null +++ b/samples/XamlBrowser/MainPage.xaml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +