Binding a WPF ComboBox to a custom list

I have a ComboBox that doesn’t seem to update the SelectedItem/SelectedValue. The ComboBox ItemsSource is bound to a property on a ViewModel class that lists a bunch of RAS phonebook entries as a CollectionView. Then I’ve bound (at separate times) both the SelectedItem or SelectedValue to another property of the ViewModel. I have added a … Read more

AngularJS – Binding radio buttons to models with boolean values

I am having a problem binding radio buttons to an object whose properties have boolean values. I am trying to display exam questions retrieved from a $resource. HTML: <label data-ng-repeat=”choice in question.choices”> <input type=”radio” name=”response” data-ng-model=”choice.isUserAnswer” value=”true” /> {{choice.text}} </label> JS: $scope.question = { questionText: “This is a test question.”, choices: [{ id: 1, text: … Read more

WPF Databinding: How do I access the “parent” data context?

I have a list (see below) contained in a window. The window’s DataContext has two properties, Items and AllowItemCommand. How do I get the binding for the Hyperlink‘s Command property needs to resolve against the window’s DataContext? <ListView ItemsSource=”{Binding Items}”> <ListView.View> <GridView> <GridViewColumn Header=”Action”> <GridViewColumn.CellTemplate> <DataTemplate> <StackPanel> <TextBlock> <!– this binding is not working –> … Read more

How to bind multiple values to a single WPF TextBlock?

I’m currently using the TextBlock below to bind the value of a property named Name: <TextBlock Text=”{Binding Name}” /> Now, I want to bind another property named ID to the same TextBlock. Is it possible to bind two or more values to the same TextBlock? Can it be done with simple concatenation, like Name + … Read more

Angular 2 Checkbox Two Way Data Binding

I´m fairly new to Angular2 and I have a little problem: In my Login-Component-HTML, I have two checkboxes, which I want to bind in two way data-binding to the Login-Component-TypeScript. This is the HTML: <div class=”checkbox”> <label> <input #saveUsername [(ngModel)]=”saveUsername.selected” type=”checkbox” data-toggle=”toggle”>Save username </label> </div> And this is the Component.ts: import { Component, OnInit } … Read more

Ng-model does not update controller value

Probably silly question, but I have my html form with simple input and button: <input type=”text” ng-model=”searchText” /> <button ng-click=”check()”>Check!</button> {{ searchText }} Then in the controller (template and controller are called from routeProvider): $scope.check = function () { console.log($scope.searchText); } Why do I see the view updated correctly but undefined in the console when … Read more