Questions tagged [community-toolkit-mvvm]

85 questions
0
votes
1 answer

Errors appearing in CommunityToolkit.Mvvm.SourceGenerators after upgrading to version 8.2

After upgrading the Nuget package for CommunityToolkit.MVVM I have started getting errors appearing in the source generators - see screen capture below. Now I can't get rid of them, even downgrading back to version 8.0 doesn't seem to help. I have…
cramar
  • 124
  • 1
  • 16
0
votes
0 answers

MAUI CommunityToolkit Mvvm collectionview doesn't update interface

I have a collection view with buttons in every row, when the button is press, the collectionview hides and then, another collectionview should showup with different data. The problem is this: the second collectionview never showup, it looks like…
KillemAll
  • 633
  • 1
  • 10
  • 25
0
votes
0 answers

Where and how can I scroll to end on a CollectionView with CommunityToo

In my MainPage.xaml, I have a CollectionView that uses a ViewModel to populate:
mirkaim
  • 145
  • 1
  • 10
0
votes
0 answers

How to implement a method when a property changes with CommunityToolkit?

I would like to do something when a bool property changes the value when in the view the user chages the value. I have this: [ObservableProperty] bool _myProperty; private void OnMyPropertyChanged() { //DO SOMEHTING } In some documentation I…
Álvaro García
  • 18,114
  • 30
  • 102
  • 193
0
votes
1 answer

Maui Passing Navigation Parameter Community Toolkit ViewModel

I'm having trouble trying to figure out why I can't get a navigation property to pass to my page in Maui. I do understand that I shouldn't be able to see the property value in the constructor of the navigated to viewmodel but, even when I try to…
beeker
  • 780
  • 4
  • 17
0
votes
2 answers

Using MVVM Communitytoolkit to change property of initialed list of buttons using RelayCommand

I have WPF application with .NETCore 7 and when it load I have view and viewmodel I generate a list of buttons using code in viewmodel as following public partial class DataViewModel : ObservableObject, INavigationAware { private bool…
0
votes
0 answers

Query Parameters in ViewModels in .NET MAUI

In the Podcast sample app, I see that query parameters are received directly in view models -- as you can see here: https://github.com/microsoft/dotnet-podcasts/blob/main/src/Mobile/ViewModels/EpisodeDetailViewModel.cs I tried this in my view model…
Sam
  • 26,817
  • 58
  • 206
  • 383
0
votes
0 answers

Localization of DataAnnotations for data validation

I'm using CommunityToolkit.Mvvm. My class is defined in the following way: public partial class User : ObservableValidator { ... [ObservableProperty] [NotifyDataErrorInfo] [Required(ErrorMessageResourceName =…
537mfb
  • 1,374
  • 1
  • 16
  • 32
0
votes
1 answer

Triggering UI update by changing value in child property of ObservableProperty in .NET MAUI app

I'm using CommunityToolkit.Mvvm in my .NET MAUI app's ViewModel's. One of the ObservableProperty's in my view model looks like this: ... [ObservableProperty] MyClassroomObject myClassroom; ... And MyClassroomObject looks like this: public class…
Sam
  • 26,817
  • 58
  • 206
  • 383
0
votes
0 answers

Mvvm & ObservableCollection in C#

Is this redundant? [ObservableProperty] ObservableCollection countries; I feel like the [ObservableProperty] is not needed since ObservableCollection<> can notify the UI already on its own. Or, an alternative would…
0
votes
0 answers

WPF - Validate all properties on button click

There is a button for further SQL validation, I don't want it to be performed unless user input is correct (no cells in a Datagrid are empty). I have observed that validation raised properly only when cell already has a value and it is removed…
James0n
  • 45
  • 5
0
votes
0 answers

EF Core 8 + MVVM - ObservableCollection gives errors in TPC

I am using EF Core 8 Preview 1.2 and CommunityToolkit.Mvvm 8.1.0 in a WASDK 1.2/WinUI 3 C# desktop app project. Here are my models: public abstract partial class Person : ObservableObject { [ObservableProperty][Key] int personId; …
0
votes
1 answer

Visual Studio mark as error every property of class that inherit by ObservableObject

I have two clsses that inherits by ObservableObject. In the second class I use the first, but Visual Studio mark as error every his property as by attached image. If I run the app, it work fine. I use CommunityToolkit.Mvvm 8.1 version in a Winui3…
Kraken
  • 111
  • 11
0
votes
1 answer

Microsoft Community Toolkit RelayCommands Not Working Properly

We are migrating our WPF project from the MVVMLight library to the Microsoft CommunityToolkit library. We went ahead following the shared Microsoft migration documentation and updated all our (about 1200) commands accordingly. When we got the build…
Unseen
  • 13
  • 5
0
votes
2 answers

WPF Can't Remove Red Border from UserControl

I've built a simple login page and when invalid input is detected, a red border is drawn around the usercontrol. Here is my layout code: