Questions tagged [community-toolkit-mvvm]
85 questions
1
vote
3 answers
RelativeSource in MAUI control not bound
I'm going through simple example explained in video:
https://youtu.be/5Qga2pniN78?t=961
At 16. minute (timestamp in link above), he implements the Delete Command on SwipeItem.
In my local project, everything worked so far, but Delete Command is…

Andrija
- 14,037
- 18
- 60
- 87
1
vote
1 answer
MAUI binding issue
I have a MAUI mobile app that uses CommunityToolkit.Mvvm. On a page, there is a ListView:

David Shochet
- 5,035
- 11
- 57
- 105
1
vote
0 answers
ObservableValidator CustomValidation validates too early
I have a .Net MAUI app that uses CommunityToolkit.Mvvm. The viewmodel is validated using ObservableValidator with custom validation:
public partial class BasePageModel : ObservableValidator
...
public partial class DistributorsLocatorPageModel :…

David Shochet
- 5,035
- 11
- 57
- 105
1
vote
1 answer
How to call events using CommunityToolkit.Mvvm
I am "attempting" to learn the MvvM architecture using C# within a WPF application. I quickly realized that I was writing a tonne of duplication boilerplate thus I decided to install the NuGet CoummunityToolkit.Mvvm to handle the vast majority for…

Shadyjunior
- 437
- 3
- 13
0
votes
0 answers
With the messeger of CommunityToolkit, is it possible to know which is the instace that send the message?
I have an intermediate view model that coordinates the communication between two view model of the same type.
This is the code:
public class DocumentViewModel : ObservableObject
{
[PbservbleProperty]
ObservableCollection…

Álvaro García
- 18,114
- 30
- 102
- 193
0
votes
1 answer
XamarinForms ContentView binding using CommunityToolkit.Mvvm
I have MainPage which contains ContentView Recommendations. MainPage has its own ViewModel, the same as the Recommendations view. In the OnAppearing event of MainPage, I need to call InitializeAsync() method from RecommendationViewModel in order to…

user3569465
- 111
- 4
- 10
0
votes
0 answers
Migrating data binding from MVVMLight to CommunityToolkit.Mvvm
I am attempting to migrate a Xamarin native (Xamarin.iOS and Xamarin.Android) solution from MVVMLight to CommunityToolkit.Mvvm.
I have pored over documentation on this topic here. The docs state that
there are no replacements for platform-specific…

Sasha Borodin
- 193
- 1
- 1
- 8
0
votes
1 answer
Create ViewModel inside ViewModel with IoC
I am using the CommunityToolkit.Mvvm and Microsoft.Extensions.DependencyInjection.
I need to create child ViewModels in a ViewModel as needed.
The Sub-ViewModel is registered with services.AddTransient().
Is it a bad idea to create new…

episode7655
- 3
- 2
0
votes
1 answer
.Net Maui Switch using MVVM Community ToolKit return Object Sender to View Model
I have multiple Switches in a Xaml page and I am struggling to grasp the concept of MVVM when using Switches and handling State Changes etc. I am trying within a view model to capture the object and argument within the ViewModel which is available…

Andy Donegan
- 782
- 1
- 9
- 30
0
votes
0 answers
Is it the messenger of CommunityToolkit singleton?
I would like to use the messenger of the CommunityToolkit to communicate some view models bewteen them.
If I try to define the dependency injection in this way, I get an exception:
services.AddTransient();
Because there is no an…

Álvaro García
- 18,114
- 30
- 102
- 193
0
votes
0 answers
Command Bound to Keyboard Input not Firing
I'm using the MVVM Community toolkit (v 8.2) in a learning project that implements the Risk board game.
I have a working command for some custom buttons, so I know the basics are functioning. But when I add commands bound to Keyboard input, they…
0
votes
1 answer
NET Maui Rebinding ItemsSource programmatically
I hope you can help me. I have a view created in code that is bound to a viewModel and inside the view there is a ListView.
The problem is that my code that adds the controls, including the ListView, is in the view's constructor and has as a…

vordonez
- 5
- 1
0
votes
0 answers
.NET Maui Binding a contentview to parent ViewModel MVVM Programmatically
I have a view of a listView which in turn contains an ItemTemplateSelector. In one of the ItemTemplateSelector I have a ContentView created programmatically that has a BindableProperty that I bind when I'm creating the DataTemplate, but it doesn't…

vordonez
- 5
- 1
0
votes
1 answer
Using MVVM Community Toolkit, how to bind a UserControl Event to a RelayCommand
I try to customize WPF TextBox in order to raise event when the user made change in the user interface (but not on the programmatiques side so not using OnPropertieChanged). The objectif is also to extent this methodologie to other controls like…

Pascal
- 3
- 4
0
votes
1 answer
How to capture the property changed when the property is a nullable value?
I have an entry that binds to a int? property in my view model. The problem is that if at a first time I have a value and I delete it, the notification is not arise to the view model.
I would like that if the user delete the value of the entry, to…

Álvaro García
- 18,114
- 30
- 102
- 193