Questions tagged [mvvm]
Model-View-ViewModel (MVVM) is an architectural design pattern for implementing user interfaces that separates the UI (the View) from its data (the Model) via its presentation logic (its ViewModel).
29,982
questions
0
votes
0
answers
18
views
Data binding not working for FragmentA after returning from FragmentB
My app has two fragments: HomeFragment and StatusFragment. HomeFragment binds some connection info to the UI. Info is obtained from broadcast receiver. At the beginning, data binding works in ...
0
votes
1
answer
12
views
Can't run databinding in viewmodel in Android Strudio
I am trying to make an instagram clone. Using mvvm and databinding. My home page is working well but when I go detail page I can't see my post's image,user's email,user's photo. I think databinding is ...
0
votes
1
answer
55
views
WPF Binding not working when using different data model
I'm creating an app which monitors several trace servers on remote machines and displays the processed data on a UI. When I'm using a simulator generating the data everything works as expected. The ...
0
votes
3
answers
38
views
I can't see my recycler view in android studio
I m doing a instagram clone in android studio with kotlin. I am using firebase. The problem is I can't see comment recycler view in post detail screen. I checked my commentList it is true. So my ...
0
votes
0
answers
26
views
Create ItemsControl or Datagrid with matrix model in WPF [closed]
I have 3 class, Members, Sessions & Attendances.
public class Members
{
public string ID { get; set; }
public string ? Name { get; set; }
public string ? Company { get; set; }
}
...
0
votes
1
answer
15
views
WPF DataTable inside of DataRowTemplate in DataRow
i am looking for a infinite nested DataGrid in a DataRowTemplate. So, when clicking onto a Row, i want to have displayed another DataGrid and so on. My main class is "CustomTable" which ...
0
votes
1
answer
38
views
ObservableCollection with [ObservableProperty] attribute does not trigger NotifyCanExecuteChanged when items added or removed from collection
I'm having some issues using an ObservableCollection and CommunityToolkit.Mvvm whereby when the collection is changed (i.e. items added or removed) MyCommand.NotifyCanExecuteChanged is not called.
I ...
0
votes
1
answer
44
views
How can I update the UI (view) based on a method from viewmodel while still following MVVM [duplicate]
I am fairly new to WPF, C#, and the MVVM structure so excuse my ignorance. I am simply trying to create a new tab when a file is opened. My logic is all in the viewmodel including opening files which ...
0
votes
1
answer
43
views
How I can make reusable coroutines?
I'd like to learn more about kotlin, so I've decided to make this post. I'm not sure what should I do with my project at the moment.
Scenario is simple - we have some api call, we have ...
0
votes
0
answers
15
views
WPF DataGrid lose focus on button click
I'm using MVVM for my project, basicaly I have a DataGrid with a number of columns binded to my ViewModel's properties. I have for each row a button with a Validate function which takes the values ...
0
votes
0
answers
34
views
Xamarin.Forms: How to pass data from a Custom View to containing page with correct MVVM?
I am just learning Xamarin.Forms and MVVM (learning by doing), so please excuse my beginner's question:
I have a view A (a page) that calls a custom view B. A has view model ModelA, B has view model ...
-1
votes
1
answer
70
views
Trying to learn WPF and MVVM and having issues with DataContext [duplicate]
Full Code
Hi, im trying to get this textbox in MyAccountView
<User_Controls:ClearableTextBox Margin="5"
x:Name="...
0
votes
3
answers
44
views
iOS - Best way to track multiple loading states of different components within the same ViewModel in SwiftUI & MVVM?
So I basically have one ViewModel for an entire screen which has multiple components with data coming from different API requests / Endpoints.
What im currently doing is having an Observable object to ...
0
votes
0
answers
49
views
How Use Datasets in MVVM .Net WPF
I'm developping an application in VB.net and WPF but i can read C# code
Currently we're using CollectionViewSource and directly fill the dataset. But it seems to not being correct for MVVM and i think ...
0
votes
2
answers
56
views
How to pass TimeSpan data using query property attributes from one XAML Page to the other XAML Page?
Maybe to some of you it might be elemental issue, but I am really at loss to resolve System.InvalidCastException: 'Invalid cast from 'System.String' to 'System.TimeSpan'.
I have two XAML pages, and I ...
1
vote
0
answers
41
views
ViewModel not bound to a view, used more like a Service. Is it a code smell? [closed]
I have a C# MVVM app (Avalonia with ReactiveUI if that matters) in which a user can create, modify and close a project. Different parts of the application need to be notified when a project is un/...
0
votes
0
answers
12
views
Caliburn.Micro-Multiple shell support
I have to develop a WPF application with two windows, main window in primary monitor are other other one in secondary monitor. Uses shall be able to work on each windows independently, but while ...
0
votes
2
answers
70
views
MAUI MVVM Navigation, how to navigate from page back to MainPage
I'm learning how Maui MVVM works. I want to write code that:
starts in MainPage.xaml, where there's a button that takes you to:
FirstPage.xaml, where there's a button that takes you to:
SecondPage....
-2
votes
1
answer
31
views
Binding a component to an element declared in a ViewModel
I have a Menu and a TabbedGroup. When I click on one of the menu options, I want to add a LayoutPanel to the TabbedGroup.
I have the elements inside MainWindow:
<view:UCMainMenu Grid.Row="1&...
-2
votes
1
answer
39
views
"Specified visual is already a child of another visual or root of a CompositionTarget" C# Wpf [duplicate]
I have a blank domino piece and I want to fill it with dots with this function:
private void Arrange(Grid grid, byte dots)
{
Ellipse e = new Ellipse
{
...
-3
votes
0
answers
41
views
How Implement MVVM with Dataset and SQL
I'm developping an application in VB.net and WPF but i can read C# code
Currently we're using CollectionViewSource and directly fill the dataset. But it seems to not being correct for MVVM and i think ...
1
vote
1
answer
30
views
How to sort a DataGrid by a column that's been bound to an interface property in WPF?
I have a DataGrid in a View bound to a collection a ViewModel, and some of the columns in that DataGrid are bound to an interface property because the object uses the interface's default ...
0
votes
0
answers
8
views
MVVM dynamic view with different controls
I am very new to MVVM development and I am create a small project for some home gardening project using ESP32.
My intention is to design an GUI will minimalist rework and changes just by updating a ...
-1
votes
2
answers
48
views
WPF - How to change ContentControl view from sub-view?
I'm new to WPF/MVVM and building an application which runs "Jobs".
The aplication currently looks like this:
The MainView contains some buttons and a ContentControl. The ContentControl ...
0
votes
1
answer
72
views
How to Capture Selected CheckBox Items and Update a List with MVVM in .Net maui
This is my first time working on a MAUI app and struggling with a scenario where I need to capture the selected CheckBox items from a collection and store their relevant Section objects into a list ...
0
votes
1
answer
70
views
Binding a Slider Command in WPF, MVVM
I have a slider in XAML, and I would like to bind the "Thumb.DragCompleted" event handler to a command that I have defined in the ViewModel. My code is as follows:
<Slider ...
0
votes
0
answers
19
views
Android - local and remote model structure
I wonder if my approach is correct and if not - then what is the most common way to achieve this..
My remote db is Firebase Firestore
My local db is Room
Example entity is User and I have it as 3 ...
1
vote
0
answers
61
views
.NET MAUI App Crashes on Navigating to a Page with Data Binding [duplicate]
Question :
I've encountered a puzzling issue with my .NET MAUI app, and I'm hoping the community can help me pinpoint the problem. When I navigate to a specific page in my app, it becomes unresponsive....
0
votes
0
answers
16
views
creationExtras.get(APPLICATION_KEY) always returns null
I'm trying to make viewModel with dependencies and Application app = (Application) creationExtras.get(APPLICATION_KEY); always null,
That means i can't to get any dependencies, like Context or my ...
-1
votes
1
answer
41
views
How does ViewModel to Model communication work in MVVM? [closed]
I want to change Model.Street and other Propeties of the Model and everything i try just seems too long, not right or too complicated. I dont wanna sound lazy but thats just how i am used to it.
...
0
votes
1
answer
44
views
ItemsControl of a UserControl passing back ICommand to ViewModel MVVM
I have an 'ItemsViewModel' ViewModel which is bound to the 'ItemsView' View. Within the ViewModel I have full property List 'ItemsList' which is bound to an ItemsControls ItemsSource. The DataTemplate ...
0
votes
0
answers
24
views
ReactiveCommand not updating UI
Reactive UI C# IObservable not acting as it should
Windows app, Avalonia UI (using mvvm).I created a register form with some textboxes and a register button.To that register button, i bound a reactive ...
0
votes
1
answer
19
views
Get data from data layer
Can you help me? I try to get data from my data layer using firebase. But i'm getting the following error:
E FATAL EXCEPTION: main
Process: com.example.mvvmlesson, PID: 12328
java.lang....
0
votes
1
answer
35
views
Where to put SnapshotListener (Firestore) in MVVM
So I've searched for a while now but didn't got a specific answer for my question.
I'm implementing MVVM right now in my android studio project and I really don't know "the best practice" of ...
1
vote
1
answer
28
views
WinUI 3 ListView item double tapped behavior not working inside datatemplate
I'm trying to add a behavior to the DoubleTapped event of a ListViewItem inside a data template.
<Button.Flyout>
<Flyout>
<Grid Height="500">
...
-1
votes
0
answers
19
views
grouping of Expanders, inside expander checkbox and button in Header,When checked checkbox must choose all rows in specific, change btn text
I have a group of expanders, each containing a datagrid, and I want to create a separate data binding for the Button in the expander header. I want each Button to have its own distinct value, instead ...
0
votes
2
answers
82
views
How to open picker in xamarin form on button click
I am using below code but it is not working for me
public void OpenPiker(){
Picker picker = new Picker();
picker.ItemsSource = Mylist;
picker.Focus();
}
0
votes
3
answers
34
views
Bind to viewmodel from within an inherited DataContext
I am updating a project using MVVM Light.
In the UserEditView, there is a list of users. Select one user, and the user data comes up in a StackPanel where it is editable.
To make things easier, the ...
0
votes
1
answer
33
views
WinUI3 MVVM binding PointerMoved event in ViewModel
I am trying to bind a PointerModed event on a view page to my ViewModel, but the event is not firing for an unknown reason.
Page XAML
<Page
......
PointerMoved="{x:Bind ViewModel....
-1
votes
0
answers
22
views
Use "grass" instead of state in react or MVVM system
/**
* In place of any data of the vm module of MVVM, in react it will completely replace the value of useState
*/
class Grass {
constructor(initialValue, enableStrongType = is_Dev || false) {
...
-1
votes
0
answers
91
views
How pass property of view model from one view to another view
I have some MainView with MainViewModel property. MainViewModel contains "account" property which can be nil or initialized. I need pass "account" to embeded ChooseAccountView ...
0
votes
0
answers
24
views
dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' could not be resolved- Android Kotlin
Detail Error
ComponentProcessingStep was unable to process 'com.example.daggerhilt.BaseApp_HiltComponents.SingletonC' because 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' ...
1
vote
2
answers
26
views
Why there is nothing in my recyclerview on the screen even though datas are shared on API?
I am trying to get data from local by using GET method. Here is Service codes.
This is Interface of API
interface API {
@GET("WeatherForeCast")
fun getweather(): Single<List<...
1
vote
1
answer
38
views
Can't send data to Delegate
I'll try to get the data of an API of Pokemon using MVVM, I used my MainViewModel to perform the request, if I print the pokemon array in the MainViewModel I get the array but when I send the array to ...
0
votes
1
answer
35
views
How to fix OutlinedTextField value not changing?
I have an OutlinedTextField whose value is provided by a property in my ViewModel. However the value is not changing even after I type something on the keyboard of my physical device. The value always ...
0
votes
0
answers
57
views
.NET MAUI Restore Picker values from database data
I am new to MVVM. I am loading data from the database in my ViewModel via a ContentPage behavior - an EventToCommand behavior for the Appearing event. I need to use the data to restore values in ...
0
votes
2
answers
55
views
How to notify my view model that an object inside an observable collection has changed
I have a simple ToggleableObject class that tracks on/off states and an ObservableCollection of that object in my view model.
I know how to trigger an event when an object is added/removed from the ...
0
votes
0
answers
20
views
Creation of child viewmodels in a parent viewmodel - mvvm
I'm quite new to MVVM and with all the different opinions on MVVM it's hard for me to determine what is right / true.
Bit of background - at the moment I am developing an app using the WinUI 3 ...
0
votes
1
answer
31
views
Where to store User object using MVVM and Hilt
I am having trouble figuring out where to put User object so it can be accessed throughout the app (any fragment/activity) since it holds all data app needs. My goal is not to store the user object ...