binding

WPF Converter to look up in generic list

I have a list of data where I keep e.g. countries with code, name and some other data. List<Country> countries = <deserialized objects from file> which consist of objects like this: public class Country { public string Code { get; set;} public string Name { get; set;} } The object which use as a DataContext m...

putting multibinding on a single line in xaml

Is there a way to take this multibinding: <TextBox.IsEnabled> <MultiBinding Converter="{StaticResource LogicConverter}"> <Binding ElementName="prog0_used" Path="IsEnabled" /> <Binding ElementName="prog0_used" Path="IsChecked" /> </MultiBinding> </TextBox.IsEnabled> and put is all on one line, as in <TextBox IsE...

Set ListBoxItem.IsSelected when child TextBox is Focused

Hi, I have a typical MVVM scenario: I have a ListBox that is binded to a List of StepsViewModels. I define a DataTemplate so that StepViewModels are rendered as StepViews. The StepView UserControl have a set of labels and TextBoxs. What I want to do is to select the ListBoxItem that is wrapping the StepView when a textBox is focused. I...

Flex - Binding on width property using percentages in MXML code

Is it possible to set a percentage value for the width property of an UIComponent defined in MXML using data binding? What I try to achieve is something like this (which doesn't work): <s:Button width="{buttonWidth}%"/> I know that using percentage for width or height properties in MXML is kind of a hack in the Flex SDK, since they'...

WPF Toolkit Charting and IndependentValueBinding, IndependentValuePath

So I'm having a problem with the charting engine from the WPF toolkit. We haven't moved our data to a proper object model, so the ItemSource is backed with a DataView. First attempt <chartingToolkit:ScatterSeries x:Name="TargetSeries" DataPointStyle="{StaticResource TargetStyle}" ItemsSource="{Binding Path=TargetSeriesData}" ...

Silverlight: Binding a child grid of a grid to a child property (list) of a child propety of an object bound to the parent grid

Hi all, I am using Telerik's Silverlight grid control (RadGridView) to display a table of data (List of companies) and every row can be further expanded to show list of employees working for the company as below: +Company 1 +Company 2 -Company 3 Employee 1 Employee 2 ... I have the following classes to work with: Company ...

WPF UserControl weird binding problem

Hello! Im usign a Ribbon Window and in the "content area beneath" I have a grid in which I will be displaying UserControls. To demonstrate my problem lets take a look at this simple UserControl: <ListView x:Name="lvPersonList"> <ListView.View> <GridView> <GridViewColumn Width="120" Header="Na...

WPF ComboBox Binding breaks when using ControlTemplate

I have a WPF ComboBox that has been working fine until I recently created a ControlTemplate for it to enable me to change the color of the DropDown arrow. The ComboBox still works correctly except the Bound Text value now just shows the name of the Business Object rather than the bound value. I guess that binding like Text="{Binding P...

TabItem Binding WPF

Hi, I'm just learning WPF and I could use some help. I have an application which use TabControl and dynamically generates new tabs,on each Tab I have one TextBox and now I'd like to add an undo button to the tool bar which is not the part of the tab (VisualStudio like). The undo button has to work only on the TextBox wich is on the activ...

AvalonDock document binding

Hi, I'm using AvalonDock (link) to create my application. I have a toolbar and a documentpane (VisualStudio like) and each new document contains a textbox. And now I'd like to add an Undo button to my toolbar which will undo changes on the textbox wich is placed on the selected document.It's completely same like it's in Visual Studio. ...

XForms bind element error

Hi! I am changing my code to use binds in XForms (which is better practice than using nodesets everywhere!) but I am getting errors. The error message I receive is: "Error: XForms Error (8): id (data_criterion) does not refer to a bind element..." From tutorials/guides I have been using, it seems as though this should work, but clear...

WPF binding to ComboBox SelectedItem when reference not in ItemsSource.

I'm binding the PageMediaSize collection of a PrintQueue to the ItemSource of a ComboBox (This works fine). Then I'm binding the SelectedItem of the ComboBox to the DefaultPrintTicket.PageMediaSize of the PrintQueue. While this will set the selected value to the DefaultPrintTicket.PageMediaSize just fine it does not set the initially s...

Bind WPF DataGrid column to another

I want to enable / disable a DataGridTextColumn based on whether or not the SelectedValue of its neighboring DataGridComboBoxColumn == 'Other' I can make this work in a ListBox as below, but this won't work in my DataGrid environment as the DataGridComboBox column doesn't have a name property. <ListBox Grid.Row="1" Grid.Column="1" Item...

Powershell 2 remove single binding iis 7

I am trying to remove one site binding. I am using powershell 2 and iis 7. I am able to remove all bindings with Remove-ItemProperty, and when i use Set-ItemProperty it removes all binding and just adds the new. I would be great if i could just rename or just remove a single binding without effecting the others. A sample would be gre...

wpf image source: "format" binding (-> filename) with stringformat

i've got a INotifyPropertyChanged-abled class and thought it would be a good idea to use: <Image Source="{Binding myfilename, StringFormat='FixedPath/{0}.png'}" /> so whenever i would change myfilename in source, i'd get the corresponding image in my wpf gui. it compiles. but in the console i get the error that a TargetDefaultValueC...

reactivating or binding a hover function in jquery??

hi guys, with the following three lines: $( ".thumb" ).bind( "mousedown", function() { $('.thumb').not(this).unbind('mouseenter mouseleave'); }); i'm unbinding this hover-function: $(".thumb").hover( function () { $(this).not('.text, .file, .video, .audio').stop().animate({"height": full}, "fast"); ...

WCFServiceException: Required attribute 'binding' not found.

Hi, My WCF Service when hosted is throwing an error: WCF Service PayThisException: Required attribute 'binding' not found. (C:\Temp\WCFVirtualDirPath\web.config line 278) Please help me with some solution. Cheers, Ravi Santlani ...

Silverlight Binding to TranslateX

I have a simple winphone7 application, but I think this would apply to any silverlight. Basically I have an ellipse and I would like to move it with the translate X and Y properties. Here is my attempt: <Ellipse Fill="#FFF4F4F5" Margin="0,0,-3,-3" Stroke="Black" RenderTransformOrigin="0.5,0.5" > <Ellipse.RenderTransform> ...

Xaml Namescope and Template Question Concerning WPF ContextMenu

Everything in the code below works except for the binding on the ContextMenu. This is evidently due to the fact that the ContextMenu is located inside of a Style, which puts it in a different namescope from the rest of the xaml. I am looking for a solution where I won't have to instantiate a ContextMenu in the code-behind, since the ap...

XML as DataSource

I have an XML file called employee. I want to bind the XML file to a GridView. pls help... thanx :-) ...