Question: What would be the most effective way of doing a nested list which allows for data binding in the view and awareness of what shipment is selected so that command bindings from the view can function in the viewmodel on the appropriate item in any of the nested lists?
Info:
I've got a program that I've been working a lot on to...
Hello,
I'm building a simple financial record-keeping application. The main window view model holds a list of Accounts. The view shows this list (in a ListView) along with a panel showing details about the currently selected Account.
At first, I bound the details panel and ListView's SelectedItem to the same property (of type Account)...
I have been working through Josh Smith's article on MVVM at http://msdn.microsoft.com/en-us/magazine/dd419663.aspx. Each section makes sense to me but I am having a hard time putting it all together as a coherent unit mentally. I have 2 questions that would help a ton.
If I were to build the sample ap, what would be the logical order t...
Hi All,
This may be a no brainier but I just can't seem to get it to work. I have a view model that exposes a property called bool NotFound I would like to bind that to a trigger so that when it changes an image on my control changes.
This is the xaml that I am using as a data template for one of my view models.
<DataTemplate DataTyp...
I'm following the example here of binding a MenuItem to a data object.
<Menu Grid.Row="0" KeyboardNavigation.TabNavigation="Cycle" ItemsSource="{Binding Path=MenuCommands}">
<Menu.ItemContainerStyle>
<Style>
<Setter Property="MenuItem.Header" Value="{Binding Path=DisplayName}"/>
...
Hi,
I'm in the process of moving my application from .NET 3.5 to .NET 4.0, and I get the following error message : "Can't put a page in a Style". I've implemented the MVVM pattern for this application and use Data Templates to tell the application how to render my various view models...for example below.
<DataTemplate DataType="{x:Typ...
I have got an Indexer property in a Class called X, suppose X[Y] gives me a another object of Type Z
<ContentControl Content="{Binding X[Y]}" ...???
How can I make a DataBinding happens inside indexer? It works if I do {Binding [0]} . But {Binding X[Y]} just takes the indexer parameter as a string which is "Y"
Update :
Converter i...
I'm building a WPF app and trying to conform to MVVM best practices. I'm using the MVVM Foundation framework and noticed the Messenger class, which I've read should be used for handling dialogs in WPF. This sounds great, but I'm totally not understanding how to use a Messenger for this purpose. Literally, all I want to do is open a modal...
I have a WPF Toolkit DataGrid bound to an ObservableCollection of Car in my view model. Car has a PropertyChanged event and the setters of each of its two string properties fire the event. I also have the grid's SelectedItem property bound to a property in the view model of type Car, also called SelectedItem.
On the same window as the...
It seems that others have had variations on this question, but from what I can tell it hasnt been addressed for folks using collections in a single view model.
I have a VM that contains an ObservableCollection of objects, not a VM for each object. Therefore I dont think I can use the SelectedItem bool that is often discussed because I ...
I have a wpf window which is used to add as well as edit information about an entity.
I am using mvvm architecture and ADO.Net entity model.
The screen looks something like this -
<!-- EmployeeView -->
<Window .....DataContext={.....}>
<WpfToolkit:Datagrid x:Name="dgEmployees"
CanUserAddRows="fals...
I have a a user control which contains sevral other user controls. I am using MVVM. Each user control has a corresponding VM. How do these user controls send information to each other. I want to avoid writing any code in the xaml code behind. Particularly I am interested in how the controls (inside the main user control) will talk to eac...
Hello,
I've just come across this problem with my checkbox data binding. The scenario is:
When I initialize the user interface (start the application), the checkboxes are unchecked, although the property they are bound to is set to true. When I click the checkbox, the property is set to false, but the checkbox is still shown as uncheck...
Can you please give an example of how you would use (your favorite) DI framework to wire MVVM View Models for a WPF app?
Will you create a strongly-connected hierarchy of View Models (like where every nested control's ViewModel is a property on a parent's ViewModel and you bind it to nested control's DataContext in XAML) or you would us...
I have an application that need to open a dialog from a button where the user enters some information.
At the moment I do it like this (which works fine)
The button click generates a command in the ViewModel.
The ViewModel raises an event which the Controller listens to.
The Controller works out the details of the new window (i.e. Vie...
If I have a MultiPresenter and I am using a ListBox to display the Presenters it is hosting, how do I get Caliburn to discover and bind the views and view models for the items?
For example, if I have a simple view that looks something like this:
<UserControl x:Class="MyProject.Views.CarView"
xmlns="http://schemas.microsoft...
I have two HeaderedContentControls like those below that each have their content property bound to one of two view model properties of the same base type (one control is on the left side of the window and one on the right, thus the view model property names).
However, either view model property can be one of four different derived types...
Hello,
In particular I would like to know how to bind the 'SelectionChanged' event of the dataGrid to a Command on my Viewmodel.
Since DataGrid doesnt have a Command property, how do I call a modelView command as in MVVM fashion? I dont mind using a delegate on the code behind XAML, if I knew how to do that...
Since I am new to WPF I ...
First attempt at implementing MVVM pattern on line-of-business project. I am running into questions that I assume there are eaiser answers for like this one:
Protype window is basic master-detail view of a list of items. (a list of Person objects). The view contains an Infragistics xamDataGrid for the master list. As the item is select...
I have this problem, I've got Silverlight app written using MVVM. I need to create DataForm which is binded to property on ViewModel and I want to add ComboBox and fill it with values from other collection in the same ViewModel.
Code:
<dataFormToolkit:DataForm CurrentItem="{Binding NewUser, Mode=TwoWay}" AutoGenerateFields="False" Heig...