Define a default namespace for .NET MAUI Blazor controls similar to that of Community Toolkit
See original GitHub issueDescription
Request to consider defining a default HTTP alias for .NET MAUI Blazor controls similar to that of Community Toolkit so that it becomes easier to manage them while using in XAML code
Public API Changes
Instead of the complex xmlns definition with clr-namespace and assembly names as shown in the below example, when defined with appropriate HTTP alias this will become easy to manage.
such as xmlns:b="http://..."
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:b="clr-namespace:Microsoft.AspNetCore.Components.WebView.Maui;assembly=Microsoft.AspNetCore.Components.WebView.Maui"
xmlns:local="clr-namespace:MauiBlazorApp"
x:Class="MauiBlazorApp.MainPage"
BackgroundColor="{DynamicResource PageBackgroundColor}">
<b:BlazorWebView HostPage="wwwroot/index.html">
<b:BlazorWebView.RootComponents>
<b:RootComponent Selector="#app" ComponentType="{x:Type local:Main}" />
</b:BlazorWebView.RootComponents>
</b:BlazorWebView>
</ContentPage>
Intended Use-Case
Allows for quick definition and better source management.
This will result in quite like the community toolkit definition:
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
XAML namespaces - .NET MAUI
The default namespace specifies that elements defined within the XAML file with no prefix refer to .NET Multi-platform App UI (.NET MAUI) ...
Read more >New .Net MAUI App project throws 'The name ...
After changing namespace to MAUI, I updated the Build Action(RightClick on Xaml Page>>Properties>>BuildAction) of XAML Page to MauiXaml and ...
Read more >Introducing MediaElement for .NET MAUI - YouTube
NET MAUI app. In this video I will show you how to get started with this amazing new control that is part of...
Read more >Why Evolve to .NET MAUI?
NET MAUI enables just that and brings Blazor goodness to mobile and desktop through Blazor Hybrid apps. Essentially, .NET MAUI provides the app ......
Read more >Use .NET MAUI for Native, No-Compromise Apps
NET code works the same in .NET MAUI as it does in Blazor, ASP.NET, or any other .NET app. It all uses the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Eilon XmlnsDefinitionAttribute is your friend
Adding the
BlazorWebView
into the same namespace as other .NET MAUI controls certainly helps in managing a common namespace (added OOB in the template itself). 👍