Skip to content

Update sample webapp to mirror MAUI app features and structure#86

Draft
Copilot wants to merge 5 commits into
mainfrom
copilot/fix-85
Draft

Update sample webapp to mirror MAUI app features and structure#86
Copilot wants to merge 5 commits into
mainfrom
copilot/fix-85

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 23, 2025

This PR transforms the sample webapp to be a direct mirror of the MAUI app, implementing all the same features, pages, controls and functionality while using the shared Library project for business logic.

Changes Made

🎯 Core Requirements

  • Direct Mirror: Webapp now has identical features, pages, controls and functionality as MAUI app
  • Library Integration: Uses DeviceTestingKitApp.Library project for shared ViewModels and business logic
  • Same Structure: Mirrors MainPage.xaml layout and component hierarchy exactly
  • Identical Functionality: Counter behavior, display logic, and user interactions match perfectly

🔧 Technical Implementation

Project Dependencies

  • Added reference to DeviceTestingKitApp.Library project
  • Updated Program.cs with same service registration pattern as MauiProgram.cs

ViewModels Integration

  • Uses MainViewModel and CounterViewModel from Library project
  • Proper MVVM pattern with INotifyPropertyChanged support
  • Same business logic and RelayCommand usage as MAUI app

Blazor Components

  • Created CounterView.razor as Blazor equivalent of MAUI CounterView.xaml
  • Implements same counter text logic: "Click me!" → "Clicked X time" → "Clicked X times"
  • Proper data binding with property change notifications

Platform-Specific Services

  • Implemented BlazorSemanticAnnouncer for web-specific accessibility
  • Adapts ISemanticAnnouncer interface for web platform using JavaScript interop

UI Structure
Updated Home.razor to mirror MainPage.xaml exactly:

  • .NET bot image with same alt text
  • "Hello, World!" heading with semantic styling
  • "Welcome to .NET Multi-platform App UI" subheading
  • Counter component with identical layout and behavior

🧪 Verification

  • ✅ Solution builds successfully
  • ✅ Webapp builds and runs without errors
  • ✅ All dependencies resolved correctly
  • ✅ Counter functionality works identically to MAUI app
  • ✅ Uses shared Library project as required
  • ✅ Maintains consistent MVVM architecture

The webapp is now a complete direct mirror of the MAUI app, sharing the same ViewModels and business logic while providing web-specific UI implementations.

Fixes #85.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Copilot AI changed the title [WIP] Update the sample webapp to have the same features as the sample maui app Update sample webapp to mirror MAUI app features and structure Jun 23, 2025
Copilot AI requested a review from mattleibow June 23, 2025 19:30
Copy link
Copy Markdown
Owner

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ok, but we should copy the Maui way and have a razor class library for the Blazor things - just like we have a maui library for the Maui things.

Make sure we have the same sort of projects.

Also, we need to use the same sort of file structure as the Maui library. Controls, converters, features.

Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 23, 2025

This is ok, but we should copy the Maui way and have a razor class library for the Blazor things - just like we have a maui library for the Maui things.

Make sure we have the same sort of projects....

Created DeviceTestingKitApp.BlazorLibrary project that mirrors the MAUI library structure with the same folders: Controls/, Converters/, Features/. Moved all Blazor-specific components from the webapp to this new library and updated all references. The architecture now matches the MAUI pattern exactly. See commit 96f4a3c.

Copilot AI requested a review from mattleibow June 23, 2025 21:05
Comment on lines +16 to +20
{
// In a web context, we can use ARIA live regions or console for accessibility
// For simplicity, we'll use console.log, but in a real app you might want to use ARIA live regions
_ = Task.Run(async () =>
{
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use those live regions as you suggest.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented ARIA live regions for proper accessibility announcements. Created a JavaScript function that uses a visually hidden live region element with aria-live="polite" to announce messages to screen readers instead of console.log. See latest commit.

Comment thread sample/src/DeviceTestingKitApp.BlazorLibrary/Controls/CounterView.razor Outdated
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Copilot AI requested a review from mattleibow June 24, 2025 09:19
Comment thread sample/src/DeviceTestingKitApp.BlazorLibrary/Controls/CounterView.razor Outdated
Comment thread sample/src/DeviceTestingKitApp.WebApp/Components/App.razor Outdated
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Copilot AI requested a review from mattleibow June 25, 2025 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the sample webapp to have the same features as the sample maui app

2 participants