mvvm

MVVM Best Practices: communication between view models

走远了吗. 提交于 2021-02-18 17:56:43
问题 My simplified program structure looks like this: public class Manager { public Item MyItem { get; set; } public void Recalculate(){ ... } } public class Item { public string SomeProperty { get; set; } } public class ManagerViewModel { public Manager Model { get; set; } public ItemViewModel MyItem { get; set; } } public class ItemViewModel { public Item Model { get; set; } public string SomeProperty { get => Model.SomeProperty; set { Model.SomeProperty = value; RaisePropertyChanged(

MVVM Best Practices: communication between view models

情到浓时终转凉″ 提交于 2021-02-18 17:56:27
问题 My simplified program structure looks like this: public class Manager { public Item MyItem { get; set; } public void Recalculate(){ ... } } public class Item { public string SomeProperty { get; set; } } public class ManagerViewModel { public Manager Model { get; set; } public ItemViewModel MyItem { get; set; } } public class ItemViewModel { public Item Model { get; set; } public string SomeProperty { get => Model.SomeProperty; set { Model.SomeProperty = value; RaisePropertyChanged(

Data structure for Double Elmination Tournament

时间秒杀一切 提交于 2021-02-18 11:10:19
问题 I am in the process of converting my Tournament Organizer software, which allows the creation and manipulation of Double Elimination Tournaments, to use the MVVM design pattern so that it can be more easily tested. In doing so, I'm separating out the 'model' from some code in the UI that directly manipulates the bracket structure. This will be the third iteration of software I've written to handle tournaments. The first was written in PHP and stored the data in a database. The second version

Data structure for Double Elmination Tournament

我只是一个虾纸丫 提交于 2021-02-18 11:09:36
问题 I am in the process of converting my Tournament Organizer software, which allows the creation and manipulation of Double Elimination Tournaments, to use the MVVM design pattern so that it can be more easily tested. In doing so, I'm separating out the 'model' from some code in the UI that directly manipulates the bracket structure. This will be the third iteration of software I've written to handle tournaments. The first was written in PHP and stored the data in a database. The second version

WPF designer issues : XDG0008 The name “NumericTextBoxConvertor” does not exist in the namespace “clr-namespace:PulserTester.Convertors”

守給你的承諾、 提交于 2021-02-18 09:53:09
问题 I have an error that not let me see my designer.. but I have no error on a build and my program runs fine with no problem I have tried to: Clean and Rebuild Update Visual Studio Repair Visual Studio Restart my pc Nothing helped. I have no idea what more I can to do to solve it. I have to try to see in here and not worked for me even after restarted visual studio, re-built the solution the name <...> does not exist in the namespace clr-namespace <...> this is my Error: this is Xaml file:

Caliburn Micro Guard Methods not evaluating on property change

这一生的挚爱 提交于 2021-02-18 09:04:44
问题 I've been playing with the Caliburn Micro MVVM framework and am having some problems with guard methods. I have a view model: public class MyViewModel : PropertyChangedBase, IMyViewModel A property: public DateTime? Date { get{return this.date; } set { this.date = value; this.NotifyOfPropertyChange(() => Date); } } Also, i have a method in my view model with a guard method public void Calculate() { // ..some code.. } public bool CanCalculate() { return this.Date.HasValue; } And a button in my

Binding ViewModel to multiple windows

倖福魔咒の 提交于 2021-02-18 05:47:05
问题 I'm re-writing my windows forms project that does scoring for sheep shearing events (don't ask, its a huge sport in New Zealand) from vbnet to wpf c# and have struck a problem that I can't seem to overcome. I have two windows. One is the source window where you type things in (like the current event name), and the other window will display this information in a flash way for projection onto a screen (so will be on a second monitor) along with some other data coming in via XML over the network

Reacting to activity lifecycle in ViewModel

好久不见. 提交于 2021-02-18 04:39:38
问题 I'm trying to create an app which will use MVVM architecture and there's one thing I quite don't understand. Official Android docs say that's not a good idea to reference activity context in ViewModel's (as ViewModel may outlive activity) so I've started to wonder about usecase when I want to execute some action when my activity is resumed. I know ViewModel's shouldn't do business logic themselves but even if I use some service class (let's say GPSService which has to start and pauseeach time

Reacting to activity lifecycle in ViewModel

人盡茶涼 提交于 2021-02-18 04:39:21
问题 I'm trying to create an app which will use MVVM architecture and there's one thing I quite don't understand. Official Android docs say that's not a good idea to reference activity context in ViewModel's (as ViewModel may outlive activity) so I've started to wonder about usecase when I want to execute some action when my activity is resumed. I know ViewModel's shouldn't do business logic themselves but even if I use some service class (let's say GPSService which has to start and pauseeach time

Reacting to activity lifecycle in ViewModel

人盡茶涼 提交于 2021-02-18 04:38:34
问题 I'm trying to create an app which will use MVVM architecture and there's one thing I quite don't understand. Official Android docs say that's not a good idea to reference activity context in ViewModel's (as ViewModel may outlive activity) so I've started to wonder about usecase when I want to execute some action when my activity is resumed. I know ViewModel's shouldn't do business logic themselves but even if I use some service class (let's say GPSService which has to start and pauseeach time