9,195 questions
105
votes
4
answers
52k
views
Basic concepts of MVVM-- what should a ViewModel do?
Trying to grasp the concepts of MVVM, I have already read several blogs and looked at a few projects.
From what I understand, a View is dumb, it just knows how to present something that is passed to ...
51
votes
2
answers
23k
views
How can I remove the platforms I do not need to compile for in .net MAUI?
I only want to make a project for MacOS and Windows, no need for Android or iOS. I tried deleting the platforms from the folder called "Platforms" but they seem to regenerate each compile. ...
44
votes
3
answers
29k
views
How to create a background service in .NET Maui
I'm new to mobile app development and am learning .NET Maui. The app I'm creating needs to listen for Accelerometer events, and send a notification to a web service if the events meet certain criteria....
39
votes
13
answers
26k
views
Building Maui MS Tutorial App: Get error APT2260: resource mipmap/appicon and mipmap/appicon_round not found
Most of the posts I found related to this issue were created when Maui was still in beta.
This issue affected the Android build only! The iOS build worked the first time.
Following this Microsoft Maui ...
37
votes
3
answers
49k
views
How do I resolve Unknown PdfException when using itext7 in. net maui
Error returned on return:
Unknown PdfException. - - > System.NotSupportedException:Either itext7.bouncy-castle-adapter or itext7. bouncy-castle-fips-adap...
On line
Var writer = new PdfWriter(...
29
votes
6
answers
22k
views
NETSDK1083: The specified RuntimeIdentifier "win10-x64" is not recognized
When building a .NET MAUI app on Windows using .NET v8.0.100-rc.1.23455.8, I get the following error:
NETSDK1083: The specified RuntimeIdentifier "win10-x64" is not recognized
On the .NET ...
29
votes
2
answers
8k
views
Why do Switch and ListView controls in MAUI not update with 2-way binding?
This question is about two MAUI controls (Switch and ListView) - I'm asking about them both in the same question as I'm expecting the root cause of the problem to be the same for both controls. It's ...
28
votes
6
answers
46k
views
VS 2022 Preview not showing the XAML designer
I've just installed VS 2022 preview to use Maui but there seems no way to see a designer view of the XAML, I want to drag and drop controls onto the page but all I get is an ancient looking XAML text ...
27
votes
1
answer
17k
views
Get Android CurrentActivity in .Net MAUI
I'm porting a Xamarin.Android project to .Net 6.
Because of dependencies, it's not possible to include Xamarin.Essentials in the .Net 6 project.
So I'm switching everything to use the Microsoft.* ...
24
votes
5
answers
25k
views
Device.StartTimer is deprecated in MAUI what is the alternative?
I am trying to port an Xamarin.Forms app to .NET MAUI but have run into the deprecation of Device.StartTimer, whilst this obviously currently still works in MAUI, I am interested to find out what the ...
22
votes
2
answers
19k
views
Injecting services into view models in .NET MAUI app
I'm trying to understand how to implement dependecy injection in a .NET MAUI app.
I have a service class -- and its interface -- that handle my REST calls that looks like this:
public class ...
20
votes
3
answers
18k
views
Publish .net MAUI Application as windows executable
How can I publish a .net MAUI Application to a Single executable? Is this even possible?
I Have an application which I want my friends to use on their Windows PC. Is there any way without using the ...
19
votes
3
answers
14k
views
Specify the color of a SVG image in .NET Maui
.NET MAUI has the ability to use SVG images which is really nice, but I haven't been able to set the color of the SVG image. The official docs state I could use the TintColor in the project file but ...
19
votes
1
answer
14k
views
For Dotnet Maui, what the difference between Application.Current?.Dispatcher.Dispatch(async()) and MainThread.InvokeOnMainThreadAsync
Title says it all, docs don't seem to say which should be preferred. They have the same arguments you can pass basically too.
https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui....
18
votes
1
answer
5k
views
In which package, can I find "AlsoNotifyChangeFor" in .Net MAUI?
I'm using the package CommunityToolkit.Mvvm 8.0.0 in .Net MAUI.
I have a simple class as follows :
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit....
18
votes
4
answers
7k
views
Error publishing .NET MAUI project: the target "_GenerateAppxPackage" does not exist
I have a .NET MAUI project that was created with VS2022 Preview 2, and it builds without errors or warnings and works as expected in the debugger. Prior to updating Visual Studio to Version 17.4.0 ...
17
votes
2
answers
7k
views
Is there a dialog for saving files in .NET MAUI?
.NET MAUI provides a FilePicker to show a native Dialog where you can pick a file from the device.
Is there a way to show a dialog for saving files? (where you can select a path and enter an filename, ...
16
votes
5
answers
7k
views
How to set window title for a MAUI Blazor App targeting Windows?
Ive created a small application from the MAUI Blazor app template in MAUI preview 10 and have it targeted and running on windows. I however wish to set the title of the application which I imagined ...
16
votes
4
answers
23k
views
JS/.NET interact on MAUI WebView
I am migrating our app from Xamarin to MAUI, and I am a bit struggling with migrating the code that handles JS/.NET interactions in a WebView on both Android and iOS. Let's focus on Android. It's ...
15
votes
1
answer
11k
views
.NET MAUI error No parameterless constructor defined for this object [closed]
Occurs when binding my view to the view model.
Error description:
System.MissingMethodException: 'No parameterless constructor defined for type 'yournamespace.view.pagename'.'
15
votes
7
answers
10k
views
AndroidManifest.xml file doesn't exist in default MAUI project
I have created the MAUI project according to the getting started guide:
Installation
Build your first app
It is a default project without any changes.
Now, I am trying to build my project and I get ...
15
votes
1
answer
7k
views
What's the difference between a MAUI class library and a normal class library?
As far as I can tell a MAUI Class Library is a class library in .NET 6, where you can inject platform specific code. But is there really any other difference between a MAUI library and a .NET 6 ...