Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [mvvm]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
1k views

Using “Lookup Logic” in a WPF Converter (vs extra properties in “model” classes) [closed]

There seems to be a point of contention on my project team regarding what method should be used when trying to display something about an object that requires "lookup-logic". Namely, should their be a ...
3
votes
2answers
2k views

MVVM Navigation WPF

Currently, I'm trying to learn every aspect of the MVVM design pattern. So basically I've written a little WPF App where I'm trying to understand Navigation in MVVM, the app has one MainView wich ...
1
vote
1answer
63 views

Transitioning a NavigationPane to use MVVM

A friend of mine asked for help with his UWP app. Me being a .NET developer with an okay amount of WPF experience decided I could give a hand as well as give some good tips and tricks. After a few ...
3
votes
2answers
3k views

Window Factory and Manager using MVVM pattern

I am fairly new to Factories and Dependency Injection in MVVM. I've build my View(Window) factory with help from SO, and I would like to know if I had implemented everything properly(code works just ...
3
votes
1answer
168 views

Managing documents with manager class

So I have a program that visualizes data from files (csv,txt,etc.). These files are saved to database as individual tables. In my application I have DocumentExplorer...
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 ...
3
votes
1answer
713 views

Trying MVVM on timer app

Check me: Model should do everything. That's where all functionalities and features are accommodated. It has some properties, that I can access and use. ...
4
votes
2answers
653 views

Catching exception inside model

Is it normal to catch exception in concept of MVVM inside model? Or how should it be? How to improve this code? This is simple application that allows user to drop .pfx certificate on the label. <...
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 ...
1
vote
1answer
4k views

Converting models into a list of ViewModels [closed]

I have the following code: ...
2
votes
2answers
2k views

A list of students using MVVM

Is this a proper MVVM implementation? I copied it off a sample but the source would not open so I have to put stuff in spots? Should I call in different files? My first MVVM and have trouble with the ...
2
votes
0answers
160 views

Keep clean SimpleIoc initialization when reusing UserControl

Originally I had ChildUserControl inside ParentUserControl inside MainWindow with this view-...
2
votes
1answer
2k views

Invoke model logic in one UserControl from view-model in another UserControl without violating MVVM

I am developing WPF application keeping MVVM and using Prism. Here is simplified scheme: I need to invoke model logic in UserControlResult when executing command ...
1
vote
0answers
284 views

Quiz MVC application

I am developing a Quiz module in which a user can create a quiz based on a large set of questions grouped on categories. But he can also repeat a certain quiz, or view it again read only. The ...
2
votes
1answer
329 views

PDF conversion and timestamp tool

Since the last post, I have ported it to WPF (semi-MVVM) and added support for Excel and PowerPoint files, and custom fields and scripts. The conversion is done by interop with office. Apparently ...
4
votes
1answer
263 views

ViewModel base class supporting property notification, error notification and property value history

I've created a general purpose ViewModel base class in what I believe it's purest behaviour. It features property notification, error notification and property value history. Please take a look at it ...
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 ...
2
votes
1answer
1k views

WPF Mvvm async function ViewModel

I worried about this code in a ViewModel. ViewModel should not contain any code except binding's. But without async update the ui would freeze. How do I improve it? I'm restricted to using .net 3.5 or ...
2
votes
1answer
3k views

WPF: Model to View Model data binding to implement Two Step View

I am trying to use Two Step View pattern in WPF. The problem is about keeping things in sync – I need a way to data-bind models to view models. Are there any good existing solutions? My approach is to ...
4
votes
1answer
95 views

Many similar ViewModel methods to fetch and prepare model data

I have a MVVM application that fetches data from active directory and displays it in a DataGrid. The exact data displayed is determined by which query a user runs, ...
4
votes
1answer
1k views

Active Directory Tool - Wpf application to query active directory and display results 2 (UI)

This is an update from here. I have made some changes, and have decided to only include the UI side of things in this particular question. I wanted to make the application follow the MVVM pattern, but ...
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 ...
2
votes
1answer
126 views

Weaving through the MIST

Original post here: MIST - auto-implemented, attribute-driven .NET notification mechanism I've developed (and use) an IL "weaving" solution for auto-implementing property change notification in ....
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 ...
2
votes
2answers
5k views

C# SerialPort implementation

I'm writing a C# WPF project built with a MVVM pattern. This software is written to use a medical diagnostic device, so in our planning it will be certified IEC 62304. Since I've been mainly writing ...
3
votes
2answers
900 views

Loading sub items of TreeView in background

I am working with a TreeView (default control from .Net Framework) that displays hierachical data. Data are bound to the view using MVVM pattern with the ...
2
votes
0answers
186 views

Extension for BindableBase that can dispose the old value of a property if that property implements IDisposable and is not null

I am interested in hearing opinions on this. I need a way to dispose the old value of a property in a way that's compatible with BindableBase. Specifically, I have ...
1
vote
0answers
2k views

Prism 6 Popup Window with EventAggregator to replace a service

I have a WPF project with Prism 6 and EF6. In my project I have a MainTabModule which has ...
7
votes
1answer
350 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 ...
2
votes
1answer
3k views

ReactiveUI And WPF - Reusing a value to update multiple properties

I've created my first ReactiveUI app in WPF. Simply, the user enters their full name in one textbox, and then the name gets split into its parts and displayed in the other textboxes. This is just an ...
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 ...
2
votes
1answer
1k views

WPF Track child collection validation errors

I have a need to get notified about validation errors that occur in a child collection of my ViewModel. For validation I use the ...
3
votes
1answer
514 views

Unity Repository Best Practices

I am now developing a product, which will use Unity & Repositories when it comes to data management. I will demonstrate on a simple example. What we want to do, ...
1
vote
0answers
163 views

Saving the state of a ViewModel

I've the following scenario, I've got some viewmodel that need to persist their state on disk. I've defined a custom attribute as: ...
4
votes
1answer
57 views

FindAllReferencesCommand 2.0

Rubberduck 2.0 will feature a "Search Results" dockable toolwindow that will be used for displaying the results of Find all references, Find all implementations, and whatever else we need to find. It ...
1
vote
1answer
69 views

Randomly choose a game executable from a folder 2.0

After asking Randomly choose a game executable from a folder, I applied the recommended changes. I also redesigned the program to make use of the MVVM (Model-View-Viewmodel) paradigm, using Prism 6.0. ...
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 ...
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 ...
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 ...
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: ...
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 ...
4
votes
1answer
2k views

MVVM light message handling

Recently I started to use mvvm light messenger and it lead to creating this ugliness which I have to refactor now. What would be the best future proof way to refactor this whole class? ...
3
votes
1answer
255 views

Closing Tab Item Confirmation

For this project I'm targeting .NET 4.6 with Prism 6 as a toolkit to implement correct MVVM patterns. The code below allows me to raise a dialog box with Yes, No, Cancel buttons. If the user clicks '...
0
votes
1answer
94 views

Data binding with keydown

I want to create a JS MVVM framework for learning and personal project. jsFiddle HTML: ...
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 ...
4
votes
0answers
281 views

Unit of work with Repository pattern

I am trying to work on a WPF application and decided to go for Unit of Work and Repository pattern, along with MVVM. I am using Entity Framework as my ORM. Could ...
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,...
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: ...
4
votes
0answers
3k views

WPF MVVM Dialog with Prism, MahApps.Metro

I am building a Metro-themed WPF application with MVVM approach using Prism and MahApps.Metro. I have to show a custom dialog from view model. Currently, I am using ...
1
vote
0answers
721 views

Xamarin Forms MVVM Light Toolkit usage

I am playing around with Xamarin, because there is a good chance that I might have to start a project using it in a few months. What I am mostly looking at is Xamarin Forms as I am familiar with WPF ...