mvvm

MVVM User control - where do i declare it to get data from page ?

I have a WPF user control ...which is in MVVM. The user control(which contains a listview) need data from the page (where it is included). I have to set a property in View's code behind to get this data input. Will this comply with MVVM(But MVVM pattern do not support adding code in code behind file of view as far as i know).if not, what...

Good Sites that are describing about MVVM Pattern

Hi, i started the learning MVVM pattern. So could anybody help me to list Some Good Sites that are describing about MVVM Pattern. thanks in advance. ...

WPF/MVVM: Delegating a domain Model collection to a ViewModel

A domain model collection (normally a List or IEnumerable) is delegated to a ViewModel. Thats means my CustomerViewModel has a order collection of type List or IEnumerable. No change in the list is recognized by the bound control. But with ObservableCollection it is. This is a problem in the MVVM design pattern. How do you cope with ...

Databinding to individual properties of the main Dataobject

This is my ViewModel Code: vb: Public Property Doctor() As Doctor Get Return _objDoctor End Get Set(ByVal Value As Doctor) _objDoctor = Value OnPropertyChanged("Doctor") End Set End Property Public Property AddDate() As Nullable(Of DateTime) Get ...

How can I extend a ComboBox to support commands (MVVM)?

Hi, As topic says, I need to extend the features of a standard Silverlight ComboBox to also support Commanding. Since I follow MVVM I need my ComboBox to communicate the SelectionChanged event to my ViewModel. What would the code look like for doing this? I want to be able to put the Command attribute on my ComboBox XAML control. Usin...

How do I MVVM-ize this MouseDown code in my WPF 3D app?

In my view, I have: <UserControl x:Class ... MouseDown="UserControl_MouseDown"> <Viewport3D Name="Viewport" Grid.Column="0"> ... </Viewport3D > </UserControl> In my code-behind, I have: private void UserControl_MouseDown(object sender, MouseButtonEventArgs e) { ((MapPanelViewModel)DataContext).OnMouseDown(e, View...

Silverlight MVVM in VS2008 - a non starter?

I'm still very new to Silverlight. I'm currently using vs2008 at work. As far as I can gather Silverlight 4 is vs2010 only. I stumbled across this article on command binding, it says that command binding is a new feature introduced in silverlight 4. Is command binding integral to MVVM in silverlight, does it make MVVM much simpler to im...

Succinct But Complete Example of WPF App?

Is there a succinct but complete example project or tutorial that brings together the pieces of the Microsoft stack for a complete application? WPF MVVM Business Objects EF Database I find plenty for WPF and plenty for EF, but am having trouble fully understanding how the EF generated classes relate to business objects, and how thos...

MVVM - ListBox SelectedItem Binding Property Going Null

So i have a listbox: <ListBox x:Name="listbox" HorizontalAlignment="Left" Margin="8,8,0,8" Width="272" BorderBrush="{x:Null}" Background="{x:Null}" Foreground="{x:Null}" ItemsSource="{Binding MenuItems}" ItemTemplate="{DynamicResource MenuItemsTemplate}" SelectionChanged="ListBox_SelectionChanged" SelectedItem="{Binding SelectedItem}"> ...

What is it in MVVM that makes it particularly appealing for managed WPF and Silverlight but not native C++?

What is it in WPF and Silverlight that makes MVVM suit them so well? What is it in C++, or what does C++ lack, that makes MVVM and C++ never be mentioned together? ...

Page navigation in silverlight 4 using MVVM pattern

Hello, I have a a navigation application developed in Silverlight 4. It has a main page which contains a frame. I load a particualr view in that frame and I know that I can use NavigationService to navigate to other page which would be loaded in the same frame. But my question is how it can be done using MVVM? To get the frame do I ne...

WPF - Handling events from user control in View Model

I’m building a WPF application using MVVM pattern (both are new technologies for me). I use user controls for simple bits of reusable functionality that doesn’t contain business logic, and MVVM pattern to build application logic. Suppose a view contains my user control that fires events, and I want to add an event handler to that event. ...

MVVM with animations (should I use VisualStateManager?)

I've got a View.xaml with the following set in Resources-section: <DataTemplate DataType="{x:Type ViewModels:MyFirstViewModel}"> <Views:MyFirstView Content="{Binding}" /> </DataTemplate> <DataTemplate DataType="{x:Type ViewModels:MySecondViewModel}"> <Views:MySecondView Content="{Binding}"/> </DataTemplate> In the content of ...

problem in xbap mvvm implementation

Hi, I am trying to implement a mvvm design pattern for xbap application But unable to carry out simple text binding. Following is the definition of my DemoViewModel.cs, class DemoViewModel : INotifyPropertyChanged { string name; public event PropertyChangedEventHandler PropertyChanged; public string Name { ...

SelectionChanged event binding in Silverlight+MVVM-Light

The handler of the "SelectionChanged" event of the ComboBox control has the following signature: void SelectionChangedMethod(object sender, SelectionChangedEventArgs e) How to bind to that property under Silverlight 4 and MVVM-Light to the corresponding method of the ViewModel object? As far as I know, I need to do something like thi...

Initialization of ComboBox in datagrid, Silverlight 4.0

I have datagrid with list of MyPlayer objects linked to ItemsSource, there are ComboBoxes inside of grid that are linked to a list of inner object, and binding works correctly: when I select one of the item then its value is pushed to data model and appropriately updated in other places, where it is used. The only problem: initial sele...

WPF/MVVM: Reshaping/Binding data on a DataGrid to a PivotGrid layout ?

Hello, I do not want to use 3rd party controls because I would have to buy a suite for justing using one control... So is there any chance I can arrange 3 entities: Subject, Grade and Pupil in that way on a simple DataGrid to show Pivot data like: ...........Math....Sports.... M.Kramer...A.......C......... B.Jonson...D.......A........

In wpf how to handle a event raised by a button inside user control in the page which uses that user control

Hi I am using MVVM architecture. I had created a user control which contains a button control. I want the click event of the button control to be captured in page which uses this user control. How to do this? Plase help :) ...

Problem Binding a ObservableCollection to a ListBox in WPF/MVVM

I'm working in some code , using wpf and starting to use mvvm. So far i have no problem, when i have one element and I have to show the values of it in the screen (binding of the specific name of the property). But now, i have to work with a property list , not knowing the names of it. So I created a class, named GClass, that only have t...

Send a empty Message or Notification with MVVM toolkit light

I'm using the MVVM Light Toolkit. I could not find any Ctor of Messenger or Notification class to send a empty message. ViewModel1: private int _selectedWeeklyRotation; public int SelectedWeeklyRotation { get { return _selectedWeeklyRotation; } set { if(_selectedWeeklyRotation == value) ...