Hi everyone, I am writing an app that listens on a network connection, and when some data arrive, it replies back, and depending on incoming data, it may need to ask user (show dialog) before replying back.
I don't know how to do this cleanly in M-V-VM architecture: the events and binding to observable collections are nice if I need to ...
I'm building a simple UserControl example with DependencyProperties so that the properties of the control can be changed in XAML (code below).
But of course in my application I don't want this control to have tightly-coupled code-behind, but instead the user control will be a view called "DataTypeWholeNumberView" and it will have its ow...
I'm just getting started with M-V-VM and WPF and having issues understanding some binding issues.
I have a login page that has a ComboBox and PasswordBox. The ComboBox looks like this:
<ComboBox Name="comboBox1" SelectedItem="{Binding Path=Username}">
This works just fine - my values get updated everytime the SelectedItem changes on...
Hi,
i read the answer of the question Do event handlers stop garbage collection from occuring?, but what happens when the publisher is the target ?
To be more specific, i am using MVVM design for a WPF app. Model-View classes raise a NotifyPropertyChanged on every change. In some classes, i need to call a method when something is modif...
I am using mvvm in a wpf app. I have a ContextMenu inside of a listview and when I right click a listviewitem i want a contextmenu to display a list of Contacts.
The following just gives me a contextmenu with no content. Can anyone tell me what I'm doing wrong?
<ListView Grid.Row="3"
ItemsSource="{Binding Path=Phones}"
...
Ok, I've spent 2 days trying to work out how to do this and have so far achieved a score of 'FAIL'.
The design is this:
A ViewModel class exposes a public ObservableCollection property called People.
A XAML view is bound to this property
The desired behaviour is this:
Add a new Person to the ViewModel's collection
The View animat...
In my previous projects, I have already implemented undo system in c++, and I know how it work. I am also aware of the Command pattern.
I will be implementing a C#/WPF desktop application and would like to base my design on the M-V-VM pattern.
The application will:
be relatively a small project (2-3 weeks estimated work for 1 dev)...
I am applying the MVVM pattern per Josh Smith and having difficulty. I've been researching the problem here and can't seem to get the syntax quite right.
The code below looks to me like it follows the required syntax, but Visual Studio reports error "Delegate 'System.Action' does not take '2' arguments" on the line indicated.
Can some...
I can't quite figure out how to get the view model to be notified of changes in the model without adding a bunch of UI specific stuff like INotifyProperyChanged and INotifyCollectionChanged in my model or create tons of different events and do a bunch of things that feel like they're UI specific and should stay out of the model.
Otherwi...
Well this question relates to MVVM pattern and i could good and fast answers on this forum so I thought to ask and clear the confusions i had about the pattern.
I am quite new to MVVM approach. I appreciate the pattern and understand the principals behind it. Maybe I have not worked that much with the pattern that’s why there are a few ...
It feels like there must be some semi-simple solution to this, but I just can't figure it out.
Edit: The previous example showed the infinite loop more clearly, but this gives a bit more context. Check out the pre-edit for a quick overview of the problem.
The following 2 classes represent the View-Models of the Model View View-Model (...
I installed the MVVM Visual Studio Template.
It now appears in:
Visual Studio C# Express 2008 (English)
but not in:
Visual Studio 2008 (German)
Visual Studio 2005 (German)
I reproduced this on another machine as well.
Has anyone been able to install the MVVM Visual Studio template in a full version of Visual Studio in any langu...
Hi All,
Hopefully quite a simple one, having my first try at WPF with Prism V2 using M-V-VM and so far finding everything pretty awsome. My Shell is pretty simple, Ribbon Control at the Top, DataGrid of Help desk tickets on the left, and a TabControl on the right.
When a user opens the selected ticket from the datagrid, I want the Tic...
Project Overview
I have a view which binds to a viewmodel containing 2 ObserverableCollection. The viewmodel constructor populates the first ObserverableCollection and the view datacontext is collected to bind to it through a public property called Sites.
Later the 2ed ObserverableCollection is populated in the LoadOrders method and t...
Hi,
I am attempting to use an MVVM-ish approach to my WPF development.
I have my logical view model classes under the ViewModel namespace, and I have matching styling for these view model classes under the View namespace.
For now I have my View information in ResourceDictionary XAML files, as DataTemplates and Styles, which are all me...
I don't really see the need for element to element binding in Silverlight 3 if using MVVM. Won't having one property directly affect another proper cause that property to be untestable?
To me, it makes more sense to do a two way binding to a explicit property defined in the ViewModel.
...
Hi,
In my MVVM application, I have a Direct3d render window that shows a bunch of 3d meshes in a scene. In that render window, I want to be able to click on one of those 3d meshes in the scene and move it around, having it follow the mouse cursor. This is typical 3d editor stuff, moving a mesh along in screen space. So I need to be able...
I have several bookmarked, but only have so much time in a day to read/study blogs. If I were to pick three blogs to read on a daily basis for deep understanding of WPF what should I read?
...
WinForms has given way to WPF and new models such as MVVM, that better enable Test Driven Development, work very nicely with WPF. Also, it seems to me that ASP.NET is very closely aligned with the WinForms way of doing things, for example event handlers in the code-behind which is linked using inheritance or partial classes. With WPF a...
In my View, I have a button.
When the user clicks this button, I want to have the ViewModel save the context of the TextBlock in the database.
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top">
<TextBlock Text="{Binding FirstName}"/>
<TextBox Text="Save this text to the database."/>
<Button Content="Save" Comma...