mvvm

Can someone help me recall what this framework / technology is called?

When I started to learn about WPF and MVVM recently, I came across some sort of framework or technology in .NET that made it really easy to request a service of some kind. In my particular case, I've got an assembly that handles writing application preferences to an XML file, and I want to let all of my assemblies in the larger applicat...

How to set focus for CustCombBox in a CellEditingTemplate when entering page at the first time(MVVM Pattern)

<data:DataGrid x:Name="dg" ItemsSource="{Binding Mode=TwoWay, Path=**ViewModel**}" HorizontalAlignment="Stretch" Width="Auto" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" AutoGenerateColumns="False" PreparingCellForEdit="dg_Pre...

Query on MVVM design pattern on WPF.

I am using MVVM architecture. I have a usercontrol UC as a View Model is a ModelData class ViewModel (UCViewModel) is binded to a usercontrol. I have three more usercontrols that is inside the usercontrol UC ( discussed above). Let's say uc1, uc2 and uc3. and the visibility of uc1 , uc2 and uc3 inside UC depends on the type select...

Silverlight MVVM framework with navigation

We're just starting up a new (our first) Silverlight project where we want to make a back office silverlight application using MVVM. Our application will need navigation through some kind of menu UI. I've been poking around the web finding various frameworks (Galasoft MVVM Light Toolkit / Silverlight.FX / Prism) to help with building a ...

Is there a book for learning MVVM and WPF at the same time?

I am trying to learn MVVM and WPF, but most WPF books seem to teach you how write your software the wrong way. So is there a WPF and uses MVVM for its examples? ...

Equivalent of PostMessage in C# to synchronize with the main thread with MVVM?

I must be retarded with searching, because here's another seemingly common problem that I haven't been able to solve. Here's my problem -- I am using WPF and MVVM, and I have a statemachine that executes in the model. If an error occurs, I need to pass information up to the ViewModel to display the error. This part seems to work okay....

database independent Silverlight application - possible ?

I am developing my application in Silverlight with MVVM pattern support. Now I use Sql server 2008, but I am start thinking about in future use also Oracle and XML as storage for my data. I query with linq to sql. It is pattern which I can use to completely automated and independent from database my application? Where I will only replac...

How do I bind an Image dynamically in XAML?

The following displays an image correctly in a silverlight usercontrol: Image image = pagingManager.BaseApp.DatasourceManager.GetImage("helloWorld1"); ContentArea.Content = image; ... <ContentControl x:Name="ContentArea"/> However, I want to dynamically bind the image to XAML, e.g. like this: #region ViewModelProperty: MainImage priv...

How to handle One View with multiple ViewModel and fire different Commands?

Hi All, I have senario in which one view and view has binding with multiple ViewModel. Eg. One View displaying Phone Detail and ViewModel as per bellow: Phone basic features- PhoneViewModel, Phone Price Detail- PhoneSubscriptionViewModel, Phone Accessories- PhoneAccessoryViewModel For general properties- PhoneDetailViewModel I have...

Enable button based on TextBox value (WPF)

This is MVVM application. There is a window and related view model class. There is TextBox, Button and ListBox on form. Button is bound to DelegateCommand that has CanExecute function. Idea is that user enters some data in text box, presses button and data is appended to list box. I would like to enable command (and button) when user ...

Automatically Raise PropertyChanged when an inner object property got changed

I got a scenario like this Class Parent { Property A; } Class A { Property X } How can I get PropertyChangedNotification on Property A when X changes? I don’t want to refer ‘Parent’ in class A or any kind of event which spoils my decoupling. What I basically want is to make the Parent.IsDirty=true. This is avery simp...

Query on MVVM pattern in WPF?

I am implementing a MVVM pattern in my WPF application. My application main window is divided into four parts: Main Menu On the Top Outlook Navigation Control on the Left. A List View on the Middle. Another List view on the bottom. The Navigation control shows different setting (configuration) controls in the Tab items. All the fo...

Is it considered bad practice to have ViewModel objects hold the Dispatcher?

My WPF application is structured using the MVVM pattern. The ViewModels will communicate asynchronously with a server, and when the requested data is returned a callback in the ViewModel is triggered, and it will do something with this data. This will run on a thread which is not the UI Thread. Sometimes these callbacks involve work that...

Bind Grid.Row / Grid.Column inside a DataTemplate

Hope this is not a dupe. I would like to be able to do the following in XAML: <DataTemplate DataType="{x:Type TestApp:ButtonVM}"> <Button Grid.Column="{Binding GridColumn}" Grid.Row="{Binding GridRow}" Content="{Binding Path=Info}" /> </DataTemplate> The Cont...

Does WPF break an Entity Framework ObjectContext?

I am getting started with Entity Framework 4, and I am getting ready to write a WPF demo app to learn EF4 better. My LINQ queries return IQueryable<T>, and I know I can drop those into an ObservableCollection<T> with the following code: IQueryable<Foo> fooList = from f in Foo orderby f.Title select f; var observableFooList = new Observa...

How to bind a property defined as usercontrol in XAML?

In XAML (Root is a UserControl), I have defined a grid with two columns. In a ViewModel layer, I have defined a property as UserControl. The ViewModel is set as DataContext of the XAML. How I can bind this property of type UserControl declarative to the grid? Thanks ...

How are views constructed in Josh Smith's MVVM sample?

Being new to both WPF and MVVM, I'm studying Josh Smith's article on the MVVM pattern and the accompanying sample code. I can see that the application is started in app.xaml.cs by constructing a MainWindow object, wiring it to a MainWindowViewModel object and then showing the main window. So far so good. However, I can't find any code ...

How do you handle 'SelectedItemChanged' events in a MVVM ViewModel?

I have some logic that depends upon two properties being set, as it executes when both properties have a value. For example: private void DoCalc() { if (string.IsNullOrEmpty(Property1) || string.IsNullOrEmpty(Property2)) return; Property3 = Property1 + " " + Property2; } That code would need to be executed every time Property1...

When is the right time to use dependency properties in MVVM?

When is the right time to use dependency properties? Should every property in you ViewModel be a dependency property? Should only certain properties be dependency properties? If there is an editable DataGridView, should all the properties be dependency properties? ...

Please suggest me the ( Interaction model of view model) MVVM design in the simple scenario discussed in the subject/

Data Layer I have an Order class as an entity. This Order entity is my model object. Order can be different types, let it be A B C D Also Order class may have common properties like Name, Time of creation, etc. Also based on the order type there are different fields that are not common. View Layer The view contains the followi...