The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [mvvm]

The Model-View-ViewModel design pattern, which separates presentation from data and logic.

Filter by
Sorted by
Tagged with
17
votes
2answers
4k views

Understanding the MVVM concepts and validation of my code

I have been learning MVVM concepts and trying to implement it in my new project. I want to validate my work that I have been doing these past days. I want to know if I follow correctly the MVVM ...
12
votes
2answers
950 views

MVVM data binding for a video encoding form

I am creating a C# WPF application. I am intending to bind all of the GUI controls via data binding to my ViewModel, rather than code behind - as per MVVM. I have ...
11
votes
1answer
830 views

Filter Collection by Multiple Criteria

I want to the user to filter a list of receipts by various criteria. Just the regular, an empty filter should show all items, an entry in customer should show all receipts from that customer and an ...
11
votes
1answer
9k views

A ViewModel using ReactiveUI 6 that loads and sends data

Most of the Rx Compelling Examples™ load and store data locally, which I don't find that Compelling. I spent some time coming up with how to best perform the following actions but want to make sure I ...
10
votes
3answers
3k views

Converting between data and presentation types

Below is how I'm solving the problem of converting between data and presentation types, I'd like to know if that's a good way to go about it, and if not, what would be a better way to go about it. I ...
10
votes
3answers
10k views

Pong game in WPF

I would especially like to find out how this project should be constructed to be "fully MVVM". I did some reading about MVVM and I started to implement some ideas, but I don't fully understand it yet....
10
votes
1answer
129 views

Visual Studio exception visualizer for lengthy exception messages

I use Autofac a lot and for everything and when you make a mistake and forget to register a dependency etc. it'll tell you exaclty what's wrong. Although its ...
10
votes
1answer
229 views

Code Explorer 2.0: A folder hierarchy to organize VBA projects

Next release of Rubberduck will introduce a very cool @Folder annotation system that the Code Explorer will use to organize modules into - you guessed it - folders: ...
10
votes
2answers
930 views

CommandBinding refresh on parameter changed

I need the command I am executing on a datagrids context menu to know which column was clicked on. XAML ...
9
votes
4answers
709 views

ViewModels Mediator with multiple generic callbacks

I'm developing a mediator for an MVVM application. This application lets employees file tickets with IT support to ask for help. The mediator communicates messages and triggers callbacks between ...
9
votes
2answers
1k views

Am I handling “spot the missing DLL” right?

I have a .net 4.5 desktop script which has dependencies on some third party libraries (dll's). These libraries are used in my MainWindowViewModel. I need to check ...
9
votes
2answers
3k views

Monitoring the clipboard

The following class monitors the clipboard and raises an event whenever the contents change. The monitoring starts when the class is created and ends when Dispose ...
8
votes
2answers
4k views

Add or view pattern with MVVM

I have a model called WorkOrder which I want to be able to manage from a single window. The required operations (for now) are only Insert and view, so this is what ...
8
votes
2answers
3k views

AsyncCommand using MVVM and WPF

Goals I want to be able to call async code using the MVVM pattern I want to be able to add loading animations/screens without having to add properties for each command on my viewmodels I may want to ...
8
votes
3answers
675 views

MIST - auto-implemented, attribute-driven .NET notification mechanism

I have a component that I've used myself for quite some time, the short story is that it automagically implements a property change notification mechanism (very useful for implementing ...
8
votes
1answer
281 views

TestExplorer 2.0 - From Grid to TreeView

Rubberduck's unit testing feature (heck, the whole project) started with a VBA unit testing framework that was ported from vba to c#; the VBA logic was pretty much simply rewritten in another language,...
8
votes
2answers
8k views

ViewModel constructor with many parameters

I have some ViewModels that have a lot of parameters like this one: ...
8
votes
1answer
28k views

Navigation between pages in WPF MVVM application

I did a project in WPF MVVM. Just a single Window with single Frame control and few Pages. My problem was communication between ...
7
votes
4answers
12k views

Improvements to a ViewModelBase

Every time I go to write an MVVM application (say every 4-6 months) I rewrite my ViewModelBase class. This is for a range of reasons but let's say either I don't ...
7
votes
2answers
148 views

Correct usage of MVVM and object for method

I'm writing my first C# Windows Store app and am learning C# from scratch. I'm trying to implement MVVM as I understand it and object orientated patterns, obviously though I'm expecting to be doing it ...
7
votes
1answer
348 views

MVVM: Am I doing it right?

I read a lot of articles recently concerning XAML, WPF, data binding and MVVM. I also watched some MVVM tutorials and downloaded some MVVM samples. I finally got my first MVVM sample to work, but ...
7
votes
1answer
229 views

MV* Pattern for a board game

I have made a small game in Javascript, while simultaneously learn about the ever so popular model view controller. The game is this, there are 3 players(green, purple, yellow) and they have to try ...
7
votes
1answer
1k views

MVVM implementation based on Jason Dolinger's video

I've learned MVVM for a week or so, and I've seen the Jason Dolinger video many times. Step by step, following the Jason Dolinger video, I've created my own application which is almost the same to the ...
6
votes
2answers
2k views

ListBox with a dynamic number of TextBox elements

I am making a kind of form, and I want the user to be able to enter a dynamic number of string inputs. The idea is that a single TextBox will be displayed, and once ...
6
votes
2answers
3k views

Simple clock view model

I have been trying to wrap my head around MVVM for the last week or more and still struggling a bit. I have watched Jason Dolingers MVVM video and gone through Reed Copsey lessons and still find ...
6
votes
1answer
387 views

Winform, with a workaround to avoid dependencies

I'm working on a Winform project. We currently have a modular design (shown in the image) in our project. Where on every user action (button clicked or selection changed etc), first we set the Model ...
6
votes
1answer
11k views

MVVM - ObservableCollection & Entity Framework DbContext

I'm trying to catch WPF using MVVM pattern, where my set of models is implementing ObservableCollection as well as Entity Framework's ...
6
votes
1answer
1k views

Passing a password to a viewmodel

I've got a project I've been working on that connect to a file server and writes some data to a text file. In order to do this I added a textbox for the user to type their username and a passwordbox ...
6
votes
1answer
2k views

Can this reactive code be improved?

I have a view model that I'm migrating to RxUI. It exposes a collection of brokers along with a bool indicating whether there is a market (ie. at least one broker). ...
6
votes
1answer
11k views

From event handler to command: on my way to MVVM

I have a WPF C# application that I want to move to a MVVM pattern. My first step is to remove the button click handlers from the code behind of the UI. I've found some examples online and then ...
6
votes
1answer
106 views

WPF MVVM ColorLister with navigation

By hashing together various online tutorials I've constructed my first MVVM application that lets users navigate between "tabs" and a "tab" (ColorList_Tab) that performs basic list functions such as ...
6
votes
1answer
106 views

MP3 tag Project in MVVM style

After reading the books "Clean Code" from Robert C. Martin and the "Head First Design Patterns" book from Elisabeth Robson I decided to make a mp3 tag application. I tried to do it in the MVVM style ...
6
votes
1answer
6k views

Unit of Work with Generic Repository Pattern MVVM

I have been writing the application. I meant to implement a repository pattern with Unit of Work. Is it correctly done? Can you make a code review? I use SQLite ...
6
votes
1answer
1k views

View Model Base

I needed to write code in WPF for a client. The application is done with prism (not my decision, they already had people working on it), so I got a sparkling clean new module to work in. Since this ...
6
votes
1answer
452 views

Fat ViewModels for editing images

How should I deal with ViewModels that are "fat"? Or should I just accept it sometimes. Example - one of my ViewModels (editing ...
6
votes
1answer
156 views

Manage a collection of settings in memory with global scope

I have a WPF app and a bunch of read/write settings that need to be accessible from various view models. a setting can be any type (string, ...
6
votes
2answers
10k views

WPF Window with different DataTemplates

I have to do a task hard for me and maybe you can help me. I've tried to design a window dialog to update data from a database view. This database view contains integer, DateTime, string, Time, ...
6
votes
1answer
153 views

Enumerating smart card terminals asynchronously in ViewModel constructor

I started a project the other day and started going down the path of using async and await as I have never used it before and it seems like a good match. The app that I'm making is a WPF solution ...
5
votes
3answers
395 views

Fetching, adding, and viewing games

This is a simple application that will eventually manage certain files for video games. For now, I'm only posting code that handles fetching, adding, and viewing games. I'm trying to keep things ...
5
votes
1answer
177 views

Scraping an parsing jockeys data using Task.Run

I started to have HUGE doubts regarding my code and I need some advice from more experienced programmers and architects. On the button click, the application runs a method, that is running a ...
5
votes
2answers
89 views

The cycle continues - VM's part 4

So, this is my refactored VM: ...
5
votes
1answer
499 views

Data Model for a Memory Game

I have a Memory style card matching game. The project is big enough that I want to break up the review. The first part that I am giving you is the data model. If you are interested the full project ...
5
votes
1answer
2k views

Caliburn.Micro nested ViewModels

I am currently developing a small tool intended to help me keep track of the myriad of characters in my Stories. The tool does the following: Load the characters which are currently stored as json ...
5
votes
1answer
458 views

WPF application depending on large file

I've got a quite simple WPF application, trying to implement a correct MVVM pattern. The application in itself is simple: one listItem and one textbox + button for searching. On init, the entire ...
5
votes
1answer
194 views

Accessing View from ViewModel

Having a view (grid control) that provides some functionallity via methods (primary SerializeView / DeserializeView) that should be called from the view model which is bound to the view. One point to ...
5
votes
2answers
517 views

Using a service interface to get user input from dialogs

I haven't worked with WPF/MVVM for a while, but now I'm back fixing some issues with one of my old apps and remembering the struggles I always had when dealing with asking for user input (eg. showing ...
5
votes
2answers
1k views

Caliburn Micro communication between list and edit viewmodels

I'm new at Caliburn Micro and the MVVM pattern. I have 3 views (with its corresponding viewmodels): AppView ClientsView ...
5
votes
1answer
1k views

Unit of Work and repositories in MVVM / Windows 10 app

I’m currently aiming to make my first app for the Universal Windows Platform (UWP) / windows 10. It’s a small app but should follow some best practices patterns (although I’m considering it as a first ...
5
votes
1answer
1k views

DialogService which can return a result and closes Window

I wanted to have a DialogService that can return an arbitrary result. The views to be displayed are implemented as UserControls, and UserControls cannot close themselves (nor directly the parent ...
4
votes
1answer
1k views

WPF MVVM Navigation

Following a lot of research and mainly based on this tutorial I came up with the following structure in my application: ObjectBase - all view models inherit it: ...