Search Results

Search found 1189 results on 48 pages for 'mvvm'.

Page 3/48 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Silverlight 4 WCF RIA Services and MVVM is not as simple

    - by Thomas Jaskula
    [Disclaimer: I'm ASP.NET MVC Developer] Hi, I'm looking for some best practices with implementing MVVM pattern with WCF RIA in Silverlight 4. I'm not looking to use MEF of IoC for locating my ViewModels. What I would like to know is how to apply MVVM pattern with Silverlight 4 and WCF RIA. I don't want to use other stuff like Prism or MVVM Light toolkit. I found many examples on Internet showing how it is wonderful to drag and drop a datasource on the view and the job is done (it reminds me about my first VB6 developments). I tried to implement MVVM with WCF RIA and it's not strightforward at all. If I understand, the MVVM should contain all the logic in order to unit test it in isolation but when it comes to combine it with WCF RIA it's another story. I have the following questions. Can I use a generated metadata as model ? It would be easier to use it that if I write all from the scratch. As I saw the only way I could get data is through DomainContext or through direct binding in the view (local ressource). I don't want the direct binding in the view, not testable at all. On the other hand I can't use DomainContext, it doesn't expose any single entity !!! All I have is the EntitySet that I can bind to datagrid. How do I bind a single Entity to the DataForm from the ViewModel ? How do I udpate the model to the database ? How do I navigate from one Entity to a collection of it's itemps. For example if I have a Company Entity I would like to show a DataFrom to update a entite informations and a datagrid to show companies adresses. When saving a form would like to save information to Company and for example an information avout which adress was selected as active. Please help me understand how to do it well. Or maybe I should drop the WCF RIA and to do it with WCF from scratch ? What do you think ?

    Read the article

  • MVVM Madness: Commands

    - by JP
    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. I wasn't quite sure how to do this. Fortunately, Google has answers for everything. I found the following articles: http://blog.functionalfun.net/2008/09/hooking-up-commands-to-events-in-wpf.html http://joyfulwpf.blogspot.com/2009/05/mvvm-invoking-command-on-attached-event.html http://sachabarber.net/?p=514 http://geekswithblogs.net/HouseOfBilz/archive/2009/08/27/adventures-in-mvvm-ndash-binding-commands-to-any-event.aspx http://marlongrech.wordpress.com/2008/12/13/attachedcommandbehavior-v2-aka-acb/ While the solutions were helpful in my understanding of commands, there were problems. Some of the aforementioned solutions rendered the WPF designer unusable because of a common hack of appending "Internal" after a dependency property; the WPF designer can't find it, but the CLR can. Some of the solutions didn't allow multiple commands to the same control. Some of the solutions didn't allow parameters. After experimenting for a few hours I just decided to do this: private void ListView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { ListView lv = sender as ListView; MyViewModel vm = this.DataContext as MyViewModel; vm.DoSomethingCommand.Execute(lv.SelectedItem); } So, MVVM purists, please tell me what's wrong with this? I can still Unit test my command. This seems very practical, but seems to violate the guideline of "ZOMG... you have code in your code-behind!!!!" Please share your thoughts. Thanks in advance.

    Read the article

  • MVVM framework AND Prism 4?

    - by Karsten
    I just read this question. It has some nice answers, but they are over 1 year old, and a lot have changed in this space over the last year. Some of the most popular frameworks have come out in a new mayor release such as Prism and MVVM Light Toolkit. My question is somehow the same, but with one twist, I'm already using Prism 4.0 because of the region and module features. Prism 4.0 embraces MVVM, but I feel there are something which are "not lightweight", for instance interaction requests. So I'm thinking would it better to use another MVVM framework either as a substitute or a supplement for Prism 4.0?

    Read the article

  • WPF MVVM Pattern - References

    - by KroaX
    Hi everyone I wanted to know if some of you guys can post some articles, blog posts etc. that explain the MVVM Pattern in detail. There are not much explainations out there I think ( except Tutorials). I'm going to write my exam about WPF and also want to build in the MVVM Pattern. So I need some good references that are also digging a little deeper. I think I already have read a lot of texts about MVVM, but maybe you guys got some I didn't read yet. Would really appreciate if you would share your links to good and worth reading articles and explanations

    Read the article

  • Any MVVM frameworks work well with NavigationWindows?

    - by Will
    I'd like to "throw away" the current version of a WPF application and move version 2 to a stable MVVM framework. The main concern I'm having is that I don't see much talk about MVVM frameworks and navigation (i.e., NavigationWindows and Frames). My current app relies heavily on Pages to present views to the user. I would prefer to keep it this way. I'd rather not change everything to UserControls and rely on DataTemplates to switch out the view I need to present. Are there any MVVM frameworks that: Work well with NavigationWindows and Pages Provide ViewModels adequate access to the navigation process Provide the ability to change navigation in response to security-related events (e.g., redirect to login Page after logout)

    Read the article

  • how to start animation using MVVM?

    - by Kishore Kumar
    I am converting my exising Application using WPF using MVVM pattern. I have different storyboards in my view . eg. 1. showing splashscreen while loading the app 2. while clicking Menu Toggle button/Radio Button to show the slide in and Slide out animation effect 3. And different mouseover effect for different elements available in the View. How will i call the storyboard using MVVM and which is the best method?. To show the mouse over effect do we really have to use MVVM or code behind?

    Read the article

  • How to use Messageboxes in MVVM?

    - by BigTiger
    It seems that the XAML in MVVM pattern has difficulty to pop-up a Messageboxes. My client insists that the validation labels and colors are not good for them. They still want a messagebox. How can do it? I know I can pop-up messageboxes in the view-model, but it violates the whole purpose for the view-model. I can also raise a error, and pop-up a messagebox in some exception handlers, but the messagebox is not an exception. It is part of the normal program flow. Is there a good way to do it in XAML? My client likes messageboxes. She does not care about the MVVM pattern, she never had any quality problem before using MVVM and unit test. But now, she can not even get her messageboxes, so she is not very happy. Your help is definitely appreciated ... I need to make her happy.

    Read the article

  • MVVM application architecture, where to put dependency injection configuration class, BusinessLayer and Common interfaces?

    - by gt.guybrush
    Planning my architecture for an MVVM application I come to this: MyApp.UI View MyApp.BusinessLayer ViewModel MyApp.DataAccessLayer RepositoryImplEF MyApp.DomainLayer DomainObject RepositoryInterface MyApp.Common Logging Security Utility (contains some reflection method used by many levels) CustomException MyApp.UnitTest I was inspired by Domain-driven-desing, test-driven-development and onion architecture but not sure to have done all well. I am not sure of a couple of things: where to put dependency injection configuration class? In the common project? where to put BusinessLayer interfaces? in Domain layer? where to put Common interfaces? in Domain layer? But Common in referenced from domain (for some reflection utilities and for DI if the response to 1. is yes) and circular reference isn't good

    Read the article

  • Open File Dialog MVVM

    - by Jose
    Ok I really would like to know how expert MVVM developers handle an openfile dialog in WPF. I don't really want to do this in my ViewModel(where 'Browse' is referenced via a DelegateCommand) void Browse(object param) { //Add code here OpenFileDialog d = new OpenFileDialog(); if (d.ShowDialog() == true) { //Do stuff } } Because I believe that goes against MVVM methodology. What do I do?

    Read the article

  • MVVM load data during or after ViewModel construction?

    - by mkmurray
    My generic question is as the title states, is it best to load data during ViewModel construction or afterward through some Loaded event handling? I'm guessing the answer is after construction via some Loaded event handling, but I'm wondering how that is most cleanly coordinated between ViewModel and View? Here's more details about my situation and the particular problem I'm trying to solve: I am using the MVVM Light framework as well as Unity for DI. I have some nested Views, each bound to a corresponding ViewModel. The ViewModels are bound to each View's root control DataContext via the ViewModelLocator idea that Laurent Bugnion has put into MVVM Light. This allows for finding ViewModels via a static resource and for controlling the lifetime of ViewModels via a Dependency Injection framework, in this case Unity. It also allows for Expression Blend to see everything in regard to ViewModels and how to bind them. So anyway, I've got a parent View that has a ComboBox databound to an ObservableCollection in its ViewModel. The ComboBox's SelectedItem is also bound (two-way) to a property on the ViewModel. When the selection of the ComboBox changes, this is to trigger updates in other views and subviews. Currently I am accomplishing this via the Messaging system that is found in MVVM Light. This is all working great and as expected when you choose different items in the ComboBox. However, the ViewModel is getting its data during construction time via a series of initializing method calls. This seems to only be a problem if I want to control what the initial SelectedItem of the ComboBox is. Using MVVM Light's messaging system, I currently have it set up where the setter of the ViewModel's SelectedItem property is the one broadcasting the update and the other interested ViewModels register for the message in their constructors. It appears I am currently trying to set the SelectedItem via the ViewModel at construction time, which hasn't allowed sub-ViewModels to be constructed and register yet. What would be the cleanest way to coordinate the data load and initial setting of SelectedItem within the ViewModel? I really want to stick with putting as little in the View's code-behind as is reasonable. I think I just need a way for the ViewModel to know when stuff has Loaded and that it can then continue to load the data and finalize the setup phase. Thanks in advance for your responses.

    Read the article

  • Clean separation of UI with Caliburn MVVM

    - by sylvie
    Looking into various MVVM frameworks for SL. In the Caliburn documentation I saw a code in a controller that calls MessageBox. Is this right or is this just for intro? Is there something like MessageBox service in Caliburn like in Chinch MVVM?

    Read the article

  • Childwindows in MVVM

    - by VexXtreme
    Hi I'm having a problem understanding something about MVVM. My application relies on dialogs for certain things. The question is, where should these childwindows originate from? According to MVVM, viewmodels should contain only businesslogic and have zero actual knowledge about UI. However, what other place should I call my childwindows from, considering they're UI elements? Doesn't this create tight coupling between elements?

    Read the article

  • MVVM Light with ASP.Net MVC ?

    - by Hasan
    Hello, I'm a big fan of MVVM Light and I use it in my WPF Application. It works Greeeeat. I have a new project in asp.net mvc. And I'm wondering : Is anyone already tried to use mvvm light and asp.net mvc ? I know that some components will obviously not work but maybe, someone has achieved to do a better job with it. Thanks for your feedback :) Hasan

    Read the article

  • Learning MVVM for WPF

    - by Mohit Deshpande
    I am now very comfortable with WPF, but I read some articles about MVP and MVVM that find the default project solution ineffective. Then I realized how ineffective it was and how the MVVM pattern is much better. So I want to really learn this pattern. Can I be directed to some resources like maybe a tutorial or a video or something?

    Read the article

  • WPF & MVVM: Any examples using VB.Net?

    - by LantisGaius
    Almost every example of MVVM I found is coded in C#, are there any examples/tutorials coded in VB.Net? I'm having a hard time translating C# to VB.Net since I haven't really used C# in any meaningful way... Also, does a MVVM Template/Toolkit for VB.Net exist yet?

    Read the article

  • WPF MVVM Cancel Edit

    - by terkri
    How can I implement cancelation of editing an object using MVVM. For example: I have a list of customers. I choose one customer an click the button "Edit", a dialog window(DataContext is binded to CustomerViewModel) opens and I start editing customer's fields. And then I decide to cancel editing, but the fields of the customer have been already changed, so how can I return a customer to its previous state in MVVM?

    Read the article

  • Silverlight MVVM in VS2008 - a non starter?

    - by bplus
    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 implement? Thanks for any help.

    Read the article

  • wpf mvvm client server application

    - by jim
    First of all i must say i am new to wpf and mvvm. I want to develop a client-server application(clients send info to the server and the serer notifies one or more of them..consider something like yahoo messenger(some user changes his status..sends info to the server and the sever notifies his friends and changes to their UI are made) My question is: does mvvm suits well with this kind of application?

    Read the article

  • wpf mvvm datagrid selectedrow

    - by 2Fast4YouBR
    Hi, after some google around, I just figured out that there is no one that is using 100% MvvM pattern to get the ToolKit DataGrid events ! Is that impossible or what ? I see too much people using the code-behind... How can I get the SelectedRow or dblClick events using mvvm ? cheers

    Read the article

  • Pass or Get a value from Parent ViewModel down to Sub-ViewModel?

    - by mkmurray
    I am using the MVVM Light framework as well as Unity for DI. I have some nested Views, each bound to a corresponding ViewModel. The ViewModels are bound to each View's root control DataContext via the ViewModelLocator idea that Laurent Bugnion has put into MVVM Light. This allows for finding ViewModels via a static resource and for controlling the lifetime of ViewModels via a Dependency Injection framework, in this case Unity. It also allows for Expression Blend to see everything in regard to ViewModels and how to bind them. As I stated the Views have a healthy dose of nesting, but the ViewModels don't really know anything about each other. A parent view binds to its corresponding ViewModel via the static resource ViewModelLocator (which uses Unity to control the construction and lifetime of the ViewModel object). That parent view contains a user control in it that is another sub-view, which then goes and gets its corresponding ViewModel via the ViewModelLocator as well. The ViewModels don't have references to each other or know any hierarchy in regard to each other. So here's an example of how the ViewModels do interact via messaging. I've got a parent View that has a ComboBox databound to an ObservableCollection in its ViewModel. The ComboBox's SelectedItem is also bound (two-way) to a property on the ViewModel. When the selection of the ComboBox changes, this is to trigger updates in other Views and sub-Views. Currently I am accomplishing this via the Messaging system that is found in MVVM Light. So I'm wondering what the best practice would be to get information from one ViewModel to another? In this case, what I need to pass down to sub-ViewModels is basically a user Guid representing the currently logged in user. The top-most parent View (well, ViewModel) will know this information, but I'm not sure how to get it down into the sub-ViewModels. Some possible approaches I can think of: Should the sub-ViewModel ask the static resource ViewModelLocator for a reference to the same object the parent View is using and access the property that way? It seems like ViewModels going through each other's properties is not very clean and couples them together unnecessarily. I'm already using messaging to notify the sub-Views that the user selected a new item in the ComboBox and to update accordingly. But the object type that is being selected in the ComboBox is not really directly related to this data value that the sub-Views need.

    Read the article

  • Diagramming in Silverlight MVVM- connecting shapes

    - by silverfighter
    Hi, have I have a quesition regarding MVVM pattern in the uses case of diagramming. What I have so far is a list of Items which are my Shapes. ObservableCollection<ItemsViewModels> Items; and a Collection of Connection of Items ObservableCollection<ConnectionViewModel> Each ItemViewModel has an ID and a ConnectionViewModel has two ID to connect the Items. My ItemsViewModel Collection is bound to a itemscontrol which is layout on a Canvas. With the ElementMouseDragBehavior I am able to drag my Items around. Now comes my big question =) How can I visualize my connections that I will be able to move the items around and the items stay connected with a line either straign or bezier. I don't know how to abstract that with the mvvm pattern. Thanks for any help...

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >