mvvm

How do you ignore/persist values in MVC when your view-model doesn't have as many fields as your domain model?

I have a site where I'm using fluentNhibernate and Asp.net MVC. I have an Edit view that allows user to edit 8 of the 10 properties for that record (object). When you submit the form and the Model binds, the two un-editable fields come back in the view-model as Empty strings or as default DateTime values depending on the type of proper...

Is MVVM an alternative to Expression Blend?

I'm sure this is a Noob question, but I've never worked with WPF before. Is MVVM an alternative to Expression Blend? ...

Window.FindName can't find Border element that I've named through an attached property

Hi, I've got a xaml of a window with an unnamed border control somewhere inside. The border control uses an attached property that I wrote and the attached property basically sets the border control's Name property to a known value, like "placeholder". After the window is loaded, it tries to find that border control through the name tha...

WPF animation to expand-contract height

Hey I would like to have a trigger on an image which expands AND contracts an ItemsSource by animating its height property. I have a generic ItemsSource bound to a ObservableCollection, so I do not know the total height of this control. Once the image is clicked, it should change its image source glyph to show that the itemssource is ...

MVVM and ModelBinders in the ASP.NET MVC Framework

Hi, I've got a series of views, each are typed to have their own ViewModel class which contains everything they need to display themselves, for example: public class CreateResourceViewModel { public Project Parent { get; set; } public SelectList Categories { get; set; } public Resource Resource { get; set; } } The post...

What MVVM framework are you using?

I am looking to write a WPF app and am trying to pick a MVVM framework to handle some of the complexity. What would you recommend and where can I find a good tutorial/getting started guide for said framework? ...

How can I sort a ListBox using pure xaml and no code behind?

I need to sort the strings in a ListBox, but it is bound to the view model by another component via the DataContext. So I can't directly instantiate the view model in xaml, as in this example, which uses the ObjectDataProvider: http://www.galasoft.ch/mydotnet/articles/article-2007081301.aspx in my xaml: <ListBox ItemsSource="{Binding ...

What are some fast and simple implementations for a segmented progress bar in WPF?

More specifically, I tried having a grid of 48 rows, 40 units high, contained in a scroll viewer... each row was to contain a progress bar, but for whatever reason, this really REALLY slowed down my user interface, so I've scrapped it. My questions are as follows: Why would the progress bar cause such extreme slowdown, especially while ...

A Silverlight application with .net Ria services and SilverlightFX

Hi, I am starting to write an application in Silverlight with RIA services and SilverlightFx. Now this application is a pretty big one has has lot of interaction between controls. As an estimate it will have around 60-70 user controls. Now my questions are.. Is it good to choose .Net Ria and SilverlightFx? (My view is..It is not goin...

What is the proper MVVM way to place a collection of symbols on a map?

I have a WPF Window with a Canvas that is used to show a terrain map. I would like to place symbols on this map according to an IEnumerable<MapSymbolDefinition> where MapSymbolDefinition is defined as follows: public class MapSymbolDefinition { string SymbolFileName { get; set; } int XLocation { get; set; } int YLocation { get; se...

Can MVVM gives any advantage if databinding is not used between view and viewmodel?

In MVVM, The ViewModel is a model for the view. And the real power comes in when we bind ViewModel to View in WPF. However, if third party control does not support data-binding (not supporting all functionality), in that case is it worthwhile to use MVVM? ...

MVVM pattern and semi-global data

I have developed some MVVM based WPF code and am in need of some minor refactoring but prior to doing that I need to decide the best architecture. I originally started with an application that could present several similar (but separate) representations of my data. Let's call it RecordsViewModel which had a corresponding RecordsView. ...

How can I display a different ToolTip based on the DataContext DataType in Wpf?

I have an abstract UserControl that I want to show a ToolTip on. This ToolTip should be different based on the Type of the DataContext which is defined in the derived UserControls. Is there a way to define a different ToolTip for each type in the base class? If not, how can I set this ToolTip in the derived UserControl? Here is how I ...

Josh Smith's CommandViewModel in MVVM, what's the point?

I was looking through Josh Smith's MVVM Example and I noticed he defines a basic view model called CommandViewModel, and looking through his demo app, I just can't see the point of it. ...

WPF Custom Control Property not receiving data binding

WPF XAML, I have a custom control I have written that wraps lookups. In typical government fashion, they have a lookup table for all possible lookups. My custom control will throw a popup overlay asking them to select from the items in the list. My problems relate specifically to databinding from my calling form to my control property to...

Tricky WPF styling issue - can you do it?

Hey guys I have an observable collection of items, where each item has a name and a "group name" (both strings). The tricky part is, in XAML, I need to style this collection such that all items with the same group name are listed next to each other, and the group name is shown at the top. I have designed user controls for the layout o...

How to bind a command in WPF to a double click event handler of a control?

I need to bind the double click event of a textblock (or potentially an image as well - either way, its a user control), to a command in my ViewModel. TextBlock.InputBindings does not seem to bind correctly to my commands, any help? ...

Bind TextBox to large string in WPF using MVVM

I am having a performance problem binding a large string to a a TextBox in WPF. In the view I am binding a TextBox's Text property to the view model's Output property which is a StringBuilder. View: <TextBox Text="{Binding Output, Mode=OneWay}" IsReadOnly="True"/> ViewModel: public StringBuilder Output { get { retur...

Proper way in WPF MVVM to start a threaded lookup task

So I've got a task that can be preformed by my GUI that will pull information to populate a ViewModel with SQL database query response. Assume I want to start this task and keep my gui free to proceed with other things, and in the meantime play a "searching" animation, what is the proper way to do this in WPF/MVVM? I'm assuming you nee...

Sync SelectedItems in a muliselect listbox with a collection in ViewModel

I have a multi-select listbox in a SL3 app using prism and I need a collection in my viewmodel that contains the currently selected items in the listbox. The viewmodel doesn't know anything about the view so it does not have access to the listbox control. Also I need to be able to clear the selected items in the listbox from the viewmod...