binding

Java Data binding best practices

Even if I'm not new to Java, I've only used it in school/university environment so I don't know all the best practices used in the enterprise. In particular I'm now developing a Java desktop application (using Swing at the UI Layer) and I'm particularly interested in best practices about data binding with swing components. For example ...

WPF Custom Control - How do you bind a listbox from a static ObservableCollection?

I'm not sure how to go about this exactly. I have a static ObservableCollection in the NameField.cs class. I just have no idea how to bind it to the listbox. Should I not be using a ListBox? Should I be using a DependencyProperty? Should I be exposing the ObservableCollection through a property or by public? I'm not sure what to do h...

WPF MultiBinding - UnsetValue Issue

I have a TextBlock. When its Text is bound as: <Binding Path="Applicant2.Surname"/> It works fine, however I want to include the Forenames so changed the binding to: <MultiBinding StringFormat="{}{0} {1}"> <Binding Path="Applicant2.Forenames"/> <Binding Path="Applicant2.Surname"/> </MultiBinding> This displays {DependencyPr...

Howto WPF Binding written inline = short form

I have about 100 TextBoxes in a Form. I need to validate them if they are decimal for instance. This works, but it is too verbose, I don't want to have 800 in place of 100 rows in XAML. <TextBox.Text> <Binding Path="MyPath" UpdateSourceTrigger="PropertyChanged" Stringformat="{}{0:N}" NotifyOnValidationError="True"> <Binding....

In WPF how to change a DataTemplate's Textblock's text binding in code?

I have a ListBox whose ItemsSource is bound to a list of objects. The Listbox has a ItemTemplate with a DataTemplate containing a TextBlock. The textblock's Text is bound to the object's Name property (i.e. Text="{Binding Name}"). I would like to provide a radio button to show different views of the same list. For example allow a us...

Adding web service bindings into SharePoint web.config using SPWebConfigModification

This is a solution rather than a question actually. The problem was: I had a SharePoint web part which used a WCF service. To consume the web service in my web part, I needed to modify the SharePoint web.config to include bindings and end points. To be able to do this, I put my web service configuration into a text file as a template. T...

BindingList for DTO which support object deleted state

I have a BindingList for DTO which can bind directly to window form control and the problem was raised when user want to delete a row in my datagridview. In that situation, the deleted object (row) go away and when that DTO BindingList get back to server for updating, I dont know which row to delete. Can a BindingList have a collecti...

WPF Tooltip Visibility

How can I ensure that a button's Tooltip is only visible when the button is disabled? What can I bind the tooltip's visibility to? ...

Binding a Collection<bool> to togglebuttons/checkboxed

Hi, I have a collection of bools associated to days of the week - Collection() { true, false, false, false, false, false,false}; So whatever the bool represents means that this collection applies for sunday (sunday being the first day of week here). Now I have set the itemssource of my listbox, say, to be this collection. <ListBox Ite...

How to pass and update objects with luabind in c++

Hi, i am trying to integrate a scripting mechanism to my existing project.However i could not understand how to pass objects to lua with luabind. For example i have an entity class and i want to update them in lua files. #include <stdio.h> #include <ctime> #include <iostream> #include <string> #include <list> using namespace std; ex...

WPF: Dynamically binding a list to (some of) an object's properties

I have a collection of objects stored in a CollectionViewSource and bound to a DataGrid. I want to display a 'detail view' of the object currently selected in the DataGrid. I can obtain the current object using CollectionViewSource.View.CurrentItem. MyClass{ [IsImportant] AProperty{} AnotherProperty{} [IsImportant] ...

why the tableview doesn't show binding data?

Here's my code of generating data - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application [array initWithCapacity:20]; } - (IBAction) readlog:(id)sender { for (int i = 0; i < 20; i++) { NSDictionary *d = [NSDictionary dictionaryWithContentsOfF...

Binding a dataset to Listview

Hello, I am trying to bind a dataset to Listview. I get error at the below line of code : ListViewItem lvi = new ListViewItem(drow["Roster"].ToString()); the error message is "the overloaded method.... has invalid arguments". Pasted below is the code. private void LoadList() { // Get the table from the data set DataTa...

Binding a Service to an android.app.Activity vs Binding it to an android.app.Application

Is there any fundamental difference in binding a service to an android.app.Activity vs binding it to an android.app.Application. I want to bind the service to an Application because I want to keep some global state/data in the Application instead of duplicating it in all my activities. Thanks. ...

Binding depending of type in WPF

I have a ParentViewModel which has ObservableCollection named Notices. public class Notice { public string Content { get; set; } public NoticeType Type { get; set; } } I have static controls at user control where I want to bind this observablecollection to this static controls. And I don't know how bindin...

How to set a Trigger on a child to a parent property?

I have a TreeView with a ToggleButton ( ExpanderButton ). The togglebutton has a two images ( one for expanded and one when not ). However when I select a TreeViewItem I highligh it with a different color and I'd like to change the color of the images as well ( I have the same ones in the other color ). Problem is I don't know how to se...

When to Bind and UnBind to a LocalService from an Activity

Currently, I'm binding to a service in the onCreate() method of an Activity and unbinding in the onDestroy() method of the Activity. I've more than one activity binding to the same service. Am I using the correct lifecycle methods to bind and unbind? Thanks. ...

Binding to a service in Android

I'm a little confused on how binding to services works. I understand using Context.startService() starts the service and that bindService doesn't call onStartCommand. But my understanding is that if I use startService, I have to explicitly stop the service. But I want the service to die if there are no more activities bound to it. My pr...

WPF binding StringFormat syntax

How can I format a decimal value conditionally in a WPF window? Value should be rounded to a whole number (Ex: 1,234) When the value is 0.00, it should display as a single zero. (Ex: 0) Currently I use bellow mark up to format the decimal value, but it displays 00 when the value is 0.00. Please help. <TextBlock Grid.Column="6" Paddi...

How to bind a CFC directly to a select menu?

I'm trying to create a select menu where one can select a department and then select employees in that department. Related Selects... Ok here is the problem...I need to bind directly to the cfc because binding like this: <cfselect name="people" bind = "cfc:test.getPeople({department.value})" /> DOES NOT WORK. It does nothing... here ...