binding

Silverlight Binding

I've a Silverlight page using a MVVM behind it to handle all the data bits going on. The data context is set for the page using: DataContext="{Binding AddNewClientViewModel, Source={StaticResource ServiceLocator}}" ServiceLocator being a service that allows me to create and inject the appropriate VM using an IoC container. This all ...

MVC Complex Model Binding

I would like to do complex validation on my form that contains a list of objects. My form contains a list of, let's say, MyObjects. MyObject consists of a double amount and a MyDate which is just a wrapper around DateTime. public class MyObject { public MyDate Date { get; set; } //MyDate is wrapper around DateTime public double...

Render List<Canvas> as list items (or itemscontrol)

I've effectively got a List or a List, XAML that represents the canvas elements... as a return from some stuff I have no control of. I've been moderately successful rendering via stackpanel.children.add etc, however want to start having the list of canvas within a virtualizing panel or list. I've set itemssource and datacontext on the...

Data-bound UserControl in ListBox.ItemTemplate

I have a simple class Product and a UserControl named ProductSummaryControl. ProductSummaryControl displays the details for a Product class that is passed in to its DataContext. I have verified that this works when I set up the control and its property manually. I run into a problem when I try to use the ProductSummaryControl as part ...

Mapping Java with JAXB annotations to XSD keys/keyrefs

We are using JAXB to map Java classes into XML files. Currently we use the Java-to-XSD approach by annotating the Java classes. This works fine in general but we've hit the following problem now: we want an attribute of one XML element to refer to another XML element by it's name/ID. Imagine some XML describing a conceptual schema, with...

Property binding across controls in WPF

I have two UserControls that I want to display in a Window. The value of the property "SelectedItem" of the first UserControl should be set to the second UserControl's "SelectedItem" property. How do I do this? In my current code, the value set in the first UserControl's property does not trigger an update in the second UserControl. I h...

silverlight 3 collection binding

Someone please help me understand why this binding does not work... I have a class called SelectionManager with a property called 'dates' which is populated by a WCF service. The property is an array of structs which bundles a DateTime and an integer count of business objects. public class SelectionManager : INotifyPropertyChanged {...

WPF Binding objects defined in codebehind

I have some object that is instantiated in code behind, for instance, the XAML is called window.xaml and within the window.xaml.cs protected Dictionary<string, myClass> myDictionary; How can I bind this object to, for example, a list view, using only XAML markups? Edit v2 (This is exactly I have in my test code): <Window x:Class=...

How can i pass a form field as a action parameter by using Seam framework ?

Hi, I do not know whether it is possible but i want something like <f:view> <h:form> <div> <label for="accountId">Type your account id</label> <input type="text" name="accountId"/> </div> <div> <label for="amount">Type amount</label> <input type="text" name="amount"/> </div> <di...

WPF How to select node from node-list with binding.

Hello, I want to know if the following in XAML is possible: I have a FlowDocument used for printing. The FlowDocument is bound to a DataSource from which I get the current data. The data is a XML-Document which is also bound to an gui where the Data is inputted. The gui contains some comboboxes with a text-representation of the data-val...

How can I get a reference to a method that contains the arguments used for invocations, in Ruby?

Given this code: a = {1=>2} m = a.method(:[]) I know that I can now use : value = m.call(1) and it will return 2. The thing is, what do I need to change so that I can call the method directly like : m.call() and it will get the 1 sent as a parameter? It would be nice to be able to write something like : m = a.method(:[],1) # wh...

WPF Data Binding Error in ListBox

I have a listbox <ListBox x:Name="HistogramListBox" Grid.Column="1" Margin="8,2,8,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Template="{StaticResource HistogramListBoxControlTemplate}" ItemContainerStyle="{StaticResource HistogramListBoxItem}" ItemTemplate="{DynamicResour...

FormView not passing a value contained within "runat=server" row

I have the following code in the EditItemTemplate of my FormView: <tr id="primaryGroupRow" runat="server"> <td class="Fieldname">Primary Group:</td> <td><asp:DropDownList ID="iPrimaryGroupDropDownList" runat="server" DataSourceID="GroupDataSource" CssClass="PageText" DataTextField="sGroupName" DataValueField="iGroupID" SelectedValu...

WCF - choosing best suited binding/encoders

I have a client server application in which the communication between the client and the server is by WCF. My WCF services are supposed to be consumed only by my clients. ie, I am not bother about the service interoperability. The service might not be in same network as with my client application. And It would be hosted the service in I...

WPF to Silverlight, getting around TargetType Issue.

Hi all. I have a converter that returns a background colour based on a binding value on a DataGrid. This is working great in WPF but when i put this code into silverlight it is not happy. Reading some posts on here it seems i can not use TargetType="{x:Type my:DataGridCell}" The answer suggested was to use simply TargetType="my:DataGr...

WPF MVVM User Control binding issues

I have an application that uses MVVM. I have several items on the main window that bind to the ViewModel for that window. When I run it everything works. However, when I add a user control to the main window and try to bind to one of its dependency objects it throws an exception (“Object reference not set to an instance of an object”). T...

Wpf Binding tow binding on the same Dependency property

i have a control the have a property called "SelectedItems" my control bind SelectedItems to an innerDataSource. the control user bind this property to his model view how do i explicitly trigger a bind update for the two binding ? using getBindingExpretion Gives me reference to only one of the binding . ...

Inject Index of Current item when binding to a repeater

I am binding a List<HtmlImage> to a repeater Its actually a nested repeater and the list is one of the properties that the parent repeater is binding to I want to spit out the index of the current dataitem into the id property of the <li> I've put a comment where I want the index to appear below I have the following: <asp:Repeater...

Problem binding DataGridComboBoxColumn.ItemsSource

Hello! I have 3 tables: Item - which is the DataContext - it has a navigation column Group Group - has a navigation column Category. I want to have in the DataGrid both (Category & Group) columns and when I choose a category it should display in the group col only the Category.Groups. Here is the code I am working on: <tk:DataGrid Au...

Is it possible to obtain a list of events bound to an element in jQuery?

As the question said, i need the list of events bound to a specific element. I mean events like click, mouseover etc bound to that element at the loading of the dom. (Stupid) example: $("#element").click(function() { //stuff }); $("#element").mouseover(function() { //stuff }); $("#element").focus(function() { //stuff }); ...