mvvm-light

Multiple Views that have same ViewModel

故事扮演 提交于 2021-02-10 20:25:09
问题 In my Application business i have 3 step to define a person...in each step i get some info fro my person... For example i get firstname and lastname in step 1 and persontype in step 2 and get other info in step 3... I use from transition UI for show steps to my user and using from Fluidkit for any steps i have a usercontrol ...how can i bind my usercontrols to one ViewModel? 回答1: Your question isn't very clear, but yes, you can certainly use the same ViewModel instance for multiple different

Multiple Views that have same ViewModel

走远了吗. 提交于 2021-02-10 20:22:47
问题 In my Application business i have 3 step to define a person...in each step i get some info fro my person... For example i get firstname and lastname in step 1 and persontype in step 2 and get other info in step 3... I use from transition UI for show steps to my user and using from Fluidkit for any steps i have a usercontrol ...how can i bind my usercontrols to one ViewModel? 回答1: Your question isn't very clear, but yes, you can certainly use the same ViewModel instance for multiple different

MVVMLight CanExecute not working until window click

放肆的年华 提交于 2021-02-08 06:10:08
问题 Quick note so I do not waste anyone's time. When installing MVVMLight from nuget I eventually get an error null : The term 'null' is not recognized as the name of a cmdlet, function, script file, or operable program . MVVMLight seems to work fine despite this except the issue that will be described below, but I wanted to mention this just in case. The Problem I am experiencing an issue with buttons not re-enabling after command execution completes. It seems they sometimes work if the

MVVMLight CanExecute not working until window click

橙三吉。 提交于 2021-02-08 06:06:14
问题 Quick note so I do not waste anyone's time. When installing MVVMLight from nuget I eventually get an error null : The term 'null' is not recognized as the name of a cmdlet, function, script file, or operable program . MVVMLight seems to work fine despite this except the issue that will be described below, but I wanted to mention this just in case. The Problem I am experiencing an issue with buttons not re-enabling after command execution completes. It seems they sometimes work if the

Command binding to ViewModel with confirmation logic in View

眉间皱痕 提交于 2021-02-07 21:51:36
问题 Looking for the most elegant solution to bind a button command to a ViewModel ICommand property, while allowing confirmation in the View. What I would like to do: Only allow a user to click a button when he/she should When the button is clicked, ask a confirmation If comfirmed, do work in the ViewModel, otherwise cancel Do not break MVVM architecture The confirmation requirement can be fulfilled by showing a messagebox from the ViewModel. However, I don't think this is the way to go. Doesn't

WPF - MenuItem with children not firing bound command

无人久伴 提交于 2021-01-28 05:09:26
问题 So I've been butting my head against the wall with this one all day. In my WPF application (using MVVM Light), I have a context menu which is bound to a collection of viewmodels, and it is not behaving quite correctly. I can create my menu, and everything works perfectly with my tree of MenuItems behaving, commands being executed, and the correct parameter coming through. I'm using this to make a context menu which allows a user to add items to folders. The problem that I've run into is that