binding

CheckboxFor not binding with nested objects

北慕城南 提交于 2019-12-23 12:38:06
问题 CheckBoxFor is not bounded when a property is defined in an object nested in the model? Here is an example. I have a SearchOptions model that contains a List<Star> property. Each Star has a number, a name and a bool property that should be bounded: public class SearchOptions { public SearchOptions() { // Default values Stars = new List<Star>() { new Star() {Number=1, Name=Resources.Home.Index.Star1, IsSelected=false}, new Star() {Number=2, Name=Resources.Home.Index.Star2, IsSelected=false},

Most efficient Aurelia binding way for a singleton object

拟墨画扇 提交于 2019-12-23 12:13:38
问题 Here's a pretty fundamental JavaScript and Aurelia question. Let's say that I have a singleton object, for example User and it would often get updates from the server, which returns a whole new User object. Now, to push the update to the views, I have two options (that I know of): Update every property of the existing User to that of the new User 's manually (this would also require mapping every property). Replace the object reference and push an EventAggregator notification for all

WPF Binding IsSelected to ViewModel doesn't set items that haven't been shown in the List

隐身守侯 提交于 2019-12-23 10:21:02
问题 I have a ViewModel that has an IsSelected property which I bind in my ListView.ItemContainerStyle XAML to an IsSelected property in my view model. I bring up the application and populate the view model collection (which is shown in my ListView ) with a lot of items, say about 2000. Then I select everything in the list via Ctrl-A . The items in my view model collection only get the IsSelected set for the items that are visible in the ListView . If I page down through the list the IsSelected

PHP ↔ Perl interface or bindings

こ雲淡風輕ζ 提交于 2019-12-23 10:17:24
问题 What PHP ↔ Perl interface or bindings do you recommend? I need to be able to run Perl functions located in a Perl file from a PHP script and get the return values. I've already found the PECL "perl" package but I'm not sure how reliable it is since the last Subversion activity was ~12 months ago. I've also found the Perl module PHP::Interpreter that is supposed to work both ways according to an almost 3 year old tutorial, Integrating PHP and Perl . I would really appreciate it if you can

DataGridColumn SortMemberPath on MultiBinding

纵饮孤独 提交于 2019-12-23 09:27:20
问题 I'm trying to have column sort on numeric content. Multi-binding converter works fine. This solution will set SortMemberPath to null I've tried a variety of ways, and scoured the internet substantially. Code has been modified from original for security purposes. <DataGridTemplateColumn x:Name="avgPriceColumn"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock> <TextBlock.Text> <MultiBinding Converter="{StaticResource avgPriceConverter}"> <Binding Path="NumberToDivideBy" />

MarkupExtension with binding parameters

时光总嘲笑我的痴心妄想 提交于 2019-12-23 08:47:18
问题 I am working on a Custom MarkupExtension in wich I need a non string parameters from XAML to construct the new object. Is it possible to use a non-string parameter binding on a field in datacontext scope? In other words, how can I do something like this? <ListBox ItemsSource="{Binding Source={local:MyMarkupExtension {x:Type Button},IncludeMethods={Binding Source=CustomerObject.IsProblematic}}}" /> where IncludeMethods=CustomerObject.IsProblematic give me this error:Binding cannot be set on

WPF Binding default mode

无人久伴 提交于 2019-12-23 08:43:07
问题 in one of my apps I have a code like this: <ProgressBar Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" Height="27" Margin="5,0,5,0" Maximum="{Binding TabuProgressEnd}" Value="{Binding TabuProgress}" /> While I was testing this everything is ok, but when my client opened this under VS and run this code threw an exception: An unhandled exception of type 'System.InvalidOperationException' occurred in PresentationFramework.dll Additional information: A TwoWay or OneWayToSource binding

Jquery: Binding change to multiple checkboxes

吃可爱长大的小学妹 提交于 2019-12-23 07:37:08
问题 For a little bit of background, I have multiple checkboxes, each weighted with a different "score". When the checkbox is changed, I need to compute the score. I thought something like the following would work but it does not look like the .change event is being bound properly. $(document).ready(function() { bindSomeCheckboxes(); }); function bindSomeCheckboxes() { var score=0; var checkboxes = { "id_1" : 3, "id_2" : 1, "id_3" : 2, "id_4" : 5 }; $.each(checkboxes, function(key, value) { $("#"

Silverlight 4 RelativeSource FindAncestor binding [closed]

拥有回忆 提交于 2019-12-23 07:19:04
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . Will there be RelativeSource FindAncestor, AncestorType... in Silverlight 4? 回答1: In Silverlight 4 the RelativeSource property of Binding still only supports "Self" and "TemplatedParent", there is no change from

Angular 2: how to create radio buttons from enum and add two-way binding?

流过昼夜 提交于 2019-12-23 07:07:41
问题 I'm trying to use Angular2 syntax to create radio buttons from an enum definition, and bind the value to a property that has the type of that enum. My html contains: <div class="from_elem"> <label>Motif</label><br> <div *ngFor="let choice of motifChoices"> <input type="radio" name="motif" [(ngModel)]="choice.value"/>{{choice.motif}}<br> </div> </div> In my @Component, I declared the set of choices and values: private motifChoices: any[] = []; And in the constructor of my @Component, I filled