9,195 questions
7
votes
3
answers
13k
views
MAUI: DependencyService.Get<IMyService>() return null
I'm trying to migrate from Xamarin to MAUI.
The following code woked perfectly.
Xamarin project:
DependencyService.Get<IMyService>().Test();
Android:
[assembly: Dependency(typeof(MyService))]
...
7
votes
2
answers
10k
views
Shell navigation in .NET MAUI to a page with Bottom Tabs
During a login flow, the login page does not normally have bottom tabs which constitute the main flow of the app.
AppShell.xaml
<TabBar>
<ShellContent Title="Home"
...
7
votes
1
answer
10k
views
How to set border radius on SearchBar (.NET MAUI)?
How can I set a border radius on search bar?
I've already tried many ways to change this (for example, tried to explicitly specify the tag < Border >), but there are no tags associated with this ...
7
votes
1
answer
4k
views
.NET MAUI Application class MainPage is Obsolete
I just migrated a small project to .NET 9 and it seems Application classes MainPage is now obselete, cannot find a direct solution for this
My current code:
public App()
{
InitializeComponent();
...
7
votes
2
answers
3k
views
What will happen to custom controls and Renderers in .net maui?
In my Current Xamarin.Forms projects I have created many Renderers for different requirements. Now in September maui is coming and we have to migrate our projects to that. So in that what will happen ...
7
votes
1
answer
7k
views
How do I add new Grid Columns and Rows at runtime in .NET MAUI?
Over time, I have successfully added new child columns and rows to a Grid in a Xamarin.Forms app. I attempt to do the same thing in developing a .NET MAUI app and receive an error with the following ...
7
votes
2
answers
12k
views
.NET MAUI binding ItemSelected event of ListView to ViewModel
I am trying to bind the ItemSelected of a ListView to a View Model, but am experiencing some issues (due to my own misunderstands around how it all works).
I have view:
<?xml version="1.0"...
7
votes
6
answers
7k
views
Visual Studio does not show "Android Local Devices" menu
I'm using visual studio 2022 and MAUI to develop a Android APP, but I can't find the menu for selecting my local Android Device.
I already connected my device with my desktop computer via USB, and ...
7
votes
4
answers
9k
views
Can't load a local html file into a .NET MAUI WebView
I have a basic webpage that I am attempting to load into a WebView on a XAML page. The relevant code is such:
<WebView x:Name="WebViewQuestionText" Source="editor.html" ...
7
votes
6
answers
9k
views
Maui android. Either set MainPage or override CreateWindows
In maui android app, when app was moved to back it occassionally invokes Destroy and bringing app back to front, throws an exeption:
Either set MainPage or override CreateWindows.
protected ...
7
votes
4
answers
3k
views
MAUI: Can I skip building for Android or iOS when I'm building either platform?
Basically the title says all.
MAUI has a single project format for iOS and Android. When I'm debugging on iOS, I don't want MSBuild to build Android as well and vice-versa, because it gets slow.
Other ...
7
votes
2
answers
3k
views
How to disable borders and underlininng of Entry on WIndows .NET MAUI?
I am trying to customize an Entry in MAUI. The main aim is to disable borders and underlining. This is my current code in MauiProgram.cs file:
Microsoft.Maui.Handlers.EntryHandler.Mapper....
7
votes
1
answer
8k
views
.net MAUI Background vs BackgroundColor - what is the difference?
Using Visual Studio Community Edition 2022 to build a .Net MAUI project.
I tried searching the official docs, but did not find an answer. Can someone explain the following?
Questions:
What is the ...
7
votes
3
answers
2k
views
NavigationManager not navigating to a page if the url is the same exept the last part: "/{variable}"
I am building a .NET 6 MAUI Blazor application. The application has a top nav that lets the user go to their profile from wherever in the application he may be in that moment.
Using navigation manager ...
7
votes
3
answers
14k
views
How do I fix below errors with MAUI start up app
I have installed Windows 10 20H2 version in my system. And Visual Studio Professional 2019 and Visual Studio Professional 2019 preview. Followed the below link for MAUI setup.
https://learn.microsoft....
7
votes
3
answers
8k
views
Catch and display on the page any error in a .NET Maui Blazor project
For testing purpose, I would like to 'catch' any error occuring in my app and displaying it on the page (not in the console). For that purpose I discovered the ErrorBoundary component in the .Net 6 ...
7
votes
2
answers
8k
views
MAUI Shell + TabbedPage
I have application based on Shell. Application contains pages with tabs which are defined in Shell. Everything works properly and correctly.
I need create second level page with tabs which contains ...
7
votes
1
answer
3k
views
APP INSTALLER FILE not generated when publishing .Net Maui Application using MSIX
Trying to publish .Net Maui Application using MSIX, but the 'APP INSTALLER FILE' (.appinstaller) and all of it's content isn't generated. I am using the Visual studio method (including SideLoading) of ...
7
votes
2
answers
15k
views
How to use full width in Maui
I often run into confusion when I try to make something take up the full width of a page. For example - I want to draw a line from one side to the other. I have tried with Border and BoxView. However, ...
7
votes
2
answers
2k
views
Deploying .NET MAUI to IOS Simulator Error: simctl returned exit code 22
The Issue
I am having an issue deploying to any iOS simulator using .NET Maui. I receive the following error Failed to install the app 'com.app.name' on the device 'iOS 15.5 - iPhone 11' simctl return ...
7
votes
1
answer
4k
views
.NET 6/7 Migration from System.Drawing.Common to Microsoft.Maui.Graphics
With .NET 7 System.Common.Drawing is no longer useable in not windows platforms. I like to migrate my application to Microsoft.Maui.Graphics (as Microsoft suggests on their breaking changes page for ....
7
votes
4
answers
13k
views
Correct way to use Web Authenticator in .NET MAUI for Google login on Android
I have followed the official documentation of the web authenticator for .NET Maui here. It explains what to do efficiently, but they miss some crucial information regarding the callback URL. According ...
7
votes
2
answers
5k
views
Hooking keyboard events in .NET MAUI (specifically Android)
I'm porting an Android app that I prototyped in Xamarin Forms. The device that I'm targeting has hardware buttons that must trigger actions in the application. In Xamarin I was able to override ...