binding

Downgrade (use a lower-versioned library) with a binding redirect

北战南征 提交于 2020-01-02 05:01:09
问题 I'm using an older version of NHibernate (v3.0.0.1001) and I'm stuck to it because the new LINQ provider breaks quite a few of my queries (something I'll be trying to fix later). I want to update a library that uses NHibernate v3.1.0.4000. I've tried adding a binding redirect in the App.config: <?xml version="1.0"?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4"

knockout.js recursive binding

…衆ロ難τιáo~ 提交于 2020-01-02 04:51:26
问题 I'm trying to do some complex binding with knockout (at least for a newbie like me). Consider the following data: var originalData = { id: 1, name: "Main", children: [ { id: 2, name: "bob", children: []}, { id: 3, name: "ted", children: [{id: 5, name:"albert"}, {id: 9, name: "fred"}]} ], selectedChild: { id: 2, name: "bob" } }; <table> <tr> <td data-bind="text: name"></td> </tr> <tr data-bind="if: children().length > 0"> <td> <select data-bind="options: children, optionsText: function(item){

Q_PROPERTY NOTIFY signal and its argument

99封情书 提交于 2020-01-02 04:44:06
问题 I have the habit of writing my "propertyChanged" signal s with an argument, such that the receiving end doesn't need to call the Q_PROPERTY 's READ function explicitly. I do this out of clarity and the assumption that in a QML data binding situation, no "expensive" call to the getter needs to be done to actually fetch the value, as it's already passed to QML as a signal argument. My colleagues disagreed and said it was against "QML style", to which I responded the documentation clearly states

WPF Toolkit Charting and IndependentValueBinding, IndependentValuePath

点点圈 提交于 2020-01-02 00:14:11
问题 I'm facing a problem with the charting engine from the WPF toolkit. I haven't moved the data to a proper object model, so the ItemSource is backed with a DataView . First attempt <chartingToolkit:ScatterSeries x:Name="TargetSeries" DataPointStyle="{StaticResource TargetStyle}" ItemsSource="{Binding Path=TargetSeriesData}" IndependentValueBinding="{Binding Path=TargetSeries_X}" DependentValueBinding="{Binding Path=TargetSeries_X}" /> This crashes because I believe the bindings are considered

WPF Cloned/Detached object edit problem - what is the standard?

痴心易碎 提交于 2020-01-01 19:47:07
问题 I am using an ObservableCollection to wrap some of my generated entity framework objects. When the user wants to edit some values , i am opening a popup windows that contains fields, and when the user changes and press save - the changes are saved to the database, and the binded controls are changes as it is an observablecollection. To prevent the user from working on the same binded object (it causes the visual change of every binded control on the same time) i want to use some functionality

Binding issue ActualWidth on dynamic filled Grid

喜欢而已 提交于 2020-01-01 18:59:10
问题 Consider the following, simple code: XAML: <Grid Height="60" Name="grid"> <Grid.ColumnDefinitions> <ColumnDefinition Width="162*" /> <ColumnDefinition x:Name="coltest" Width="316*" /> <ColumnDefinition Width="239*" /> </Grid.ColumnDefinitions> </Grid> <Label MouseDoubleClick="TextBox_MouseDoubleClick" Content="{Binding ElementName=coltest, Path=ActualWidth}" Grid.Row="1"/> The MouseDoubleClick event: private void TextBox_MouseDoubleClick(object sender, MouseButtonEventArgs e) { grid

wpf binding combobox to enum in different namespace

三世轮回 提交于 2020-01-01 15:06:23
问题 I'm trying to bind a XAML ComboBox so that its list items are the members of the System.IO.Ports.Parity enum. I've found plenty of examples of databinding enums, but it seems these don't work if the enum is in a different namespace (like System.IO.Ports). Right now I have: <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="parityValues"> <ObjectDataProvider.MethodParameters> <x:Type TypeName="System.IO.Ports.Parity" /> </ObjectDataProvider.MethodParameters> <

guice: runtime injection/binding at command line

人走茶凉 提交于 2020-01-01 15:05:43
问题 I have the following problem: @Inject MyClass(Service service) { this.service = service; } public void doSomething() { service.invokeSelf(); } I have one module bind(service).annotatedWith(Names.named("serviceA").to(ServiceAImpl.class); bind(service).annotatedWith(Names.named("serviceB").to(ServiceBImpl.class); Now my problem is I want to allow user to dynamically choose the injection on runtime base through command line parameter. public static void Main(String args[]) { String option = args

How do I bind to a ListBox in IronPython?

别等时光非礼了梦想. 提交于 2020-01-01 14:37:37
问题 I am just starting out using IronPython with WPF and I don't quiet understand how binding is supposed to be done. Normally in WPF I would just do something like this: <ListBox Name="MyListBox"> <ListBox.Resources> <Style TargetType="ListBoxItem"> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> <DockPanel> <TextBlock Text="{Binding Path=From}" /> <TextBlock Text="{Binding Path=Subject}" /> </DockPanel> </DataTemplate> </Setter.Value> </Setter> </Style> </ListBox.Resources> <

Javascript nested function losing scope

好久不见. 提交于 2020-01-01 12:11:12
问题 Can someone explains the scope binding of the following code please window.name = "window"; object = { name: "object", method: function() { nestedMethod: function() { console.log(this.name); } nestedMethod(); } } object.method(); // print 'window' I think my question is more about this ...why is this losing the scope and default to the global scope ? do all the anonymous functions that we created will go on the global scope ? 回答1: Whenever you call a function, simply by writing func() , this