30,346 questions
0
votes
1
answer
42
views
Android LiveData observe not triggered by postValue()
When my app closes I want to perform some simple post-processing in processResponse(...) in ActivityBase after signing out from Firebase Auth. It actually signs out but this post-processing in ...
0
votes
1
answer
96
views
Correct approach for a datamodel and viewmodel to live side by side in MVVM
I have a datamodel which I want to base a datagrid in a win-ui application on. Normally I would just define the datagrid on the viewmodel, but what would be the correct approach if I want to use the ...
0
votes
1
answer
43
views
Synchronizing context with the database
Desktop; WPF + MVVM, Prism, Entity Framework, UnitOfWork + Repository.
UnitOfWork was initialized on two computers at the same time. someUser was added on the first PC.
How can I get someUser in ...
0
votes
1
answer
210
views
Unable to access observable property in viewmodel from corresponding view .xaml file - .NET MAUI MVVM
I am developing a .NET MAUI application where I am using the MVVM pattern via Community.Toolkit.MVVM nuget package. In the below code, on the MorePage I am trying to bind the title to Forecast.Name, ...
1
vote
1
answer
53
views
Flow not updating when broadcastReceiver is called
I'm new to kotlin and trying to make a reminder app for medicines for a course.
My VM doesn't react to when new names are added into the currentAlerts flow by my alarmReceiver.
The only time 'doing ...
0
votes
1
answer
72
views
How to refresh a observable collection in parent when it's updated in sub page viewmodel?
I have a Maui application with tabs. On the DashboardMainPage, items are displayed in a CollectionView. From this page, I can navigate to a subpage (GoalsPage) where all items can be seen in more ...
0
votes
0
answers
147
views
NET MAUI: Updating properties and enabling commands that depend on observable object fields
As we know, RelayCommand and getter-only properties need to be notified when their dependencies change. That is usually done with NotifyCanExecuteChangedForAttribute and ...
0
votes
1
answer
97
views
Muti Tree View Select and Binding on WPF
I am currently working on a project that involves a multi-tree view selection in a MVVM,WPF application using C#. The tree view supports functionalities such as Cut, Copy, Move, and Paste between ...
0
votes
2
answers
286
views
How to handle Views that display and modify elements from an array in Swift/SwiftUI/MVVM
Pretty basic question, I have professional dev experience but brand new to Swift and still figuring out its design patterns and such. I've been working through the Stanford course. The first couple ...
0
votes
1
answer
732
views
How to implement the TextChanged the CommunityToolkit MVVM way
I am using the .Net Maui's community toolkit and have some mvvm binding going on in a project.
I have a collectionview and a Searchbar connected to a ViewModel. I wish to implement the Searchbar's is ...
0
votes
0
answers
20
views
Invalid custom control data source modification interface [duplicate]
There is a custom control
<ctrls:SearchDefalut Source="{Binding SearchResults}"
Height="40" Width="180"/>
I have a dependent property ...
0
votes
1
answer
785
views
MVVM Toolkit Data Validation and ObservableProperty
I'm working in WPF and using the MVVM community toolkit. Reading the documentation, I understand that I can make validation work by inheriting from ObservableValidator and using this pattern for my ...
0
votes
1
answer
264
views
MVVM: How to handle a List of Models in the ViewModel?
I'm trying to create a MindMap programm using WPF with MVVM.
I have a Model called "NodeModel" that has a list of Child NodeModels.
public class NodeModel
{
public string Content { get; ...
1
vote
1
answer
285
views
How to bind a label text to a method in maui?
I have two models, Unit and Building. In Unit, there is a BuildingId (a foreign key) field which ties to a Building object. I am writing a collection view to display all the Units. I also have a ...
0
votes
1
answer
70
views
Passing ViewModel to View
I have a view model:
@MainActor public class TestViewModel: ObservableObject {
@Published var data: [String: [String]]
init() {
self.data = ["a": ["a1", "...
1
vote
1
answer
47
views
How to pass a string to a view model upon initialization?
I have an iOS app with the following views:
struct LoggedInUserView: View{
@ObservedObject var viewModel: LoggedInUserViewModel
@StateObject var sharedPortionViewModel: SharedPortionViewModel(...
0
votes
0
answers
83
views
MVVM - model to data conversion - service layer vs view model
In our Winui3 application, we are following MVVM architecture. I have InvoiceData, InvoiceModel, InvoiceViewModel and InvoiceService for my Invoice module.
When saving an Invoice from the view model, ...
1
vote
0
answers
189
views
Binding a WinForms DataGridView selected row to an MVVM ViewModel selected item property
Since .NET 7, Microsoft has improved the binding capabilities of Windows Forms to bring it closer to WPF and other XAML technologies: Using Command Binding in Windows Forms apps to go Cross-Platform - ...
0
votes
3
answers
311
views
Maui MVVM: most simple pattern not working
I am working on a tiny addition of a project using the MVVM pattern.
The project is a little bit bigger, but I stripped it down to a tiny sample project to make stuff easier here.
Code
BusyViewModel....
-1
votes
1
answer
758
views
ObservableCollections vs ObservableObject vs ObservableRecipient vs ViewmodelBase?
I am a beginner on using avaloniaUI and the MVVM Community toolkit. Now I'm making a KanbanBoard windows app and coding ViewModels.
I read the SimpleToDoList demo in their github. However I cannot ...
2
votes
1
answer
214
views
Make ComboBox Border red if item is not yet selected
I’m new to C# and WPFs, and honestly just started learning on my own this week. I’m trying to make a drop down menu that highlights red (signaling that this field is required) until an item is ...
3
votes
2
answers
294
views
UserControl not rendering in WPF ContentControl
I am new to WPF and MVVM. I've spent two days scrolling through a bunch of SO q&a's on this topic and I haven't had any success getting this to work. Which inevitably means it's something silly ...
1
vote
1
answer
70
views
Separate DataGrids bound to same Observable Collection
I have a WPF application with a TabControl and on two different TabItems I want to display the same content in a DataGrid on each. The order of operations is as follows:
User selects a signal or ...
0
votes
1
answer
194
views
How to define an interface for methods marked with [RelayCommand]
My team requires interfaces for our ViewModels. I love the MVVM Community Toolkit but I want to use both interfaces and [RelayCommand] Attributed class methods.
How do I define an interface for ...
0
votes
1
answer
85
views
Why does my View still bind successfully to my ViewModel even without explicit DataContext
I'm writing an MVVM application in WinUI3, and I've run into behaviour which I don't understand. Currently my main view hosts a NavigationView control. This control contains a Frame control, who's ...