2,853 questions
0 votes
0 answers
34 views
WPF MVVM light Relaycommand can execute not trigger when field value changed
I am using MVVM light (GalaSoft.MvvmLight) in my WPF application. My View <base:BaseWindow x:Class="Hub.Kiosk.View.WindowLogin" xmlns="http://schemas.microsoft.com/winfx/...
2 votes
1 answer
298 views
How do I migrate this MVVM approach in WPF to WinUI?
Historically in WPF when using MVVM (typically done with MVVMLight) I use the approach where I bind a control to something in its view-model. To wit: XAML: xmlns:vm="clr-namespace:My.Namespace....
0 votes
3 answers
59 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 ...
3 votes
0 answers
217 views
Migrating data binding from MVVMLight to CommunityToolkit.Mvvm
I am attempting to migrate a Xamarin native (Xamarin.iOS and Xamarin.Android) solution from MVVMLight to CommunityToolkit.Mvvm. I have pored over documentation on this topic here. The docs state that ...
1 vote
1 answer
197 views
Preventing null value insertion through a RelayCommand in WPF MVVM?
Good day, I am new to C# and WPF. Currently, I am trying to create a Todo list, but I am having problems with the CanExecuteAddTodoCommand() for my RelayCommand. I used MVVMlight for this and Material ...
0 votes
0 answers
71 views
How to use a parameter with EventToCommand in mvvmlight on WPF
I have the following datagird in my WPF and I can open a new CustomerOperationView from OperationView with EventTrigger as you see. However, I want to open CustomerOperationView with a parameter for ...
0 votes
1 answer
66 views
How to subscribe to Navigated event from the WebBrowser control on a ViewModel? (MVVM)
So basically I'm trying to subscribe to the Navigated event on the WebBrowser control so I can get the source of the WebBrowser, but I have no idea how to subscribe to it from the ViewModel I have ...
-1 votes
2 answers
164 views
Showing two copy of dialog wpf mvvm
So I am developing a two-screen application using wpf with mvvm light. I want to mirror them as much as possible. However, I run into problem with the showdialog for windows. Because ShowDialog will ...
0 votes
2 answers
183 views
RelayCommand not firing from Context Menu item in a user control
In a user control I have context menu for data grid like shown below <DataGrid.ContextMenu> <ContextMenu Focusable="False"> <menuItems:ExportMenuItemView ...
0 votes
1 answer
133 views
Command Chaining in UWP
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 solution in ...
1 vote
1 answer
296 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. ...
0 votes
1 answer
68 views
RaisePropertyChanged throws AccessViolationException when update data
I was trying to update data through Textbox when click on the button the AccessViolationException throws out at random everytime I click on the button to execute some funtions Not just that,while ...
1 vote
1 answer
340 views
DispatcherHelper in Windows Community Toolkit
I am working on upgrading MVVMLight to Windows Community Toolkit and facing issues with DispatcherHelper. I am unable to find any examples which can show me how to upgrade the functionality relating ...
1 vote
2 answers
2k views
How to replace a registered service with a new one in MVVM?
Trying to migrate from good old MVVM Light to Windows Community Toolkit. How are we supposed to override a registered service, i.e. replace it with another implementation at runtime? Example I have ...
0 votes
1 answer
158 views
UWP Change theme in pop ups MVVM Light
public static async Task SetRequestedThemeAsync() { foreach (var view in CoreApplication.Views) { await view.Dispatcher.RunAsync(CoreDispatcherPriority....