I can use data binding to set the initial Content of a WPF Frame, but subsequent changes to the the bound property (implemented using INotifyPropertyChange) do not seem to change the content.
Also, does anyone know if binding directly to the Content property in this way will cause the bound item to appear in the Frame or NavigationWindo...
Hello,
this I got: A first chance exception of type 'System.NullReferenceException' occurred in PresentationFramework.dll
When I use a parameter for the constructor of my LessonPlannerViewModel class.
I use a datatemplateselector class to switch between weekly/daily view.
public class ApplicationNavigationTemplateSelector : DataTempl...
In my application I have this code in my view model:
hiddenTextContainer.PreHideVerticalOffset = VerticalOffset;
hiddenTextContainer.HiddenText = Text.Remove(SelectionStart, SelectionLength);
hiddenTextContainer.HasHiddenText = true;
hiddenTextContainer.NonHiddenTextStart = SelectionStart;
...
Hi,
I'm trying to write a master - detail control that consists of a master datagrid and the detail datagrid. My scenario was following - I used the SelectedItem and bound it to a property in ModelView. The problem is - the SelectedItem in ViewModel is never used, so I can't get the information which item is selected in a master datagrid...
I have a settings window and am trying to set it up so that there is a live preview what the main window will look like with the current settings.
Here is a picture of what the settings dialog looks like at the moment. The big black rectangle will be the preview.
...
I am building a settings dialog for my application and right now all of the settings correspond with settings on the main view-model, but as I add more view's and view-models some may not.
I need to know what the best practice is for loading the current settings into the settings dialog and then saving the settings to thier correspondi...
Form Build your own MVVM I have the following code that lets us have typesafe NotifyOfPropertyChange calls:
public void NotifyOfPropertyChange<TProperty>(Expression<Func<TProperty>> property)
{
var lambda = (LambdaExpression)property;
MemberExpression memberExpression;
if (lambda.Body is UnaryExpression)
{
var un...
I am re-factoring my application to implement the MVVM design and i came across my first problem...
Compiler won't let me bind to the Password property of the PasswordBox control.
Anyone have any ideas / suggestions.
...
What is the best way of binding a number of RadioButtons to an enum using MVVM?
The only way I can think of is binding each group box's IsChecked to a property, and in the setter of that property assign a value to an enum in the view model.
Any help is appreciated.
...
I'm new to Silverlight, so I don't have a complete grasp of all the controls at my disposal. What I would like to do is use databinding and a view model to maintain a collection of items. Here is some mock code for what I'd like to do:
Model
public class MyItem
{
public string DisplayText { get; set; }
public bool...
Hello, I am a seasoned C and Java programmer, but an absolute WPF newbie.
I am creating a kiosk application that will display a list of images of products that the user will click to see product details and maybe place an order.
I am trying to structure my app with MVVM Foundation because I am used to the benefits of structure and test...
I'm currently working on what will be my first real foray into using MVVM and have been reading various articles on how best to implement it.
My current thoughts are to use my data models effectively as data transfer objects, make them serializable and have them exist on both the client and server sides.
It seems like a logical step giv...
I want to make a user control that shows an image and can invoke a command when clicked.
Later I want to bind a list of these controls to a list of products.
...
Since this is so long and prolapsed and really doesnt ask a coherent question:
1: what is the proper way to implement subproperties of a primary object in a viewmodel?
2: Has anyone found a way to fix the delegatecommand.RaiseCanExecuteChanged issue? or do I need to fix it myself until MS does?
For the rest of the story...continue on....
I am trying to detect when an item is checked, and which item is checked in a ListBox using Silverlight 4 and the Prism framework. I found this example on creating behaviors, and tried to follow it but nothing is happening in the debugger. I have three questions:
Why isn't my command executing?
How do I determine which item was check...
Hi Guys,
Ok here is the deal (a bit wordy but I hope you will get the idea)
I use MVVM for binding properties of a combo. The combobox is bound to a ListCollectionView with source collection of employee objects which is sorted by the emp. name . There is binding on SelectedValue of the combobox by the
employee id. DisplayMember is em...
[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...
Hello,
Sorry for the earlier lengthy post. Here is my concise (!) description.
I bind a collection view to a combobox as a itemsSource and also bind its selectedvalue with a property from my view model. I must keep IsSynchronizedWithCurrentItem="False".
I change the source list ofr the view and then refresh the view. The changed (adde...
Hello,
I have a list of CustomerViewModels in a ComboBox. The selected CustomerViewModel I want to delete and also the Customer wrapped inside it to remove it from the repository.
But how can I access the Customer model inside the CustomerViewModel?
...
I'm trying to clean up some of my xaml in my views by moving a lot of the DataGrid styles into a ResourceDictionary. One of the things I'd like to move is the ContextMenu that is bound to some commands in the ViewModel. However, when I move the context menu to the ResourceDictionary, the commands are are never firing anymore, and I can...