binding

Binding Enum[] to ListBox

Hello. I have next enumeration Enum rcCategory { Incoming, Internal, Outgoing } and I have property "categories" in my class which has rcCategory[] type. I would like to bind this property to the listBox. I use next code for this MyListBox.SetBinding (ListBox.ItemsSource, new Binding {Source= myClass.categories}); But this ...

jsp TextField binding

I have a panel in my Page1.jsp: <webuijsf:panelLayout binding="#{Page1.dynamicFieldsPanel}" id="dynamicFieldsPanel" -rave-layout: grid"/> Then I have this in Page1.java: private PanelLayout dynamicFieldsPanel = new PanelLayout(); public void setDynamicFieldsPanel(PanelLayout pl) { this.dynamicFieldsPanel = pl; } public Pane...

WPF: Bind DataGrid to List<String>

Funny, how sometimes the simple things bite me in the behind. I can bind a DataGrid nicely to a Collection of some arbitrary class, using a DataGridTextColumn like this: // bound to List<Class> <DataGridTextColumn Header="Name" Binding="{Binding Name}"/> Now I want to bind a DataGrid to a simple Collection of String. So since there i...

Object synchronization with GUI Controls

Hi, Every time when I change some values in form controls, I need to set a property of an object or vice versa. Instead of writing some methods for each control, I want a general solution for GUI elements. I do not use WPF but only C# 3.0. Any suggestions? Thanks. ...

PyArg_ParseTuple plus cast

I have a c function being called from python. Python gives the function an integer, but I would like to use it as another data type in C. I am currently using PyArg_ParseTuple (args, "i", &value) and then manually doing a cast on value. Is there a way to do this cast through PyArg? ...

wpf datagrid current item binding

I want to bind a content of a label to the selected item of a datagrid. I thought the 'current item' binding expression would work, but it is not. My xaml code and code-behind c# is like below. <Window x:Class="WpfApplication2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http:/...

xjc generating Adapter1.java.....

When I run xjc to bind the schema to java, Adapter1.java, Adapter2.java were generated. Is there something I did wrong? What do I do with the generated class Adapter1.java, Adapter2.java? ...

Confusion about WPF binding...

I am trying to bind a 2D array of buttons arranged in stackpanels to a 2D ObservableCollection... Yet, I'm afraid I don't understand something very elementary about binding. My XAML: <Window.Resources> <DataTemplate x:Key="ItemsAsButtons"> <Button Content="{Binding}" Height="100" Width="100"/> </DataTemplate> <...

WPF parent-child window: binding reference problem

I have a WPF Window that open a modal child window to load some data. Both window have a own viewmodel, now I have this problem: after I close the child window it seems still running in background! To close the child window I set DialogResult from viewmodel command; now, if I create a new data and then I edit it from parent window (with...

ActionScript Binding Array Objects?

i would like to update the numbers i've added to an array from variables, when those variables change. is it possible change these variables and have the array update automatically? var first:Number = 1; var second:Number = 2; var myArray:Array = new Array(first, second); first = 3; second = 4; trace(myArray) //outputs 1,2 ...

Show WPF tooltip on disabled item only

Just wondering if it is possible to show a WPF on a disabled item ONLY (and not when the item is enabled). I would like to give the user a tooltip explaining why an item is currently disabled. I have an IValueConverter to invert the boolean IsEnabled property binding. But it doesn't seem to work in this situation. The tooltip is show b...

How to bind a control to a singleton in Cocoa?

I have a singleton in my FTP app designed to store all of the types of servers that the app can handle, such as FTP or Amazon S3. These types are plugins which are located in the app bundle. Their path is located by applicationWillFinishLoading: and sent to the addServerType: method inside the singleton to be loaded and stored in an NSMu...

Binding with custom text in WPF

Can i write something like this in WPF(i know that this piece of code is wrong, but need to know if there is kind of this construct): <TextBlock Height="50" Text="Test: {Binding Path=MODULE_GUID}" /> Or always to add some text to binding value i must do something like this: <StackPanel Orientation="Horizontal"> <TextBlock Heigh...

WPF XAML Bind Grid

I have a custom user control that is based on a Grid control. I have a ViewModel that exposes this as a property. I would like the XAML on the view to bind to this. I am sure this must be easy but I am quite new to WPF. How is this achieved? Many thanks in advance (Edited to add more info) Example of view without binding to ViewModel....

Silverlight 4: Binding to a calculation of control properties

What I would like to do is pretty simple. Given textboxes for ItemPrice, Tax and Total, I need the text value for Total to be bound to ItemPrice + Tax and the Tax value to display ItemPrice * taxRate. Could someone offer a brief explanation as to how this would be accomplished or point me to an appropriate example? I see property bindin...

XAML - Binding Command to ItemsControl Contents

I have a UserControl with a ICommand-derived object as a Resource as follows: <commands:SetRegionContentCommand x:Key="SetContentComand"/> I then try to bind the command to the DataTemplate tag within an ItemsControl like so: <ItemsControl ItemsSource="{Binding Path=Items}"> <ItemsControl.ItemTemplate> ...

How to Bind Two Lists to Two Columns of Wpf DataGrid?

I want to bind two lists to two columns of a Wpf DataGrid. How is this done in Xaml? Class MainWindow Public Property Column1 As List(Of Integer) = New List(Of Integer) From {1, 2, 3} Public Property Column2 As List(Of Integer) = New List(Of Integer) From {4, 5, 6} End Class ...

Simple Binding question, unable to bind to button command in a DataTemplate using MVVM Light Toolkit

I've been attempting to bind to buttons within a DataTemplate without much success. The button does not fire. Button Click works successfully outside of the DataTemplate. Yet if I create a Click="button_click" the click button is fired. The Button Content binds perfectly as well. Example to illustrate.. ...

Binding Data Template element to property on sub-class

Hi guys, I have a class, for experiment sake call it foo() and another class, call it bar() I have a data template for class foo() defined in my xaml, but one of foo()'s properties is a bar() object such that foo() { Public string Name {get; set;} Public int ID {get; set;} Public bar barProp {get; set;} } and bar() ...

Bind to Count of items in the DataContext

I want to bind to the Count/amount of items within my DataContext. I have an object, lets say person which has a List<address> as a property. I would like to display the amount of addresses for that person ie: 5 or 6 or whatever the case may be. I've tried {Binding Path=address#.Count} and a few others but that doesnt seem to work. A...