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).
28,820
questions
0
votes
0
answers
9
views
WPF Datagrid MVVM for different collections
Good afternoon.
I am hoping for some advice as I do not know if I am approaching my issue in the wrong way.
In my code I have about six collections of data that I would like to pull into one datagrid.
...
-2
votes
0
answers
19
views
c# WPF MVVM - dynamic table object
I want to relate objects from DB to uploaded excel files in a ListView/DataGrid or maybe drag and drop option - drag files to employee.
for example if i have an Employee table with "Danny",&...
0
votes
0
answers
17
views
MAUI .Net Bindings stopped Working after the last Preview Update. Where is my Mistake?
To be honest I am kinda lost.
I am currently developping a medium sized app with .Net MAUI, I was almost done but after the update to Visual Studio 17.3.0 Preview 2.0 my Bindings stopped working.
I am ...
0
votes
1
answer
18
views
Using one activity for multiple Fragments, how many ViewModels should I use
I've got an app that only uses one ViewModel to handle GroceryItem.kt items from local Room database. I'm planning on adding multiple fragments using bottom navigation with NavGraph and want to ...
0
votes
1
answer
20
views
MVVM: Set a getDrawable from a ViewModel
I'm moving all my app's logic from the fragment to the ViewModel and cannot move those methods that set drawables.
Example:
marker.icon = ContextCompat.getDrawable(requireContext(), R.drawable....
-2
votes
0
answers
21
views
If I set a background to user control I can drag an drop. If I don't set the background, I can't. How to drop using MVVM? [duplicate]
I want to can drag and drop a file in to a user control. I set the property AllowDrop in the user control, so in this way I would like to can drop in any place of the control.
However, At first, I see ...
-1
votes
1
answer
28
views
How to bind WPF window title to a viewmodel property and to a static resource property? [duplicate]
In my WPF application, I have a window whose title is a 2 word string. First word, i need to bind to a ViewModel property and second word, I need to get from resource file as i need to apply ...
0
votes
0
answers
14
views
Where is the controller in the MVVM pattern
I was looking for differences between the MVVM and MVC pattern. The MVC pattern has a controller that checks if what page it needs to show. Where is that check in the MVVM pattern?
1
vote
2
answers
34
views
What is right place to start a WorkManager in MVVM architecture Android?
I have a workmanager that every five hours picks up a word from the roomdb and Notification it
I do not know where is the righ place to put the work manager in the MVVM architecture.
Should I use in ...
-2
votes
0
answers
36
views
What is the right way to share objects between ViewModels with limited lifetime in WPF [closed]
Given is an WPF .net6.0 app and we use MVVM.
The procedure is for example:
CreatorViewModel create Service ... CreatorViewModel get disposed.
ConsumerViewModel use Service ... get disposed.
...
0
votes
0
answers
41
views
Populate Xamarin Listview with 2 keys
Is there a way to populate a listView in Xamarin with 2 keys?
I mean, I'm grouping the listview. I can only group them using a
string. But I need a string and a double.
I attached a picture that shows ...
0
votes
0
answers
16
views
android visiblity data-binding with two-ways
I am trying to make an expandleMenu which is shown and hidden dynamically by clicking its content.
<LinearLayout
android:id="@+id/expandableMenu"
android:visibility='@{vm.isShow? View....
2
votes
1
answer
56
views
CS193 view doesnt update with model(MVVM)
I've been following this Stanford course on swiftUI and I've gotten to a point where im 100% sure my code is essentially identical to what i'm following but it doesn't work, I've been trying to debug ...
0
votes
0
answers
35
views
How to observe within Viewmodel in Android Kotlin?
Below is my viewmodel class body
private var _movieState = mutableStateOf(false)
val movieState = _movieState
private val query = if (_movieState.value) ListState.POPULAR_PLAYING else ...
-1
votes
0
answers
30
views
How to trigger drawing event of InkCanvas WPF MVVM? [duplicate]
I have a two-screen application and I am trying to make a drawing panel where everytime user draw something on one screen it would display the drawing live on another screen. I want to catch triggered ...
-3
votes
0
answers
74
views
Clean way to change the state of a button dynamically based on textboes
In case you were wondering an mvvm clean way to disable button. This is how to achieve this:
Start by making a converter,that inherit from IMultivalueConverte, something like this
public class HasText ...
0
votes
0
answers
19
views
Should Retrofit's Response object be returned in a data source interface or just the value within the Response object?
When using Retrofit, I struggle with deciding whether to return the Response object itself or the value inside from a network source. If I return the Response object, it makes things a little more ...
0
votes
1
answer
31
views
Command Chaining in UWP
ITNOA
I have a UWP custom control that have a method and I want to call this method in some ViewModel (I use CommunityToolkit.Mvvm framework in our project), after many searches I found similar ...
0
votes
0
answers
16
views
Jetpack Paging 3.0 with Airbnb/epoxy only load the first page
I am trying to use Jetpack Paging 3.0 to get all the characters in Rick and Morty API using retrofit and display it using Airbnb/epoxy. But I only get the first page I've spent several hours trying to ...
-2
votes
2
answers
113
views
+50
How to update ListBox with ObservableCollection WPF MVVC?
I'm learning WPF MVVM pattern. I've been following Sean Singleton tutorial on YT and so far I've understood and managed to apply the patter to my application.
However there is one aspect that I don't ...
1
vote
1
answer
79
views
WPF MVVM I want to bring data from another Window ViewModel and use it
I'm creating a customer care program using WPF MVVM pattern
I created a registration window and a customer information window
I want to bring the value of the data grid of the customer information ...
0
votes
0
answers
53
views
Why Basic Sample project from architecture-components-samples with Room db works but this example doesn't work?
I'm working on android project with room db and I'm getting crazy about this problem. The db doesn't create what ever I try. No errors, nothing in Logcat and nothing also while debugging. I did ...
1
vote
1
answer
47
views
XamarinForms Routing problem with PopModalAsync after PushModalAsync -> Ambiguous routes matched for (...)
I am looking for a solution to the "Ambiguous routes matched for" problem.
I have registered Routes in AppShell.xaml.cs:
Routing.RegisterRoute("dashboard", typeof(DashboardPage));
...
0
votes
0
answers
43
views
How to Reuse Same Function in Parent and Child View in SwiftUI with NSManagedObject
Suppose we have a main view MainView and a child view LoginView which perform login function for user. I have chosen CoreData to store some persisted data like username and password and @State in ...
0
votes
0
answers
26
views
WPF: Updating entry of an ObservableCollection that is selected through a DataGrid using separate input fields?
I have a DataGrid displaying some database-entries. I want to edit the selected entry using controls bound to the properties of the selected item. I want the user to commit the changes using a button. ...
-3
votes
0
answers
43
views
Fill a combox using mvvm
I am doing an MVVM wpf application and for some reason I cannot fill the combobox.
I am using MVVM.Helppers (https://github.com/jamesmontemagno/mvvm-helpers).
I have a PropertiesViewModel, witch ...
0
votes
0
answers
43
views
MVVM. When I change the value of a property of my model, it is not displayed in the view
I am creating a WPF application. This application contains a model, a view and a viewmodel that are the following.
Model:
public class PersonModel
{
public string Name { get; set; }
public int ...
0
votes
1
answer
58
views
Xamarin.Forms - Is there a quick and easy way to increment the already bound value of Label.Text in XAML only?
I need to increment the value of some labels without changing the value of the binding context.
I know I could just create a new variable in my MVVM which is the incremented version of my original ...
0
votes
0
answers
33
views
How can I create child views dynamically in MVVM Android?
I am new to MVVM in Android.
Is there a way to add child views of group layout such as chipgroup, radiogroup?
Let's say there is this kind of data from a server.
[name: 'coffee', size: 'tall', '...
-1
votes
0
answers
9
views
Using event handle accepted the values needed from gridview to parameter how to display them.how to use these data
private void EditList(object parameter){}
need to store the values returned to methods or collection
0
votes
1
answer
31
views
java.lang.Class has no zero argument constructor and Cannot create an instance of ViewModel
When I'm visiting the application and once accessing this fragment(MenstrualFragment), the application crashes and this is displayed in the Logcat -
2022-06-23 15:44:59.110 11278-11278/com.miniproject....
0
votes
1
answer
35
views
Using interfaces in dependency injection in .Net MAUI
I am trying to implement dependency injection for the first time in my new project in .Net MAUI. For testing purposes, I want to fetch data from a local source in my ViewModel. The production scenario ...
0
votes
0
answers
30
views
$parse.assign(..) is not a function Angular JS version 1.4.3
I am facing this problem while selecting file and showing its name on span.
So basically I am trying that whenever I select some file I want to change the span Tag. This is my view
<form name="...
-1
votes
0
answers
17
views
How to create a shortcut of recycleview item on home screen on button click programtically android
1.I want to know how to create a shortcut of specific path on home screen.
2.Can particular item of recycelerview can be created and added as shortcut on home screen?
3.If it is possible any ...
0
votes
0
answers
38
views
How to manually destroy or recreate a ViewModel
Working on an Android app where each user can have multiple accounts under the same login. There is a single activity with a fragment per tab - based on the Android sample Bottom Navigation.
On one of ...
1
vote
1
answer
30
views
MVVM Messenger Register / Send Message in VB.net
I just need some Help translating from C# to VB.Net in this Case.
I try to learn about MVVM and WPF. I need to communicate between multiple Views. An easy way should be via MvvmLight Messaging.
...
1
vote
0
answers
16
views
recyclerview Drag and drop to different View
I have a recyclerview in my project, where a user will be able to drag and drop it to a different view(card view).
I am following mvvm pattern and using dataBinding. I use the longclick function from ...
0
votes
1
answer
60
views
Null object when passing value from textArea inside Foreach to OnPost (object is IEnumerable)
I have the following CSHTML class:
@model WorkInProgress.Pages.Expenditures
<thead>
<tr>
<th class = text-start>Task Number</th>
<th class = text-start>...
0
votes
1
answer
46
views
wpf xaml MVVM inheritance with multiple ContentPresenter
I am rewriting import masks that have a lot in common, so I want (and must) use inheritance.
I have a basic UserControl with all common controls: (I have left out the grid definitions)
BaseClass.xaml
&...
1
vote
0
answers
29
views
Add to favourites functionality using MVVM Best Practice
I am working with MVVM architecture and trying to use best practices in documentation.
Let me explain what I have done and what is my problem.
I have a fragment and a parent fragment. When user enters ...
1
vote
1
answer
51
views
How to auto sort datagrid column when binded datatable changes
I'm facing a problem that i don't know how to solve. Maybe someone can throw some light in my path :)
I am developing an WPF application that has a DataGrid binded to a DataTable using MVVM. I have ...
0
votes
2
answers
27
views
Show dialog from ViewModel in ReactiveUI Avalonia (MVVM)
I have Window, inheriting from ReactWindow, and it's connected to its Viewmodel .
Everything is working as expected (binding, clicking stuff, hitting commands). So it's working. (code is below)
When ...
0
votes
0
answers
16
views
ZipArchive problem with Access to the process
I try to do a function which of the files from the zip file will take two values and update them in the GUI.
the problem is that i get exception about access to the file.
System.IO.IOException: '...
1
vote
2
answers
112
views
Room "Not sure how to convert a Cursor to this method's return type"
I'm new to android development and I'm working on a project called " water drink reminder " .
this is my Dao and database codes.
i'm getting "Room Not sure how to convert a Cursor to ...
1
vote
0
answers
46
views
How to get data from API to wpf mvvm
I am trying to get data from my api to wpf. I'm using mvvm pattern. I'm new at that. So, In Model layer i have EmployeeModel and EmployeeService. In EmployeeService i'm trying to make conection and ...
0
votes
0
answers
39
views
Where to handle the parent window state from a user control
I have a MainWindowView with my TitleBarView user control on it:
<Grid>
<local:TitleBarView DataContext="{Binding TitleBarViewModel}"/>
</Grid>
With it's ...
0
votes
0
answers
16
views
Choose one unextracted file from binded list in WPF
I'm learning WPF and I try to update file value of "last modified" or "size" using button "replace", if something is changed values update.
When I use "replace"...
0
votes
1
answer
49
views
Change a Combobox's selectedIndex from ViewModel and when the Combobox is binded [duplicate]
I want to have the selected index of a combobox change based on code from the ViewModel. Is this possible?
This is how my combobox is set up:
<ComboBox x:Name="cmbModels" ...
0
votes
0
answers
49
views
.Net Maui Binding ViewModel to SQLite database to populate CollectionView
I'm following Gerald Versluis's videos https://www.youtube.com/watch?v=uxqQqyuZ3Qo https://www.youtube.com/watch?v=8_cqUvriwM8
All good (and great teaching), but uses code behind and I'm trying to be ...
0
votes
1
answer
24
views
Cannot create an instance of class viewModel.NoteViewModel
I am getting this error from a while and i have tried everything to resolve this error
I have seen this solution but it didn't work for me: Cannot create an instance of ViewModel Class
I have tried ...