binding

Why are my bound parameters all identical (using Linq)?

When I run this snippet of code: string[] words = new string[] { "foo", "bar" }; var results = from row in Assets select row; foreach (string word in words) { results = results.Where(row => row.Name.Contains(word)); } I get this SQL: -- Region Parameters DECLARE @p0 VarChar(5) = '%bar%' DECLARE @p1 VarChar(5) = '%bar%' -- EndRegi...

How does one bind to a List<DataRow> collection in WPF XAML?

Using a DataView one can specify the binding for controls in XAML for example as follows: <Image Source="{Binding Thumbnail}" /> I have a control that displays a number of images. I can get this to work with a DataView as the data source for the control, but I want to use a List collection of DataRow objects, which is not not working ...

MouseDoubleClick event in View

How do I bind MouseDoubleClick event of wpfdatagrid in the view as I'm using mvvm and Prism 2. ...

Value of text box disapears - binding viewmodel to a tab (content control)

Based on the MVVM example by Josh Smith, I have implemented the multi tab option which binds to a different tab to a different view model using a simple datatemplate that binds a viewmodel to a view. <DataTemplate DataType="{x:Type fixtureVM:SearchViewModel}"> <SearchVw:SearchView/> </DataTemplate> The issue that I'm having, is...

a selective dual command binding converter in WPF?

I'll start off and say I am not using the MVVM pattern for my WPF app. Please forgive me. Right now I have a data template with two buttons, each binds to a different command on the CLR object this data template represents. Both use the same command parameter. Here's an example of the buttons. <Button x:Name="Button1" Command="...

How Do you Declare a Dependancy Property in VB.Net 3.0

My company is stuck on .Net 3.0. The task I am trying to tackle is simple, I need to bind the IsChecked property of the CheckBoxResolvesCEDAR to the CompletesCEDARWork in my Audio class. The more I read about this it appears that I have to declare CompletesCEDARWork as dependancy propert, but I can not find a good example of how this i...

How to set a binding in WPF Toolkit Datagrid's ContextMenu CommandParameter

I need to create a ContextMenu where I want to pass a currently selected index of the datagrid to a ViewModel using CommandParameter. The following Xaml code doesn't work. What might be the problem? <dg:DataGrid ItemsSource="{Binding MarketsRows}" <dg:DataGrid.ContextMenu > <ContextMenu > <MenuItem Header="Add Di...

Windows authetication with Silverlight custom binding.

Hello, I am trying to set up security within a web.config file for a WCF service hosted in IIS but keep getting the error message: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service. I have read Nicholas Allen’s blog (link text) and it ...

[WPF] ComboBox.Text not taking the ItemStringFormat property into account

I just noticed a strange behavior which looks like a bug. Consider the following XAML : <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib"> <Page.Resources> <x:Array x:Key="data" Type="{x:Type sys:St...

Silverlight data binding to parent user control's properties with using MVVM in both controls

Hello! I have two UserControls ("UserControlParentView" and "UserControlChildView") with MVVM pattern implemented in both controls. Parent control is a container for Child control and child control's property should be updated by data binding from Parent control in order to show/hide some check box inside Child control. Parent Control ...

Pass view to viewmodel with datatemplate

I have a window named ParameterEditorView with a ParameterEditorViewModel as DataContext. In the ParameterEditorViewModel I have a list of ParameterViewModel. In the ParameterEditorView I have an ItemsControl whose ItemsSource is binded to the list of ParameterViewModel in the ParameterEditorViewModel. I need the ParameterViewModel to ha...

MVVM: how to set the datacontext of a user control

Hi, I'm writing an application in WPF, using the MVVm toolkit and have problems with hooking up the viewmodel and view. The model is created with ado.net entity framework. The viewmodel: public class CustomerViewModel { private Models.Customer customer; //constructor private ObservableCollection<Models.Cust...

ASP.NET MVC 1.0 Model Binding + RadioButton Helper + Data Annotation

I'm having an annoying issue with the RadioButton helper and Data Annotation used for validation: I'm actually replacing a dropdown list with radio buttons (because the list is small). I'm not using MVC 2 or MVC Futures (though, I think I'd run into the same problem if I were using the RadioButtonList). That particular field is require...

python binding of variable to particular expression

I am developing a simple application which hava a file Constants.py containing all configuration, it is like this x = y during execution of program , the value of y changes , I want value of x o get updated too , automatically, this can be reffered as binding, how can I achieve this ...

Binding position to ActualHeight

Hi I want to bind a lists position to its own height in XAML. So its lower left corner always will be at 0.0 of the canvas. I'm using elementBinding to get the ActualHeight and a converter to invert the property. But the height sent to the converter is 0. How do I solve this or am I going at this the wrong way? <Canvas x:Name="DisplayS...

Binding command to button in silverlight 4 using mvvm

Hello, I have a user control called HomePage.xaml. I'm creating a model instance (using MVVM pattern) in the code behind file in the constructor of page as MainViewModel model = new MainViewModel(); I have a button in HomePage.xaml which I want to bind to the command inside MainViewModel called GetData() and want to populate the data...

jquery "this" binding issue on event handler (equivalent of bindAsEventListener in prototype)

In jquery an event hadler's binding is the event generating DOM element (this points to the dom element). In prototype to change the binding of an event handler one can use the bindAsEventListener function; How can I access both the instance and the DOM element from a event handler? Similar to http://stackoverflow.com/questions/117361/ho...

TextBox and Button - Binding and Command problem

I am using MVVM pattern. I have a Text box whose Text property is bound to ViewModel's(VM supports INotifyProperyChange) Text property Button whose command is bound to VM's ICommand property type You may think of this as a SearchTextBox and SearchButton The problem I am facing is that when I enter the text in SearchTextBox and cli...

Silverlight databinding datagrid to List<List<X>>

I got a List<List<X>> object and I want to bind it to a datagrid in the following way: Each entry in the outer list represents a single column Each list inner list represents the rows for each column I need to do it in code because the size of each of the list depends on user input at runtime. Is this somehow possible? Changeing/wrap...

Best WCF config based on scenario

Hello, Please recommend best approach (bindings, encoding, transport, etc) based on the following WCF scenario and requirements: Both client and service are WCF 3.5 based. Client and service will communicate thru Internet over SSL port 443. WCF Client (a Windows Service) is on w2kx server behind firewall/NAT. Client will initiate ...