Hi,
I put a ListView in the middle row of a View. The view is contained in a window that has SizeToContent set to WidthAndHeight. The ListView is initially empty, but the underlying ViewModel fills this list view in the process.
The middle Grid.Row height is set to * to fill the available size of the window. When the ListView receives ...
Hello,
I have a MeetingViewModelList bound to a DataGrid.
Each MeetingViewModel has a DocumentViewModelList bound to a ListBox within the DataGrid`s DataGridTemplateColumn.
The IsSelected property of the DocumentViewModel is bound to the ListBox`s Item property IsSelected.
I get no binding errors in the output console.
The delete d...
Does the ASP.NET MVC 2 Default View Model Binding support binding a multi-value cookie to a custom object? Before I write a custom Value Provider, I would like to be sure that the functionality didn't already exist.
So given an action like:
public ActionResult SomeAction(CustomObject foo)
where CustomObject is something like:
public...
Hello all,
thats the way josh smith is doing the add-a-customer-procedure:
**CustomerViewModel**.cs:
public void Save()
{
_customerRepository.AddCustomer(_customer);
}
**CustomerRepository**.cs:
public void AddCustomer(Customer customer)
{
//...
_cus...
If I have an object that is composed of nested complex types, e.g. a ViewModel that has a List<Fu> and a List<Bar>
public class WarViewModel
{
List<Fu> Fu { get; set; }
List<Bar> Bar { get; set; }
}
public class Fu
{
public int Id {get;set;}
public Soldier Private { get; set; }
}
public class Bar
{
public int Id {g...
I'm having a weird (at least to me) problem with validation using ViewModels and Html.EditorFor(T). The validation errors produced by <%: Html.ValidationSummary(false) %> lists properties which are not invalid, and do not correspond to the values in the ModelState dictionary when I view it in debug. I'm using strongly typed view models c...
Hi,
I have a viewmodel named EmployeeViewModel which is inherited from ViewModelBase. here is the implementation of ViewModelBase.
public event PropertyChangedEventHandler PropertyChanged;
public void FirePropertyChanged(string propertyname)
{
var handler = PropertyChanged;
if (handler != null)
ha...
Hello,
we mvvm lovers all know Josh Smith mvvm sample and how he has saved the customer in the detail customer view by injecting the repository object into the customerViewModel`s constructor.
But a viewmodel should not know about repositories. Its just a model of a view nothing must being aware of persistence etc...
How can I registe...
I think I got some sort of knowledge flash and now I am totally confused. I looked at many mvvm implementations like Ocean,Stuff,BBQShack,MVVM demo,WAF,Chinch1,2 etc...
Everyone is doing MVVM differently somehow...
There is ONE scenario that drives me nuts. I am missing understanding and I hope someone can clear the clouds in my head.
...
Hi All,
I've found a couple of posts that describe similar scenarios to mine but nothing that has the same concept or has been resolved so I'm sure I will get complaints about this question but I still want to ask it so some of you more knowledgeable than my self can give me some advice.
My problem is hydrating a Viewmodel from a Lin...
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, AboutView...
What I need to find is when a textbox's value is changing or the dropdown's value changes inside my datatemplate item, I need to be notified in my ViewModel.cs.
So basically as a user edits a textbox inside the listbox, the viewmodel will be notified as the values are changing.
The reason is I need to go through all my Entries and upda...
Hi!
I have two questions regarding communication between ViewModels.
I am developing a customer management program. I'm using Laurent Bugnion's MVVM Light framework.
In the main page, there's a list of customers. when each customer is clicked, a child windows shows up with information about that customer. the user should be able to o...
What is a model.cs file?
This appears in a project I am sharing with other dev's. What is a model.cs file?
...
Hello,
I'm writing in wpf. In my viewModel I have a command that opens new window. However sometimes this child window is placed under the parent window. (if for instance I work in my application, then open browser and want to return to my application). Window is opened as follows:
MyViewModel vm = new MyViewModel(oper);
Mywindow wind...
So I have an almost 1:1 ratio of views to view models and things seem to be going well. If I understand their purpose correctly it seems that view models should "Strip down" Entity models so that only relevant properties are passed to the presentation layer Add additional information needed for presentation such as a list of state abbrev...
I have a video progress slider in XAML thus:
<Slider Minimum="0" Value="{Binding Position,Mode=OneWay}" Maximum="{Binding Duration}" IsMoveToPointEnabled="True"/>
And code in my viewmodel to update Position on Clock.CurrentTimeInvalidated(), which keeps the slider tracking current progress:
private void Play()
{
Uri next = _carousel....
In Viewmodel, I want to track the status of async call. Suppose I have two async calls in viewmodel, I want to track when all async call done.
What I did as below:
Set to private var to track each async calls:
private bool _isDone1 = false;
private bool _isDone2 = false;
Set one property like:
private bool _isDone;
public bool IsD...
Hi,
I have a WPF application that mostly follows MVVM, which I am trying to automate.
In some of my user controls I bind the Content property to the ViewModel of another user control. There is a data template defined which maps the ViewModel to the correct View to show on the screen.
This works fine for when the application is run b...
I have MainWindow with a statusbar and multiple user controls in it. Each user control has a viewmodel. How do I bind/update the statusbar text from multiple viewmodels?
...