MVVM pattern for ASP.NET Webforms ?
Hi, I'm looking for an MVVM implementation for ASP.NET. How should I approach this ? Can you propose any design that solves this problem particularly for ASP.NET Webforms ? Thanks. ...
Hi, I'm looking for an MVVM implementation for ASP.NET. How should I approach this ? Can you propose any design that solves this problem particularly for ASP.NET Webforms ? Thanks. ...
I have a WPF window that has a toolbar. I have a collection of objects in my VM that I'm binding to. They appear as buttons but they always get pushed to the expanded drop down part of the toolbar. How do I make those buttons appear in the standard part of the toolbar? I have the following XAML: <ToolBarTray Grid.Row="1"> <T...
hey folks, I have my NHibernate mappings set to lazy loading = true. In my CustomersViewModel I have something like: foreach (Customer c in _customerRepository) { this.Customers.Add(new SingleCustomerViewModel(c)); } This obviously kills all the lazy loading, since the customers are passed one by o...
Do DependencyPropertys default to two way binding? If not how do you specify? The reason I ask is that I have the following user control which is causing me problems... <UserControl x:Class="SilverlightApplication.UserControls.FormItem_TextBox" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas....
Hi all, I have this issue with ComboBox that uses IEnumerable<Brush> as ItemsSource; the problem lies when I (programmatically) try to set SelectedItem. Here is the code that describes the problem: private readonly List<Brush> colors_; private Brush white_; ViewModelConstructor() { colors_ = (from p in brushes_type.GetProperties()...
I'm working in a WPF project, which basically is a class library project that implements the MVVM pattern. For clarity purposes I'm gonna say that I just have a single window with a single textbox control on it. Now, I'm adding this dll to another project, which is a Windows Forms project, and I'm calling the window with the textbox co...
I went to a .NET user group meeting tonight, and part of it revolved around the model-view-view model pattern, and it got me wondering if this qualified as a pattern. The issue I have is that M-V-VM is extremely technology specific. If you do not use WPF and its binding mechanism, I don't see how you could use that pattern. By contrast, ...
In our application we have many Model objects that have hundreds of properties. For every property on the model: public string SubscriptionKind { get; set; } ...100x... we had to make an INotifyPropertyChanged-enabled property on the ViewModel: #region ViewModelProperty: SubscriptionKind private int _subscriptionKind; public int Sub...
we are designing a xbap application that has complex, user configurable navigation flow that depend on state of the model\user security etc and some other environmental factors. The application is having a container view that loads user specific controls inside a Frame, i am wondering whats the preferred practice for having the navigati...
In my WPF MVVM application my model is a complex tree of Model objects wich constantly changes at runtime. Model instances come and go at runtime, change their position within the tree and of course change their many properties. My View is almost a one-to-one visual representation of that tree. Every Model instance is in 80% of the cases...
I just started learning the MVVM pattern for WPF. I hit a wall: what do you do when you need to show an OpenFileDialog? Here's an example UI I'm trying to use it on: When the browse button is clicked, an OpenFileDialog should be shown. When the user selects a file from the OpenFileDialog, the file path should be displayed in the text...
I think this is the question, anyway. I am using a RelayCommand, which decorates an ICommand with two delegates. One is Predicate for the _canExecute and the other is Action for the _execute method. ---Background motivation -- The motivation has to do with unit testing ViewModels for a WPF presentation. A frequent pattern is that I hav...
I am using WPF and the MVVM pattern in my user interface. In my ViewModel I have a List containing distances in millimetres, which I display in a ListView by binding ListView.ItemsSource to the List. However, I would like the values displayed to use a more natural unit - either metres or feet depending on the state of a "metric" checkbox...
Why we go for MVVM over MVC or MVP while dealing with WPF? What extra benefit we get by using this? Edit: To be honest , today I had an interview and I have been asked this question. I answered like INotifyPropertyChanged , ICommand,IValue Convertor.. but he was not satisfied. Henceforth I have put up this question Thanks in advance...
I am looking for a clean way to start an animation that will have dynamic values. Basically I want to do an animation where an element changes width based on the data of another element. Say I have a TextBlock that's Text Property is Binding. When this property changes I want a visual element say a Rectangle for our sake to do a Doubl...
How would I bind to a collection of shapes? I'd like to build a small application (just for learning purposes) where I utilize MVVM for drawing shapes. The DataContext of the MainWindow is the MainWindowViewModel That MainWindowViewModel has an ObservableCollection of shapes. I have currently only a Canvas on my MainWindow with it...
I am currently working with the Microsoft MVVM template and find the lack of detailed examples frustrating. The included ContactBook example shows very little Command handling and the only other example I've found is from an MSDN Magazine article where the concepts are similar but uses a slightly different approach and still lack in any...
I currently have a main View with a Button and a ContentPresenter which is bound to a property of the ViewModel which is another View (and associated ViewModel). Is there way to route a command from the a handler declared in the control loaded in the ContentPresenter? My reason for this is the main View contains the tool bar and the co...
I can't for the life of me figure out why this doesn't work. I've got a simplified piece of Xaml that looks like this: <UserControl x:Class="Foo.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://sc...
Can someone explain how the mediator pattern works with multiple instances. My code in the view: public MyView() { Mediator.Register("CloseWindow",()=>Close()); } and in the ViewModel: public SomeMethod() { Mediator.Notify("CloseWindow"); } This works find as long as there is only one instance of the View - ViewModel pair....