binding

WPF - Swapping ContentControl (relinking elements???)

I'm working on a custom panel control and one of the things I'm trying to have it do is swap it's content at run-time. There's two states to this control: Maximized and Normal. When the user clicks a button on the control the state switches. There's two properties on this control: MaximizedContent and MinimizedContent. When the button to...

WPF : InputBindings on a StackPanel

I want to put a command on a ListBoxItem. The ListBoxItem use a DataTemplate composed of a StackPanel (containing an Image and a TextBlock, both using Binding). I want that the doubleclick on that ListBoxItem fire the command. I have tried this : <DataTemplate> <StackPanel> <StackPanel.Resources> <CommonUI:Comma...

Sqlite binding within string literal

Using sqlite3, if my query is SELECT * FROM table WHERE title LIKE '%x%' It will match strings that contain x. I want to make x a bindable parameter, like: SELECT * FROM table WHERE title LIKE '%x?%' However, this does not work since the '' form a string literal. Is there some way of escaping the ? within the literal? I understand th...

Problem with manually editing a textbox bound to a property that's continuously updated

Hi, I have a textbox bound to a property. The property continously gets updated from a timer. What I'm trying to do is to make it so that when I'm in the middle of typing something in the textbox, the textbox should stop updating itself from the property. Is there a way to do that? Thanks! ...

XBAP: Binding to object from resource not work?

In “Wpf Browser Application” project. Page: <Page.Resources> <local:SomeClass x:Key="someClass" Value="String from XAML"/> </Page.Resources> <StackPanel> <TextBox Text="{Binding Source={StaticResource someClass}, Path=Value}" /> </StackPanel> and class: internal class SomeClass { public SomeClass() { Value = "...

Lua bindings to C++ and garbage collection.

Ok, here's a problem I'm having. I have Lua bindings to a rendering engine that has an internal render manager that keeps its own track of pointers for the render scene and manages them. The problem is that when I'm using it from Lua, if i don't keep a Lua reference to every single object i add to the C++ render manager, it starts to ga...

How can I debug the binding of my ViewModels to my View?

I have this ItemsControl in my View: <ItemsControl ItemsSource="{Binding ItemPageItemViewModels}" ItemTemplate="{StaticResource ItemPageItemViewModelsTemplate}"/> And above it I have this DataTemplate which renders all the items: <DataTemplate x:Key="ItemPageItemViewModelsTemplate"> <TextBlock Text="{Binding Title}"/> </...

How can I add an "IsDirty" property to a Linq to Sql entity?

Okay, similar questions exist, but they are all about how to determine this from outside of the entity itself and use the DataContext the entity is attached to. I am binding my entities to an edit form in WPF. Within a DataTemplate, I want to be able to set the background color of the root container within a DataTemplate to show it has...

How to store value of data binding expression into variable.

Hi, I need to access the value of a bound item several times in a template. Right now my ListView template looks like this: <asp:ListView ID="ListView1" runat="server" ItemPlaceholderID="plc"><br/> <ItemTemplate><br/> <input type="radio" class="myrating<%# DataBinder.Eval(Container.DataItem, "Day")%>" value="3" /><br/> <input type...

WPF Textbox binding and line breaks

I have a textbox that i am binding to the viewmodel's string property. The string property is updated within the viewmodel and it displays the text within the textbox through binding. The issue is that i want to insert the line break after a certain number of characters in the string property and i want that the line break is shown over...

Silverlight: Programmatically binding control properties

The big picture: I have a custom child control that generates various textboxes, datepickers, combo etc based on properties that I set. This control is embedded in various places within my SL application. I generally use the MVVM pattern, and I want to bind the values of these dynamic controls back into my master page view model. I al...

WPF How to bind GridView column width in code?

I need to bind width property of the GridView column that is created dynamically in code. Since GridViewColumn object has no SetBinding method, how should I do this? Thanks in advance. ...

To bind clear to ^l in Bash

I would like to have Ctrl-l for clear in my Bash. How can you bind Ctrl-l to clear in Bash? ...

LINQ Refresh does not result in Changed Events

Is it just me or does changes produced by refreshing the LINQ DataContext not result in Changed Events? I have a multiuser Application which has an simple atomar locking system to prevent conflicts. So if an User changes something in the database I need to trigger Refresh on the Datacontext to reload the concerning objects. A breakpoin...

Can I set the content of a Label to a Binding Expression AND a static value?

Is there a way to set a Label's Content property to both a Binding Expression AND a static string value? I want to be able to display something like this: "Current Value: [Value From Binding]" I was thinking something like this would work, but apparently it doesn't: <Label Content="Current Value: {Binding ElementName=SomeTextBox, Pat...

Placing common contols in two tab pages.

I have a tab item with 2 tab pages. I want to place 4 check boxes in each of the tab pages with all check boxes having the same property. How it can be done easily? ...

Silverlight: Nested containers and Binding

The Scenario Bit: On one of the controls within my Silverlight application I have embedded a custom user control. Within this embedded control is another custom user control that contains a datagrid. I would like to use binding to populate the datagrid. Easy enough I just sepcificy a collection that is in the DataContext of the parent c...

How to refresh a binding of the itemssource of a combobox programmatically?

I found some items regarding this questions on SO, but they do not satisfy me. They talk about INotifyProperyChanged, but that does not help in my case. I have a Combobox. For the ItemsSource, I use a MultiBinding and a Converter to create an ICollectionView. The ICollectionView gets bound to the ItemsSource. On the GotFocus-event, thi...

Binding an Image source to TextBox.Text

I am trying to bind the Text of a TextBox named 'txtImage' to an image using the following code with no results: <Image Source="{Binding ElementName=txtImage, Path=Text}" /> What would the right approach be? ...

wpf binding combobox to enum in different namespace

I'm trying to bind a XAML ComboBox so that its list items are the members of the System.IO.Ports.Parity enum. I've found plenty of examples of databinding enums, but it seems these don't work if the enum is in a different namespace (like System.IO.Ports). Right now I have: <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Ty...