MorganIGuess
MVVM How to make observablecollection<string> always contain a string
I am trying to figure out how do I make an observablecollection of type string always contain a string without manually listing strings. I want the user to be able to click on a button and type in their own string, but allow the observablecollection to automatically detect a string inside the collection of buttons
218 replies
MVVM Data Binding across multiple content pages in one application not working (.NET Maui)
*Keep in mind I'm also using the CommunityToolkit.Mvvm package in NuGet
Im watching this video on MVVM and binding commands in a class to interact with the user interface and Im confused on why its not working for me. I used the viewmodel of my MainViewModel class and its DataType connected to the class in multiple different contentpages and for some reason its not creating new controls on the collectionview of the target mainpage when I click the button with the binded add command :') Help please?
https://www.youtube.com/watch?v=5Qga2pniN78
The overall problem is: The problem is the commands are not properly binding through multiple content pages, and thus the controls I want to be added to the mainpage can't be added for some reason.
I have my project on github and I will share it for anyone who wants to look at the problem on why the bindings aren't working. Thanks!
374 replies
What is a "DataService" In this context
Im using .net 8 Maui, and I don't know what this article is trying to get when it's asking for a DataService. I copied the code from the article because it seems that it is showing you how to get specific keywords for a search, but the only thing keeping the given code from working is the DataService class, I'm not sure how to make it. Here's the article I used: https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/searchbar?view=net-maui-8.0
43 replies