Hi folks
I have recently joined a new developing project building a thick client application using WPF and MVVM. I have developed applications in various .NET frameworks from 1.1 through to 3.5 and all major technologies; WebForms, MVC and WinForms. On all of my projects I have enjoyed every minute of it but on this project I feel that ...
I'm creating a WPF application using the MVVM design pattern, and I'm trying to create a Combobox that allows the user to edit the items in the drop-down list at runtime, similar to the way MS Access 2007 lets you do it. So I've created a UserControl that builds on top of a Combobox... when the drop-down is shown, there is a button belo...
Can anyone direct me towards some code or a tutorial for implementing the ViewModel in Flex 3?
All I'm finding on the web are examples for Silverlight.
...
Hi all,
I'm not very good with styling in WPF, so I thought that I would ask here and see if anyone can help.
I have a combo box which is bound to a view model that has a rating and description, when I hover my mouse over a item the item changes to show the rating and description for that item.
This works ok however because some of th...
In short my question is: How do you prefer to expose filtered/sorted/grouped ObservableCollections to Views in WAF?
I was fairly happy with my first attempt which involved filtering on the VM and exposing an ICollectionView of Model objects for the View to bind to:
public StartDetailViewModel(IStartDetailView view, StartPoint start, Sc...
Hi, I hope someone can help me with this one...
Unfortunately to put all the code in is just not feasible, however.. I am implementing the MVVM pattern, I have a content presenter that displays a UserControl.
The UserControl has a number of items on it with some basic CRUD functions, e.g. Edit, Delete, etc.
I have set up the Control, ...
I am trying to understand MVVM pattern and I took a sample program to work on. The model is a C# .net library which when queried returns an IList object. I want my view to be able to add/edit/delete items in this collection thru' data binding. But I don't know how to start with this, using MVVM. Please help me out.
Model exposes an inte...
I would like my WPF Datagrid that is bound to my observable collection to have the blank row at the bottom so that the user can add more info. I've successfully bound the data, i.e. I can see it.
Why is the 'new' blank row not showing? Here is my xaml declaration:
<UserControl.Resources>
<CollectionViewSource x:Key="MyItems" Source="...
Just recently, I learned about using MVVM to decouple GUIs from the underlying model. I ended up learning as much as I could to convert my current application over to MVVM, and was largely successful. Now I need to figure out how to actually take a GUI generated in Blend and use it in place of my current GUI, which was designed in Visu...
Hi, I hope someone can help me...
Josh Smith did a great article on "WPF apps with the Model-View View-Model", and included in his article was the following code sample.
If you download the code sample and run the app and view all customers, then select a company (e.g. 4th company), then click "Create new customer" (which will open a t...
Basically I'm working on a program that processes a lot of large video and image files, and I'm struggling with the memory management side of it because I've never dealt with anything quite like this before.
For instance, it stores all these images in a database, and loads a list of videos, and then you can switch between the videos an...
I have a ViewModel that has an IsSelected property which I bind in my ListView.ItemContainerStyle XAML to an IsSelected property in my view model.
I bring up the application and populate the view model collection (which is shown in my ListView) with a lot of items, say about 2000. Then I select everything in the list via Ctrl-A. The ite...
I have come accross two ways of initializing Views and ViewModels in WPF CAL MVVM.
1 - Seems to be more popular. Requires you to resolve the ViewModel to automatically resolve the View. The ViewModel contains information about the View.
public interface IView
{
void SetModel(IViewModel model);
}
public interfac...
I have a treeview which binds to lots of nested ObservableCollections. Each level of the treeview shows an aggregated sum of all the hours in child items. For example:
Department 1, 10hrs
├ Team 10, 5hrs
│ ├ Mark, 3hrs
│ └ Anthony, 2hrs
└ Team 11, 5hrs
├ Jason, 2hrs
├ Gary, 2hrs
└ Hadley, 1hrs
Department ...
I am a newcomer to WPF, attempting to build a project that follows the recommendations of Josh Smith's excellent article describing The Model-View-ViewModel Design Pattern.
Using Josh's sample code as a base, I have created a simple application that contains a number of "workspaces", each represented by a tab in a TabControl. In my appl...
I have been working with WPF and the MVVM pattern for a while now. I'm having difficulty getting validation working in a "normal" way:
1) I'm implement the IDataErrorInfo interface in my ViewModel. The XAML looks something like:
<TextBox Grid.Column="1"
Grid.Row="1"
Text="{Binding Path=ProjectKey, ValidatesOnDataErro...
I like MVVM. I don't love it, but like it. Most of it makes sense. But, I keep reading articles that encourage you to write a lot of code so that you can write XAML and don't have to write any code in the code-behind.
Let me give you an example.
Recently I wanted to hookup a command in my ViewModel to a ListView MouseDoubleClickEvent. ...
Using EF 4, I have several subtypes of a 'Business' entity (customers, suppliers, haulage companies etc). They DO need to be subtypes. I am building a general viewmodel which calls into a service from which a generic repository is accessed.
As I have 4 subtypes, it would be good to have a 'generic' viewmodel used for all of these. Probl...
Hi... I have been looking for this on Stack Overflow, but couldnt find an answer to this yet so I hope this isnt a duplicate...
I have an app using the MVVM pattern, I like to keep things clean, but sometimes a little code behind seems cleaner than the XAML workaround.
I want to know if it is possible to trigger a command from the code...
I've totally lost in the command binding that is used in MVVM. How should I bind my object to the window and/or its command to the control to get method called on the button click?
Here is a CustomerViewModel class:
public class CustomerViewModel : ViewModelBase
{
RelayCommand _saveCommand;
public ICommand SaveCommand
{...