I'm currently using Silverlight 4 and following the MVVM pattern. I have login boxes bound to my ViewModel like so:
<PasswordBox Password="{Binding Path=Password, Mode=TwoWay}" />
I then later on have a button bound to a Command which listens to the ViewModel's PropertyChanged event and when one of the databindings has its data update...
This seems like it would be an easy solution, but I'm wasting too much time trying to figure this out. Perhaps I am designing my application incorrectly (which might be the case), so please help me out if you have a better solution.
I'm designing an enterprise level WPF application that looks a lot like Outlook with a Ribbon instead of...
Our offsite development team created a Model with an ObservableCollection property. Now, I'm in charge of creating the ViewModel, and I'm having trouble because the said Model runs inside a BackgroundWorker (another thread)- which means I can't update the View by hooking the CollectionChanged events. Here's the workaround that I did:
pr...
Is there any WPF control (commercial or not) that integrates well with the MVVM pattern ?
Ideally the report would be another View for the ViewModel.
...
In MVVM it is normal to connect View to the ViewModel with data binding.
Therefore if the name of a properties changes on one of the Model objects that is databound to there is no compiler error.
When the compiler will not stop a bug, the next thing I think of is “UnitTest”, However
How do you unit test this without
spending for...
I'm trying to figure out a way to bind my checkbox IsChecked property. Basically, I have a list of items which the ListBox is bound to. When a user checks the box, a command is invoked and that item is added to a collection.
However, what if I want to programmatically select items in the list? I would like the IsChecked item to be ba...
I have a Shell application which loads different modules to it one at a time through a tab control attached Shell. I need only one instance of each module should be available in shell. So anyone can u help me how to activate and deactivate the views of each modules when user switches between tabs. Thanks in Advance.
...
I've just been reading Josh Smith's MVVM article and am working on a WPF application at the moment. I'm umming and ahing about transfering my work so far to MVVM but find the idea of working purely through databinding and ICommands without any UI event handlers, a little daunting in the sense that it could take a while to convert what I...
Ok, I'm pulling my hair out over this, so any help will be hugely appreciated!
I'm building a WPF application using the MVVM pattern.
In an attempt to get data in at design time I am using the Ninject dependency injection framework in conjunction with a service locator (much like the example in an article at http://jonas.follesoe.no/Yo...
I am working on a WPF application, using the MVVM Pattern.
Each ViewModel will need access to a security object, that essentially provides information about the rights the user has. Because this object only needs to be populated once at start up, and because populating it is (at least potentially) expensive, I want to keep it in state ...
I'm working on an MVVM app and have a view that is used to modify a number of network parameters (IP, SubnetMask, etc).
The view contains a number of text boxes bound to properties in a 'NetworkConfigViewModel':
<TextBox>
<TextBox.Text>
<Binding Path="IP" UpdateSourceTrigger="PropertyChanged"/>
</TextBox.Text>
</TextBox...
I have got a big ListBox with vertical scrolling enabled, my MVVM has New and Edit ICommands.
I am adding new item to the end of the collection but I want the scrollbar also to auto position to the End when I call my MVVM-AddCommand.
I am also making an item editable(By calling EditCommand with a particular row item) from some other part...
When using the MVVM pattern to structure your WPF application you should get all your business logic out of the View and code-behind files. Doing it properly the View itself will be a simple facade with Data Bindings and Command Bindings to the ViewModel classes - which is where the magic happens.
One key benefit from structuring your a...
In theory this code should provide me with a 300x300 window with a blue background from having the window's content bound to an object of type AstRootViewModel, however this doesn't seem to be the case. I'm wondering it this is happening because I don't call astApplication.Run() until after I set the mainWindow.ViewModel property. Usin...
So this is pretty mystifying. I have a databound ListBox (or ListView, it happens with both), and if it has more than 2 items in it, selection works - I get a blue highlight bar and the item looks selected. If I only have 1 item, the selection does not work - I do not get a blue highlight bar, but the selection events all fire as normal....
I'm trying to use the MVVM pattern in my Silverlight 3 application and am having problems getting binding to a command property of a view model working. First off, I'm trying to add an attached property called ClickCommand, like this:
public static class Command
{
public static readonly DependencyProperty ClickCommandProperty =
...
I'm using MVVM to bind views to objects in a Tree. I have a base class that implements the items in my tree, and that base class has a ContextMenu property:
public IEnumerable<IMenuItem> ContextMenu
{
get
{
return m_ContextMenu;
}
protected set
{
if (m_ContextMenu ...
I have a ViewModel (AbstractContextMenu) that represents my context menu (IContextMenu), and I bind a real ContextMenu to it with a DataTemplate:
<DataTemplate DataType="{x:Type local:AbstractContextMenu}">
<ContextMenu x:Name="contextMenu"
ItemsSource="{Binding Path=(local:IContextMenu.Items)}"
IsEnabled="{Bind...
Working with WPF it is good practice to keep your xaml.cs code behind files small and clean. The MVVM pattern helps achieving this goal through Data Bindings and Command Bindings where any business logic is handled in the ViewModel classes.
I am using the principles of the MVVM pattern and my code-behind files are rather nice and clean...