binding

Binding update adds news series to WPF Toolkit chart (instead of replacing/updating series)

I'm currently recoding a bar chart in my app to make use of the Chart class in the WPF Toolkit. Using MVVM, I'm binding the ItemsSource of a ColumnSeries in my chart to a property on my viewmodel. Here's the relevant XAML: <charting:Chart> <charting:ColumnSeries ItemsSource="{Binding ScoreDistribution.ClassScores}" ...

Silverlight textblock binding question + MVVM

Hello everyone, I'm trying to create a simple textblock control and I'm trying to insert a property from my ViewModel in the middle of the string. E.G. "Hello, My name is XX, bla, bla." (XX is a property from my ViewModel) <TextBlock Text="Hello, My name is {Binding SelectedUser.Name}, bla, bla." /> Is that possible? Regards, Ad...

How to bind to method's result in Telerik RadGridView with ObjectDataProvider?

I have Telerik RadGridView. I bind IEnumerable collection where UserRole is my class which describes user's role and contains collection of permission. Imagine that collection of permissions is an array. XAML where I bind data looks like this: <telerik:RadGridView x:Name="grdRoles" Margin="5" IsReadOnly...

Android how do I wait until a service is actually connected?

I have an Activity calling a Service defined in IDownloaderService.aidl: public class Downloader extends Activity { IDownloaderService downloader = null; // ... In Downloader.onCreate(Bundle) I tried to bindService Intent serviceIntent = new Intent(this, DownloaderService.class); if (bindService(serviceIntent, sc, BIND_AUTO_CREATE))...

WPF TextBox value doesn't change on OnPropertyChanged

I have a TextBox whose Value is binded to a ViewModel property: <TextBox Name="txtRunAfter" Grid.Column="4" Text="{Binding Mode=TwoWay, Path=RunAfter}" Style="{StaticResource TestStepTextBox}"/> The set and get were working fine until I tried to add some validation when the Value is set: private int _runAfter = 0; pub...

How to bind the Command property of the ItemTemplate CheckBox to ViewModel object's property?

Let me ask this question with a pseudo code: <Window> <ListView ItemsSource="{Binding PersonCollection}"> <ListView.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding Path=Name}" /> <TextBlock Text="{Binding Path=Age}" /> ...

How can I create a silverlight combobox that drops down a treeview?

I'm trying to create a user control that is a combobox that, when opened, presents a treeview of heirarchal data. I created the user control and replaced a portion of the template in Popup with: <ScrollViewer x:Name="ScrollViewer" BorderThickness="0" Padding="1"> <sdk:TreeView x:Name="Tree"> </sdk:TreeView> <...

ItemsControl ItemTemplate Binding

Hi All, In WPF4.0, I have a class that contains other class types as properties (combining multiple data types for display). Something like: public partial class Owner { public string OwnerName { get; set; } public int OwnerId { get; set; } } partial class ForDisplay { public Owner OwnerData { get; set; } publi...

Dynamically bind argument and default value to existing function in Javascript

Let's suppose you have some function someFunc() already defined in javascript, that may or may not have its own argument set defined. Is it possible to write another function to add a required argument and set that argument to a default for someFunc()? Something like: var someFunc = function(arg1, arg2 ...){ Do stuff...} var addRequired...

WPF Bind TextBlock to Window's Title

Hello, I have a TextBlock on my main window. I would like to bind it's text to the window's title .. eg: myWindow.Title. This has been bugging me all night, and I have Googled to death, any help is appreciated. Thanks. ...

WPF binding problem

I've got a problem with binding in XAML/WPF. I created Action class which extends FrameworkElement. Each Action has list of ActionItem. The problem is that the Data/DataContext properties of ActionItem are not set, so they are always null. XAML: <my:Action DataContext="{Binding}"> <my:Action.Items> <my:ActionItem DataContex...

WPF: How do I have to setup my model and the binding strategy ?

Regard this image: The TimeTableViewModel of this user interface is this: public string SchoolclassCodeMonday {get;set;} public string SchoolclassCodeTuesday {get;set;} public string SchoolclassCodeWednesday {get;set;} public string SchoolclassCodeThursday {get;set;} public string SchoolclassCodeFriday {get;set;} public string Schoolc...

Binding Items inside a DataTemplate with Items from another DataTemplate

Hi Everyone, I have two Data Template (one for drawing[draw] and another for Input Data[data]) Also I have the two ContentControls which uses the above DataTemplates. I want the both DataTemplate's elements to be binded so that when the user fills in a field in the data form DateTemplate it automatically updates the draw Template as well...

Center Swing Windows

I'm using Netbeans to develop a Java Swing application. How can I make it so that when the program itself and any other windows open they come up in the center of the screen? I've been struggling with this and with setting the default button the "enter" key is tied to. Thanks! ...

Binding of dynamically added User Controls in Silverlight 4

Hi folks, I create a C# - Silverlight 4 Application, that consists of some User Controls visually connected by the LineArrow object. The UserControls (and the LineArrows too) are dynamically added to a Canvas in the Code-behind. I want to bind the Canvas.LeftProperty, Canvas.TopProperty, Width and Height of the LineArrow to the two Use...

Binding ComboBox Item with a text property of different DataContext

Hi Everyone, I have a comboBox as below. What I want is to bind the selectedItem value to a Text property of a datacontext so that another DataTemplate can show the Image. Please note that the Combobox and Target Image elements are on two different DataTemplates so that's why I need to update the Text Property (ImageName) ofDataContext a...

Exception validating data with IDataErrorInfo with a MVVM implementation

I'm trying to validate data in my MVVM application using IDataErrorInfo, but I'm running into some problems. When I set my TextBox with an invalid value, the validation works fine. But after I set the value of the TextBox to a valid value and I get this exception: A first chance exception of type 'System.ArgumentOutOfRangeException' oc...

WPF CommandParameter binding not updating

Hi All, I am trying to use Command and CommandParameter binding with Buttons in a WPF application. I have this exact same code working just fine in Silverlight so I am wondering what I have done wrong! I have a combo box and a button, where the command parameter is bound to the combobox SelectedItem: <Window x:Class="WPFCommandBinding...

WPF basic binding one object

Hi, I can bind collection to treeveiw but I don't know hot bind one simle object to wpc control. <UserControl x:Class="ReporterWpf.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300"> <Grid> <StackPanel> ...

WPF Binding ADO.Net Entity Framework to a ComboBox

Hi All I am working on a small system for a summer camp in WPF. I have a database that is linked via ADO.Net Entity Framework. It contains two tables; Campers & Bunks. The structure is as follows: Campers CustomerID, INT (Key) Name, NVARCHAR BunkID, INT Bunks BunkID, INT (Key) Name, NVARCHAR There is a foreign key relationship ...