Hi,
I am using mvvm architecture view first approach in my project. I mean I have view-viewmodel binding defined in resource file.
But i'm unable to open multiple instances of same view...If I open the the new viewmodel will refer to the first view.
...
this is in regards to the tutorial on msdn. This is whats used to close workspaces or tabs.
// workspaces declared as follows
_workspaces = new ObservableCollection<WorkspaceViewModel>();
_workspaces.CollectionChanged += this.OnWorkspacesChanged;
void OnWorkspacesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.N...
I have a Silverlight testing project using the Silverlight Unit Test Framework.
I want to test a method in my view model which takes FileInfo objects. This seems to work fine when I test it manually through the UI.
Now I want a unit test just for the AddDocument method. I don't want to test actually clicking the button or simulate cl...
hi, i lately had the problem of creating add and edit dialogs for my wpf app.
all i want to do in my code was something like this. (I mostly use viewmodel first approach with mvvm)
ViewModel which calls a dialog window:
var result = this.uiDialogService.ShowDialog("Dialogwindow title goes here", dialogwindowVM);
... do anything with...
Two questions here.
My view has a "close" button that when clicked, the window should close. I handled this as follows: The button in my view binds to a command defined in the view's view model, which when triggered runs the following:
private void Exit()
{
var regionManager = Container.Resolve<IRegionManager>();
M...
I have a data grid in a view that is bound to a List in a viewmodel. I have a lot of data to retrieve for the list, so I want to break it up into many small retrievals instead of one big one.
I want this to happen on a background thread with the UI updating (the grid binding the new data) at the end of each batch retrieved.
At the end...
I am looking for a good tutorial / explanation that shows where and how to implement settings in a MVVM WPF application. I understand .net has built-in support for settings but is this typically used for medium to larger size applications? What are the alternatives?
I am thinking of storing many user settings such as window size, grid...
Hi!
I have two questions regarding communication between ViewModels.
I am developing a customer management program. I'm using Laurent Bugnion's MVVM Light framework.
In the main page, there's a list of customers. when each customer is clicked, a child windows shows up with information about that customer. the user should be able to o...
I have a UserControl which contains 4 ToggleButtons and I'd like to trigger a custom event that an interested object can listen for which provides a status, based on the ToggleButton Checked values and also value(s) from the DataContext object.
Getting the ToggleButton checked values and deriving a status is simple enough, however I can...
I am thinking about how an application can be written to work on both Windows 7 Phone and IPhone, one option is to use MonoTouch and structure the app with MVVM, then only the views will need to be different between the platforms.
However MonoTouch does not seem to support data binding.
When (if) data binding support is added to Mon...
I have a ObservableCollection<Class1> where Class1 contains x and y positions as properties. The list can be of any size. I have a ViewModel that exposes the collection as a property. In my view, I want to generate a list of elements based on the collection and then set their x and y positions based on the Class1 Object's properties.
Ho...
Hi everyone,
Whilst implementing my first MVVM application in WPF, I've been wondering about the pros and cons of wrapping Model collections in related ViewModel collections to use in the View.
In our system we are likely to have several potentially large collections e.g. Order Lines in an Order, and Stock Items which could be selected...
I'm trying to make and use templated controls in an application but I seem to run into timing isssues. When I use a custom templated control, in XAML <local:MyControl> and through code (new MyControl()), and call a method on the control that tries to do something with a control in the Controltemplate, a control in the template is almost ...
Hello Together,
there a little BrainF*** question for me to understand MVVM in relation to LinqToSQL.
The MVVM is build like:
View --> Viewmodel --> Model
View: the xaml and the cs code behind file. right ?
Viewmodel: created by the Developer (*.cs), encapsulated properties of my Model
Model: Datamodel
So here is the Question:
...
Hi,
I am having a problem with a wpf treeview that uses a HierarchicalDataTemplate in conjunction with a VirtualizingStackPanel. Using the code provided below, I run the application and expand all the treeviewitems.
http://img227.imageshack.us/img227/3536/wpftv03.png
I then make the viewport "small" so that items are virtualized. ...
I have a collection that holds multiple types of items that all inherit from the same interface. This is bound to an ItemsControl. The DataContext of the window is set to the ViewModel that holds the collection.
What I would like to do is have each item of a different type in the collection use a different ViewModel.
So if my template...
I have a ViewModel
class FontsViewModel : ObservableObject
{
public FontsViewModel()
{
InitFonts();
}
public ObservableCollection<Typeface> Fonts
{
get;
private set;
}
protected void InitFonts()
{
Fonts = (ObservableCollection<Typeface>)System.Windows.Media.Fonts.SystemFo...
Is it possible to pass a parameter to the ViewModel constructor? I would then use this parameter to initialise a property and/or do other operations in the ViewModel.
With WinForms I could do
public MyForm(MyParamType myParam) {
MyFormProperty = myParam;
//etc.
}
How do I go about doing something similar in the MVVM pattern ...
Hi, I am searching for a design pattern, open source platform or what can else use to develop widget for wpf applications. I need to develop a host application that could load predefined or custom widget and this widget could interact with host application or could communicate with other widgets. User could add new widget without quiting...
Hi.
I want to implement a panel to set user permissions. So i have a PermissionListView where the ItemSource is an ObservableCollection and in this PermissionListView I have a Checkbox for each Item which is bound to PermissionViewModel.Checked. I debugged it and this works.
The user gets selected in another ListView(UserListView). But ...