viewmodel

Error: This PlotModel is already in use by some other PlotView control

故事扮演 提交于 2019-12-24 02:31:41
问题 I have two tabs that is bind to one viewmodel which contain a PlotModel of oxyplot and view model selected through a DataTemplate . When click on the first tab the viewmodel was bind properly but when switch to second tab above exception defined in title throw. All of control is same in two tab. Is it possible bind one object to two controls? 回答1: I know what problem you are facing, as I had faced it myself. Oxyplot does not let you bind one model to two plots. The reason: Once you assign a

MVC4: nested partial-view loses model data

大兔子大兔子 提交于 2019-12-24 01:25:18
问题 In an MVC4 project im using a partial View thats using a ViewModel and has a GET Form on it. In the Controller action i expect the ViewModel object with some data. When this partial is placed on a normal (.cshtml) View, i recieve the data via the expected ViewModel object in the Controller action. But, When this partial is placed on another partial view , for some reason the ViewModel object in the controller action is empty. When i step through the creation of the HttpGet-form, the passed-in

MVC ASP.NET No parameterless constructor defined for this object

雨燕双飞 提交于 2019-12-23 19:46:30
问题 When I click submit in order to create an account the following error is displayed. I can't find why it is giving the following error. Also I tried to use breakpoints and debugging but it was useless No parameterless constructor defined for this object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System

Where do you like to put MVC view model data transformation logic?

梦想与她 提交于 2019-12-23 08:53:48
问题 Here is the scenario, I need to load up a view model object from a several domain objects that are being returned from multiple web service service calls. The code that transforms the domain model objects into the digestible view model object is a bit of fairly complex code. The three places that I have thought about putting it are: Internal methods inside of the controller to load up an instance view model. Static get method or property on the view model class itself that returns a loaded

Do I have to Load/Get an entity before SaveOrUpdate in Nhibernate?

删除回忆录丶 提交于 2019-12-23 08:08:21
问题 in my ASP.NET MVC application I've separated the domain model from the view model. I transform my entity in a viewmodel object so I can "feed" my views with only the data needed (I used valueinjecter for this purpose). During the save process my controller gets back the viewmodel object, transforms it into a domain model entity and try to persist it with SaveOrUpdate. I've noticed that if I try to update an existing record, Nhibernate considers it as a new object and forces an INSERT, even if

viewmodel inheritance and duplicate model references

痞子三分冷 提交于 2019-12-23 03:10:06
问题 My question is: How to manage an inheritance chain of viewmodels? My situation: I'm having a standard ViewModelBase which only implements the INotifyPropertyChanged interface. Furthermore I have a BusinessObjectViewModel which has a Guid, a PersonBaseViewModel which has the persons core data, a CustomerViewModel with customer related stuff and a EmployeeViewModel with employee related stuff. All viewmodels certainly encapsulate a modelobject (Customer, Employee, PersonBase).

ASP.NET MVC: having one model for all views

天大地大妈咪最大 提交于 2019-12-23 02:55:08
问题 I like the way model binding in django works: you send stuff that you need in a Json-like way: 'param1': val, 'param2': val In ASP.NET MVC you can't do it primarily because C# is a static language. You can use ViewData but it's ugly and not recommended. So I had to create dozens of ViewModels for every view: IndexViewModel, AboutViewModel, etc. And today I got an idea: why not just create one Model class and have Visual Studio generate all necessary fields? It's almost like in django. return

ASP.NET MVC: having one model for all views

浪尽此生 提交于 2019-12-23 02:55:06
问题 I like the way model binding in django works: you send stuff that you need in a Json-like way: 'param1': val, 'param2': val In ASP.NET MVC you can't do it primarily because C# is a static language. You can use ViewData but it's ugly and not recommended. So I had to create dozens of ViewModels for every view: IndexViewModel, AboutViewModel, etc. And today I got an idea: why not just create one Model class and have Visual Studio generate all necessary fields? It's almost like in django. return

ViewModel bind record phantom

蹲街弑〆低调 提交于 2019-12-23 01:46:35
问题 I want to hide a checkbox depending on wheter a record is phantom. Trying to implement this using viewmodels, but it doesn't seem to work. See below for the related code. I've left out unrelated code for brevity. The binding of the viewModel to the view is working as expected. When I try to bind activeRecord.name to the title attribute 2-way data binding is working correctly. Viewmodel Ext.define('MyApp.view.content.ContentViewModel', { extend: 'Ext.app.ViewModel', alias: 'viewmodel.content',

Debugging Silverlight not hitting breakpoints

别说谁变了你拦得住时间么 提交于 2019-12-23 01:24:13
问题 i am trying to develop a Silverlight application for a school project. But I’m having problems with Visual Studio not loading the break point, making it very hard to debug a Silverlight application using ViewModels. I have tried adding "Silverlight" under "Project Properties" -> "Web" -> "Silverlight", but this have done nothing. It is strange because it works some times. I have tried using Chrome, Firefox and Internet Explorer. And with Silverlight 4 and 3. Do any one know a solution for