binding

Android: Very strange layout controls binding problem

Hi, I created a layout with two buttons: btnMode and btnAction. There are clickListeners set for each: btnMode.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { onModeButton(); } }); btnAction.setOnClickListener(new View.OnClickListener() { ...

WPF/Silverlight Tookit Chart - Bind series to ObservableCollection

Is it possible to have a dynamic number of series for a WPF toolkit line chart? Every example I find declares the series manually. I want to be able to have this type of data: ObservableCollection<ObservableCollection>ChartPoint>> When I add or remove ObservableCollections to the main OC, the chart should add or remove series. I hav...

Reassign ItemsSource - Items collection must be empty before using ItemsSource.

I'm using ItemsSource on a ListView. I now want to perform a search and filter the items with an SQL query, so I reassign the ItemsSource; but then an exception is thrown: Items collection must be empty before using ItemsSource. Alright, but how can I empty the items collection? Items.Clear is not allowed when using ItemsSource.. Okay, ...

WPF: Binding with nonstatic parameter? (newbie question)

Hi guys, This will probably be obvious but I can't find the best way. I want to show the user's ToDo's in a listbox. These ToDo's are in the database and consist of an Id, UserId and Description. The user logged in to the app. How can I retrieve the ToDo's for that certain userId and set it up for binding to the listbox? I was tryi...

Binding to a UserControl's DependencyProperty

I'm trying to adapt a soltuion for the WPF toolkit's calendar from http://msdn.microsoft.com/en-us/magazine/dd882520.aspx but I'm having problems getting a binding on the usercontrol to work. I've tried using FindAncestor and ElementName, but I just get a binding error. I think it might have something to do with the tooltip and it's Dat...

WPF: how to use 2 converters in 1 binding?

I have a control that I want to show/hide, depending on the value of a boolean. I have a NegatedBooleanConverter (switches true to false and vice versa) and I need to run this converter first. I have a BooleanToVisibilityConverter and I need to run this converter after the NegatedBoolConverter. How can I fix this problem? I want to do ...

JiBXException: Multiple bindings defined for class

Strange thing... I have a binding definition user-wrapper.xml: <binding> <include path="core-wrapper.xml" /> <include path="user-composite-entity.xml" /> <mapping name="users" class="UserWrapper" extends="CoreWrapper"> <structure map-as="CoreWrapper" usage="optional" /> <collection field="users" usage="optional" ...

How to bind Assisted Injected class to interface?

Here is the problem I met: Class SimpleCommand implements Executable{ private final ConfigManager config; private String name; @Inject public SimpleCommand(ConfigManager config, @Assisted String name){ this.config = config; this.name = name; } } Class MyModule extends AbstractModule{ @Override protected void configure() { ...

Clojure binding not working

I'm working through the Clojure examples in Stuart Halloway's "Programmming Clojure" and I've hit a snag when using binding: (def foo 10) ; => '#user/foo foo ; => 10 (binding [foo 42] foo) ; => 10 (binding [user/foo 42] foo) ; => 10 (binding [user/foo 42] (var-get #'user/foo)) ; => 10 Why won't it give me 42? ...

Error in getting values from XML file to array Collection in Flex

I am trying display values in a datagrid in my application. I have all the values as an xml file. I had only one set of record n the XML file, to fill only one row of the data grid. While trying to store the values from the XML file to an Array Collection in the application File using the code, i.e., <mx:Model id="reviewList" source="...

Conditional Data Templates in WPF

How would it be possible to choose a different datatemplate accroding the a field in the data binding source? I would have 2 different DataTemplates <DataTemplate x:Key="DataTemplateLabel"> <Label Width="60" Height="25" Background="Red"> <TextBlock Text="{Binding Path=Name}"/> </Label> </DataTemplate> <DataTemplate x:Key=...

Two DOM classes run same javascript class, messing up click functionality?

I've got about 20 on/off switches that sends an ajax request which updates a field in a table. I've duplicated where the class attaches to the selector because i need to be able to designate which switches are on or off. However, the first button i click on works, but after that, i sometimes need to click once for some of the other butto...

WPF User control binding issue

This should be a very simple case, but I am pulling hair trying to get it to work. Here is the setup: I am designing an app that will have an read-only mode and edit mode for some data. So I created a User Control which is a textbox and textblock bound to the same text data and are conditionally visible based on EditableMode property (s...

C# Binding Generic LIst<string> to Combo Box

I have a combo box and I want to bind a generic List to it. Can anyone see why the code below won't work? The binding source has data in it but it won't fill the combo box data source. FillCbxProject(DownloadData Down) { BindingSource bindingSource = new BindingSource(); bindingSource.DataSource = Down.ProjectList; cbxProjectd.D...

"Ok" button command binding issue

In my app, users can click a "New Account" button. The button opens a view where the user can enter information about the new account. I used binding to tie the "Ok" button command to a command in my view model. that all works fine but I can't figure out how to close the "New Account" window since there is no code behind in the view for ...

WPF: How to stop the PriorityBinding's thread.

Listbox's ItemsSource is TList in XImage's Dispose method, How do I stop the thread which load the thumbnail? <ListBox.ItemTemplate> <DataTemplate> ... <Image.Source> <PriorityBinding> <Binding Path="Thumbnail" I...

Bind formValue to property of different name, ASP.NET MVC

I was wondering if there was a way to bind form values passed into a controller that have different Id's from the class properties. The form posts to a controller with Person as a parameter that has a property Name but the actual form textbox has the id of PersonName instead of Name. How can I bind this correctly? ...

WPF Binding Problem

I have this object: class a { public string Application; public DateTime From, To; } And I declare this list with it: ObservableCollection<a> ApplicationsCollection = new ObservableCollection<a>(); In my XAML I have: <ListView Height="226.381" Name="lstStatus" Width="248.383" Horizo...

Binding collection to tool bar buttons and getting current selected item

Here is the scenario. I'm having a List in my view model and I want to generate a toolbar - each button representing a CustomObject which will have the tooltip, icon etc. I'm defining a template to display CustomObject in a toolbar button and also define the toolbar button ItemSource to the viewmodel collection and ItemTemplate to the o...

WPF XPath Binding With Multiple Results Converted to Comma-Delimited String

I have an XML file similar in structure to the following: <Parent> <Child>5</Child> <Child>3</Child> <Child>5</Child> <Child>1</Child> </Parent> In my XAML, I have a ListView bound to the XML file and have set the DataTemplate of a ListViewItem to be bound as follows: <TextBlock Text="{Binding XPath=Parent/Child}"/> ...