binding

Using asp.net mvc model binders generically

I have a hierarchy of classes that all derive from a base type and the base type also implements an interface. What I'm wanting to do is have one controller to handle the management of the entire hierarchy (as the actions exposed via the controller is identical). That being said, I want to have the views have the type specific fields on ...

jQuery :How to Update function associted to a div object

in jquery , how can i remove a function which is already binded to a div object (named divItem1) and bind a new function with new parameters ...

How to bind a Control.Property to a property in the code-behind?

Hello. I have a TextBox in my WPF window. I have a property in the code behind called Text as well. I want the text property to be bound to the Text property (i.e. when the value changes in the property the textbox value should also be updadated. Thanks ...

Binding window title to child property

I've got a window with my custom textbox-like control on it <Window.Title> <Binding ElementName="codeBox" Path="Filename" UpdateSourceTrigger="PropertyChanged" /> </Window.Title> ... <custom:CodeArea Name="codeBox"> </custom:CodeArea> here what I have inside my CodeArea back code (CodeArea.xaml.cs) private string _filename = "NoN...

How to add Command Binding to an Items control that does not have the command binding property

I use the MVVM pattern and I have the following code: <DataTemplate x:Key="ActivityEditTemplate"> <ItemsControl ItemsSource="{Binding Path=ActivityList}"> <ItemsControl.ItemTemplate> <DataTemplate> <CheckBox Margin="2,0,2,0" Content="{Binding ActivityDescrip...

XML binding solution in .NET

Hi, Are there any proper xml binding(mapping) solutions (OXM) in .net? What I need is to generate model classes from arbitrary xml. As for now I can't find anything like JaXB 1/2, JiBX, Castor XML, XMLBeans in Java. ...

WPF ReadOnly Dependency Properties using MVVM

Hi, I've recently overridden the DevXpress WPF grid to give myself a SelectedObject property that I can access from my loosely bound ViewModel. I've made a SelectedObject dependency property and have it bound OneWayToSource in my XAML. Everthing works fine, but if I try to make it ReadOnly (for completeness) I get a compile error and ...

Binding redirect problem in .net

I have a class library called "MyAssembly" that is internally referencing a.dll, b.dll of version 3.1.1.0; I have build the project which outputed MyAssembly.dll. On a different system (box) I have created a web application project and referenced the MyAssembly.dll. the new system has new versions of a.dll and b.dll 4.0.0; I used binding...

asp.net mvc: how to create custom binding for models when using LINQ to Entities

I've got a number of tables in my db that share common cols: modified by, modified date, etc. Not every table has these cols. We're using LINQ to Enties to generate the I'd like to create a custom binder class that can handle the automatic binding of these fields. Is there a way to do this without having a custom binding class for e...

Python: Binding method

In following example I am trying to bind a method object via types.MethodType(...). It does not seem to work. Any suggestions? Thanks in advance. import types class Base: def payload(self, *args): print "Base:payload" class Drvd(Base): def iter(self, func): derived_func = types.MethodType(func, self, Drvd) # b...

WPF data binding - DataGridComboBoxColumn and ObjectDataProvider

I'm trying to code a WPF 4.0 DataGrid that matches a database table, with two entries in particular GroupID and SectionID... GroupID contains a collection of groups, and SectionID should be built from a table that takes a {GroupID, SectionID} keys and returns section information. Binding the DataGridComboBoxColumn to the groups table to...

wpf binding when using datatemplate

ok currently i have this piece of code: <TabItem Style="{DynamicResource MyStyle" x:Name="TabCustomers" Padding="0,1,4,1" Header={Binding Path=customersHeader}/> Now i want to add an icon there so I do (by removing the header above): <TabItem.Header> <StackPanel Orientation="Horizontal"> <Image Stretch="UniformToFill" Source="{...

WPF Binding to a method with parameter inside HierarchicalDataTemplate

Is there any way to bind a value to a textblock that is obtained from a method. For example, I pass my Person object into the HierarchicalDataTemplate, from there I can access its Weight property. Now lets say I want to get the weight in mars, I would call the InMars method that takes a parameter of int EarthWeight . Now earthweight is g...

MultiBinding problem

Hey I have an XmlDataProvider that refers to an XML file and a specific node, and a TextBlock which it's Text property is bind to an element. So far so good, everything works and I can see the element's value in the TextBlock. What I'm trying to do is to forward that value into a method that will return me a string value that I have to...

Expander.IsExpaned only if current template is a descendant of a ToolTip.

Hello. I am using a DataTemplate (a StaticResource) in several places in my application as in an ItemsControl, ContentControl and in a ToolTip. The template contains an Expander, and I want its IsExpanded property to be true if the DataTemplate is located within a ToolTip. Any recommendations? ...

WPF Toolkit Datagrid and ListViewCollection SortDescriptors

Hi all I have a weird problem with datagrid. I have a list with 2 items, inside every item there is a ListCollectionView. A datagrid is binded to the selected item's ListCollectionView. if I add (in code) a sort description to the selected item's ListCollectionView ,select item 2 and then select item 1 again the ListCollectionView so...

WPF - Binding plus a tweak

I am wondering if there is a way with WPF binding to set the value via binding plus tweak it. For example I have the width of a border being set to the canvas that contains it: Width="{Binding Width, ElementName=mainCanvas, Mode=Default}" Because I am doing a border with rounded corners. the Canvas.Top and Canvas.Left for the border...

WPF Trigger binding to MVVM property

I have a datatemplate containing an image that I want to be hidden if the the value of a property in a ViewModel is true. Can anyone tell me why the the xaml below does not work? <Image x:Name="img" Source="..\Images\List_16.png" Margin="0,0,5,0"> <Image.Style> <Style> <Style.Triggers> <DataTrigger Binding="{Binding ...

WPF textbox binding issue.

I have a wpf window which is used to add as well as edit information about an entity. I am using mvvm architecture and ADO.Net entity model. The screen looks something like this - <!-- EmployeeView --> <Window .....DataContext={.....}> <WpfToolkit:Datagrid x:Name="dgEmployees" CanUserAddRows="fals...

Silverlight UserControl Binding

Hi I have a simple User Control Xaml: <UserControl x:Class="GraemeGorman_Controls.Navigation.NavigationItem" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; <Border x:Name="borderLayoutRoot"> <TextBlock x:Name="textBlockCaption" Text="{Bi...