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...
<data:DataGrid x:Name="dg" ItemsSource="{Binding Mode=TwoWay, Path=**ViewModel**}" HorizontalAlignment="Stretch" Width="Auto"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
AutoGenerateColumns="False"
PreparingCellForEdit="dg_Pre...
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...
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 ...
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?
...
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....
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...
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...
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...
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 ...
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...
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...
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...
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...
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...
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
...
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 ...
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? 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?
...
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...