WPF binding multiple controls to different datacontexts

I would maybe think about wrapping your user object in a seperate class then setting the DataContext properties of sub-panels that contain the data. For example: public class UserDataContext { public UserInfo UserInfo { get; set; } public UserExtendedInfo UserExtendedInfo { get; set; } } Then in your UserControl.xaml: <!– Binding for the UserControl should … Read more

Concrete examples of state sharing between multiple viewmodels (WPF MVVM)

A typical way to achieve this is to use a messenger to publish a CarSelected message that details the selected car. Zero or more ViewModels can subscribe to the CarSelected message. ViewModels that are interested in the currently selected car can listen for the message and then act accordingly. The messenger approach provides a clean … Read more

WPF Databinding thread safety?

Value changes fired by INotifyPropertyChanged are automatically marshalled back onto the dispatcher. (http://blog.lab49.com/archives/1166) Fire this event on any thread you like… Value changes fired by INotifyCollectionChanged are NOT reliably marshalled onto the dispatcher. (http://csharplive.wordpress.com/2008/09/11/wpf-data-binding-observablecollection-cross-thread-binding-support/) If you need to update an observable collection from a different thread, follow the advice in this link

Why am I getting a “Cannot read property ‘nodeType’ of null” error with Knockout JS?

If you set up your code like this, it’ll work. <body> <p>Number1:<input data-bind=”value:n1″></p> <p>Number2:<input data-bind=”value:n2″></p> <p>Number3:<input data-bind=”value:n3″></p> <script src=”https://stackoverflow.com/questions/15090015/knockout.js”></script> <script> function ViewModel() { var self = this; self.n1 = ko.observable(10); self.n2 = ko.observable(10); self.n3 = ko.observable(10); } ko.applyBindings(new ViewModel()); ` </script> </body>

How correctly bind data to radio buttons in Angular2?

This works in my case. I removed [(ngModel)] <div class=”radio”> <label> <input type=”radio” value=”1″ [checked]=”model.ForeignCompany.ProfitCode === 1″ id=”point1″ (change)=”onProfitSelectionChange(1)” name=”ProfitCode”><small>description</small> </label> </div> <div class=”radio”> <label> <input type=”radio” value=”2″ [checked]=”model.ForeignCompany.ProfitCode === 2″ id=”point2″ (change)=”onProfitSelectionChange(2)” name=”ProfitCode”><small>description</small> </label> </div> and TS method looks like: onProfitSelectionChange(entry): void { this.model.ForeignCompany.ProfitCode = entry; }

Databind ASP.NET List of ListItem to DropDownList issue

Hi when databinding (to anything) you need to set the DataTextField and DataValueField of your DropDownList. In your case you should use the following code List<ListItem> users = new List<ListItem>(); foreach (SubscriptionUser su in subscriptionDetails.UserList) { users.Add(new ListItem(su.FirstName + ” ” + su.LastName, su.EmailAddress)); } ddlPrimaryContact.DataTextField = “Text”; ddlPrimaryContact.DataValueField = “Value”; ddlPrimaryContact.DataSource = users; ddlPrimaryContact.DataBind();