Skip to main content

All Questions

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

How to handle dialogs following the MVVM design pattern

I'm using Material Design for WPF to show a dialog which receives some inputs from the user, and I would like to return a value when it's closed. Here is the sample code: VM's method that opens the ...
Miraziz's user avatar
  • 509
0 votes
1 answer
439 views

Message box/dialog/pop-up approach in MVVM

I want to find a way to implement different forms of modals in MVVM WPF application. Like dialogs with returning results, message boxes or modal sub-windows with some controls inside. Can you give me ...
Holy's user avatar
  • 1
4 votes
1 answer
3k views

Opening child window in WPF MVVM pattern - correct solution?

I was struggling with opening new window in MVVM pattern without violating it's rules for a month. I have read I think every post here and watch every video about this, but as a amateur programmer I ...
Świętopeł Ziemowit's user avatar
0 votes
1 answer
280 views

Prism Library Dialog Service

The following sample never worked for me: https://prismlibrary.com/docs/wpf/dialog-service.html Where the dialogService comming from? public MainWindowViewModel(IDialogService dialogService) { ...
Buruhazard's user avatar
1 vote
1 answer
2k views

Change Owner of Prism DialogWindow

I have implemented the new IDialogService in WPF using MVVM. My dialogs are working fine, for the exception that when I have another window open in the foreground, the dialog will appear in the center ...
Martin Pfeifhofer's user avatar
1 vote
1 answer
3k views

WPF MVVM - how to inject a service into the ViewModel

I'm fairly new to WPF and MVVM and I need to create a simple dialog feature that allows me to popup a confirmation message on the screen such as "Confirm delete?" with y/n buttons. I created a dialog ...
user2430797's user avatar
0 votes
1 answer
133 views

Is there a way to pass existing view model as a data context to recently opened dialog window, when using autofac?

I have a project, using Autofac. There is created a BootStrapper file that is called on application run: public class BootStrapper { public IContainer BootStrap() { ...
bakunet's user avatar
  • 197
0 votes
1 answer
428 views

MVVM Dialogs and where to call them from?

Hoping that someone can help me further my understanding of Dialogs and how to apply them to the App I am working on (for learning purposes). Apologies in advance - I do not have a great working ...
Stephen Dougherty's user avatar
3 votes
2 answers
2k views

Separate project for view models to "enforce" MVVM: How do I open dialogs?

Opening dialogs while adhering to the MVVM pattern seems to be one of the regular questions (here and elsewhere). I know there are frameworks like MVVM light who have answers to that problem, but I'm ...
InvisiblePanda's user avatar
0 votes
1 answer
2k views

How to add 'Notification', 'Warning' and 'Error' icons on Prism 6.2 WPF modal dialog?

In my Prism 6.2 WPF MVVM application I use notification and confirmation modal dialogs. Below is a definition of the View of a notification modal dialog used in my application: <UserControl x:...
Prohor's user avatar
  • 151
0 votes
1 answer
349 views

Can I set text-wrapping mode for a long-text message to transfer the text to the next line in Prism 6.2. modal dialog?

Sometimes the text of notification message for modal dialog is very long as you can see on the figure below.This is not custom modal dialog but simple notification modal dialog which has a very long ...
Prohor's user avatar
  • 151
2 votes
0 answers
679 views

Compatibility issue with Expression.Blend.Sdk 1.0.2 System.Windows.Interactivity.dll

I'm developing a WPF with Visual Studio 2015 Community, C#, .NET Framework 4.6.1 and Prism.Wpf 6.1.0, Prism.Core 6.1.0 and Expression.Blend.Sdk 1.0.2. I'm following: Implement a confirmation dialog ...
VansFannel's user avatar
  • 45.9k
1 vote
2 answers
3k views

Content Dialog textbox value retrieval

In my MVVM application for showing content dialog I have implemented ISpeechDialogService to show Content Dialog, which I have injected into Main Page View Model: public interface ...
Dmytro's user avatar
  • 192
3 votes
1 answer
2k views

Showing a modal dialog and getting results

I have a static WindowService class which helps me to create new windows and modal dialogs. So far, what I have is this: /// <summary> /// Opens a new window of type <paramref name="...
wingerse's user avatar
  • 3,796
0 votes
1 answer
30 views

Ensure proper return when closing multiple modal views

I came across some code today that looked something like below. It's very simplified and hopefully you can read through errors. ViewHelper class that opens new views. public void DisplayView(...
Forss's user avatar
  • 778
0 votes
0 answers
130 views

Attached behavior not working in reuseable window

I have a dialog that use, that i simple can't understand why it will not bind. I use Joe White's DialogCloser, from this answer public static class DialogCloser { public static readonly ...
Henrik Bøgelund Lavstsen's user avatar
2 votes
3 answers
3k views

Close all child WPF windows and terminate awaiting code

I am trying to implement a system for closing all modal and non-modal windows in a WPF application (with the exception of the main application window.) When these windows are closed, any code awaiting ...
Guttsy's user avatar
  • 2,120
0 votes
1 answer
530 views

How do I set DataContext of a View to ViewModel when using DialogService

I have been following this pattern. http://www.codeproject.com/Articles/36745/Showing-Dialogs-When-Using-the-MVVM-Pattern However, in this example, in the PersonDialog.xaml.cs class, I'm not able to ...
Sailoosha's user avatar
  • 303
0 votes
1 answer
655 views

Unable to close modal dialog with attached property (MVVM)?

A newbie question, but I can't get it to work. In trying to use the answer to SO "How Should the View Model Close the form" , I have a UserControl defined with: <UserControl ..... ...
Alan Wayne's user avatar
  • 5,354
4 votes
1 answer
9k views

MVVM, DialogService and Dialog Result

I'm currently learning WPF/MVVM, and have been using the code in the following question to display dialogs using a Dialog Service (including the boolean change from Julian Dominguez): Good or bad ...
bdan's user avatar
  • 91
3 votes
4 answers
24k views

Access XAML object in ViewModel

How could I access a XAML object in my ViewModel? I am really confused. I want to access the <Controls:ModalContentPresenter> object. How could I realise this in a MVVM conform way? On this ...
Patrick Vogt's user avatar
6 votes
2 answers
6k views

MVVM Modal Dialog using Service Locator

I am developing a WPF application that follows MVVM pattern. To display modal dialogs, I am trying to follow the way the following articles suggests. http://www.codeproject.com/Articles/36745/Showing-...
Anirban Paul's user avatar
  • 1,165
4 votes
2 answers
11k views

WPF Open a Modal window from UserControl

I have a MainWindow in my WPF app. This MainWindow has a menu on the left and when a menu option is selected a UserControl is loaded on the right. This is similar to Master Pages in asp.net What I ...
Nollaig's user avatar
  • 1,097
2 votes
2 answers
8k views

Using MVVM show new window and get updates data

I'm working on a WPF MVVM application. I'm showing some data in a datagrid. I've two buttons to Add and Edit the selected record. I've data in ViewModel and I've to show another window (view) and ...
Omer's user avatar
  • 109
1 vote
1 answer
952 views

What is good choice between Modal Window & Dialog in order to display some data using MVVM Light Tool Kit?

I am new in MVVM world. I have a question about the child window and I want some explanation. I have some collection of data and I am displaying it in the datagrid of main window. I want to select a ...
User1551892's user avatar
  • 3,364
0 votes
1 answer
650 views

WPF Prism - list view and data entry dialog

I have a listview which displays a list of Users (binds to UserListViewModel) - the user can add/edit/delete entries. What I would like to do is have the add button open a new window where the user ...
serachley's user avatar
0 votes
1 answer
2k views

WPF MVVM DialogService close modal dialog?

I use the MVVM-pattern in my WPF-application. Now I show a dialog with my dialogService: _dialogService.ShowDialog(Me, settingsViewModel) The mapping (which view should be shown to this ViewModel) ...
rakete's user avatar
  • 3,031
0 votes
1 answer
3k views

How to get values out of a WPF Dialog Box with MVVM

What is the best way to get a value out of a WPF dialog box that was created with the MVVM pattern. My current code involves the extra step of getting the ViewModel and getting the appropriate ...
PlTaylor's user avatar
  • 7,505
1 vote
1 answer
4k views

WPF: How to close Dialog on button click

So I have a editable ViewModel where I wan't it only to be editable through a Dialog window. Normally the ViewModels view only shows the data but you could press a Edit button which opens up a new ...
Ingó Vals's user avatar
  • 4,888
1 vote
3 answers
2k views

Modal Window with MVVM pattern

I am trying to make modal dialog window for let user know some error messages, or let user edit some values. I am using MVVM pattern, so my mainwindow has some control part and workspace part. In ...
vikox's user avatar
  • 347
158 votes
3 answers
77k views

Good or bad practice for Dialogs in wpf with MVVM?

I lately had the problem of creating add and edit dialogs for my wpf app. All I want to do in my code was something like this. (I mostly use viewmodel first approach with mvvm) ViewModel which calls ...
blindmeis's user avatar
  • 22.4k
0 votes
1 answer
416 views

How to implement a modal like behavior

I 'm running currently into a situation for which i cannot find a solution: In a WPF application i 'm opening several user controls in a tabcontrol. So every tabitem has different things loaded(e.g. ...
Savvas Sopiadis's user avatar
11 votes
2 answers
6k views

How to build a generic/re-usable modal dialog for WPF following MVVM

I would like to build a generic/re-usable modal dialog that I can use in our WPF (MVVM) - WCF LOB application. I have a Views and associated ViewModels that I would like to display using dialogs. ...
Andre Luus's user avatar
  • 3,802
7 votes
6 answers
8k views

Error window show modal in MVVM WPF

I have implemented my MVVM error message as a message dialog that subscribes to error messages via a mediator class, so that other viewmodels can notify it if any errors occur. When an error occurs, ...
bluebit's user avatar
  • 3,017