binding

Refreshing Listbox after adding element in DataContext

Good afternoon, I am trying to use as Linq to SQL datacontext for a ListBox in WPF. Basically, I assign the Linq DataContext to the form's DataContext property. Then, I bind it to the list.ItemsSource. Everything works fine, I can show the details of each of my elements in a textbox (master-details scheme). The thing is, I would like...

IronPython & WPF: Binding a checkbox's IsChecked property to a class member variable

I've seen many similar questions on how to get data binding working with a checkbox, but all of the examples I've seen are in C# and I can't seem to make the leap to convert it to IronPython. I have a checkbox defined in a window thusly: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://sc...

wpf how to disable the defult animation when button is pressed

i have a memory card game where i want on clicking on a button to bind the prorty button background to this is what i am doing: <Button Name="btn" Click="Button_Click" DataContext="{Binding}" Height="65" Width="79" Background="Black"/> <DataTemplate.Triggers> <Trigger SourceName="btn" Property="IsMouseCaptured" Value="Tru...

Flex: Binding to the Height of the UITextField

Hi, I'm having problems binding the height of a UITextField to the y of a VBox and the height of the TitleWindow. I'm trying to adjust the height of the TitleWindow and the height of the VBox so, that the UITextField doesn't overlap the other content. Alternatively, I've tried setting the height of the UITextField to an explicit heigh...

Dynamic/Static scope with Deep/Shallow binding (exercises)

I'm studying dynamic/static scope with deep/shallow binding and running code manually to see how these different scopes/bindings actually work. I read the theory and googled some example exercises and the ones I found are very simple (like this one which was very helpful with dynamic scoping) But I'm having trouble understanding how stat...

WPF: Bind to command from ControlTemplate

Hi. I am trying to add a button to a custom ListView (MyListView) which triggers a command (MyCustomCommand) defined in MyListView. I have added the button (and a title text) by applying a ControlTemplate. The problem is that I have not found a way to trigger MyCustomCommand when clicking the button. What I eventually want to achieve is ...

MVVM: Does the ViewModel format the data it gets from the model?

I'm a little confused about MVVM. I understand the concept and can see the advantages. My problem is: does the ViewModel pass data directly from the model. For example, let's say I have a "User" model with a findByName() method. The ViewModel would call this in order to pass the relevant user details to the view. The model would likel...

memory card game wpf problem

Hello I have a memorey card game where my binding is to public ObservableCollection<List<memoryCard>> MyCollection { get; set; }//holding the array where is initlized like this : for (int i = 0; i < Size; i++) { List<memoryCard> list = new List<memoryCard>(); for (int j = 0; j < Size; j++) ...

WPF Textbox loses original values, even if the user doesn't udpate

Hi, I am having a very strange issue. I have a datagrid which is binding to an observable collection of type Person The selected item is bind to an Object Person. I have 2 textboxes firstname and lastname. When ever user selects an item from grid, the textbox values gets populated. user can edit the values and click submit button, val...

Editing variable length list with MVC 2 and javscript disabled

I'm using the approach mentioned in the last part of Steve Sanderson's post to dynamically add/remove items in a collection using Ajax: http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspnet-mvc-2-style/ Does anyone know a way to get this approach working so that it degrades nicely when JS is disabled? If my m...

Binding from context menu item to parent control

I have a control, on that control is a command called SaveToClipboardCommand. I want to bind a context menu item command to that command so that when i click it, the copy to clipboard command is executed. <Control x:Name="Control"> <Control.ContextMenu> <ContextMenu> <MenuItem Command={"Bind to SaveToClipboardCom...

WPF TextBox binding to decimal respecting culture

I've bound a TextBox to a Decimal. My problem ist, the Binding is using american numerical standards, using a dot for decimals separation ("1.5") My system is german and configured to use a colon as decimals separation ("1,5"). I need the TextBox binding to show and use a colon instead of a dot to separate decimals. How do I get the b...

Binding GradientStop works but reports Error

The following code binds a GradientStop to the TemplatedParents Background.Color property. Everything works but I get a binding error in the output window: System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Background.Color; DataItem=null; target el...

Flex + custom component + design-time + binding

Hello, I'm trying to create simple custom component with two labels with this MXML: <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="250" height="30"> <mx:String id="result" /> <mx:Label x="5" y="7" id="titleLabel" text="{label}" width="120"/> <mx:Label x="125" y="7" id="resultLabel" text="{result}" width="120...

Does SproutCore's "Binding" feature let widgets initiate a call to the server to obtain data?

My team is tasked with quickly evaluating SproutCore and a couple of other alternatives. There's not really enough time for a deep dive, but our findings might let us convince the powers that be to allow for a deeper dive. (Right now, we're just taking a quick glance to see "what's out there"). So me and a teammate have started looking ...

Bind to a CheckBox and execute a command in a MVVM way

I have a question similar to this one, but in a more detailed situation. I am also trying to implement the solution using the Model View Viewmodel pattern. In MainView, I have a button which calls a command (we'll call it Execute) stored in MainViewModel. I also want this command to be called when the left button of the mouse is clicked...

Binding Between elements inside DataTemplate

Hello, How can I make binding between properties of two elements inside dataTemplate ? example : // Bind Text property to Content property <DataTemplate> <TextBox Text="{Binding}" /> <Label Content="{Binding}" /> </Datatemplate> ...

Windows mobile datagrid binding

I am trying to bind a Generic List collection of type string to dataGrid instance and always the data grid displays column titled with length and list the length of each element not the elemnt it self I am developing Device Application (smartphone application ) using Windows mobile SDK Professional edition and Visual Studio 2008 SP1 prof...

DataGrid , TextBox - binding and instant updates

Hi, My app. contains the window in the picture: The ItemsSource of the DataGrid is set to _editList ( declared as IList < Vendor > _editList;). The data grid is set to Read Only. The Vendor Name text box has the binding set as : Text="{Binding ElementName=dataGridVendors, Path=SelectedItem.Name, Mode=TwoWay}" This works wel...

WPF datagrid binding : add new item

Hi, I have the following window in my app: The list is declared as : IList < Vendor > _editList; and the datagrid is populated via : dataGridVendors.ItemsSource = _editList; The "New" button creates a new Vendor and adds the vendor the _editList. Vendor vendor = new Vendor(); _editList.Add(vendor); Unfortunately.... the new ven...