binding

NHibernate and INotifyPropertyChanged

I am having some issues with binding to objects retrieved from NHibernate using lazy loading. I have read some on the issue and am confused on what I need to do to fix things here. As I understand it the issue has to do with the way NHibernate handles the proxies for things that haven't been loaded yet. Has someone implemented NHibernat...

WPF: Locate Parent Window from ListView ViewBase

I have a ListView that allows the user to change the ViewBase through a Context Menu (it acts like a simplified version of windows explorer). <ListView Name="lv" Grid.Row ="0" Grid.Column ="1" > <ListView.ContextMenu> <ContextMenu> <MenuItem Header="View1" Click="SwitchViewMenu"/> <M...

Binding XML attribute in Flex

I have this variable in Model class: [Bindable] public var someXml:XML; I've used BindingUtils to get notified when the XML changes: BindingUtils.bindSetter(onChange, Model.getInstance(), "someXml"); private function onChange(value:Object):void { // do something } Function onChange gets triggered when I assign an XML to the va...

Appended link to Autocomplete causing problems

Hello, Using the 'open' event I have appended an <li> which serves as a "See More Results" link at the bottom of the results. However any attempt I make to bind a click event is fruitless. I get an error in the jQuery UI saying "d.item is null" ln 242. I think this means it is trying to look for data from the result query to automatica...

Binding to a collection of user controls in XAML

I've a collection of UserControls which I want to show in a stack panel. I've no control over how and what those user controls contain. I just know that they are some sort of user controls (could be a button, a textblock or any UIElement.) Here is a small example public class Car : IHasView { public UserControl MyView { get return ...

Map From ValueProvider To Model In BindModel?

In an MVC2 app, I have various controller methods that will be handling incoming JSON data. I created a custom JSON ValueProvider that parses the data and makes the data available for binding. I'd like to have various controller methods have as param type an (Edit/From/Whatever) Model to which to map the parsed JSON values. I have adapt...

How to hide stringformat if data is null

Hi..How to hide a stringformat when data is not present.Consider this sample <TextBlock Text="{Binding Amount, StringFormat=Total: {0:C}}" /> in this case if Amount is null,Then it will show just Total:.How to hide this if Amount is null or empty ...

Bind the Height of the Listbox inside the StackPanel to StackPanel`s height

Hello, I want to bind the Height of the ListBox to the Height of the StackPanel so the ListBox stretches itself Vertically so the green area is not visible anymore. When there is no item in the listbox its hidden. When there is item > 1 the ListBox must be stretching itself to the add/del buttons so the add/del buttons are always at th...

WPF: Textbox Binding with StringFormat={}{0:F2}. Don't show zero's.

I am binding an object to a TextBox with the following XAML: <TextBox Name="MyTextBox" Text="{Binding Path=MyValue, Mode=TwoWay, StringFormat={}{0:F2}}" /> Naturally when I bind a new object (which values are all still zero) the Text property is set to 0.00. I have several of these TextBoxes, which makes it tedious to delete every valu...

WPF DataGrid Bind Editor Setting to another property

I have a field in a DataGrid, bound to a value (Item.Amount), now inside the style for that field editor, i would like to bind the Format field to Item.QuantityDecimalPoints. But I cannot seem to be able to go up the tree to the same Item that the record is bound to. I have tried the following: Format="{Binding Path=QuantityDecimalPoi...

In WPF how do I bind a Content Property of the UserControl to the internal control.

I Have a user Control which Contains a ScrollPanel. And I want to bind the userControl's content property to the ScrollPanel. So my xaml would look like: <CustomControl> <StackPanel/> </CustomControl> and in my UserControl my ScrollPanel child is set to StackPanel. ...

Silverlight Command Binding

I am looking at the following xaml: <Grid x:Name="LayoutRoot" Background="White"> <Button Content="Say Hello..." VerticalAlignment="Center" HorizontalAlignment="Center" my:ButtonService.Command="{Binding Path=SayHello}" my:ButtonService.CommandParameter="Bob"/> </Grid> I...

WPF Binding Issue with Textblock

I have 2 custom controls on my MainWindow.xaml. The first is an usercontrol that is a button/label combination (StyledButton) and the second is a custom textbox. I need to be able to set the text on a StyledButton so I created a TextCaption property. The binding on the TextCaption is causing the Text property of my custom textbox to b...

Silverlight: Binding Dynamic Data to a DataGrid

Hello folks, I've run into a problem recently, hoping you all could help. I was tasked with creating an application that can take any DataSet, and display it in a series of grids (using something like a tab control). I was able to do this pretty easily in WPF: 1. Create a WCF Service that returns a DataSet object 2. Create a WPF Windo...

How to call a method/selector when a variable/object changes value on iPhone

Hi, I'm looking for a way to "monitor/observe" a singleton class I'm using to pass information back from an asynchronous http request. I want to update the UI once I have received and parsed the response. Since iPhone SDK does not have an NSArrayController to monitor my data in the singleton, how can I do an asynchronous UI update? Thi...

WPF Databinding Singleton Properties (From Multiple Windows)

Edit 3: TLDR-Version I have a singleton DependencyObject that I'm binding UserControls to. Some of the UserControls are in the main window, some of them appear in a separate window (the settings window). The ones that appear in the settings window do not bind correctly and do not affect the values in the singleton. I have a singleton...

WPF radio buttons - MVVM - binding seems to die?

I've bound the data context of the following Window to the code behind to give me a MVVM style to demonstrate this behaviour: <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="3...

2 Properties in One Binding?

Can I combine 2 elements in one biding? <Canvas> <Ellipse Fill="Black" x:Name="dot1" Width="16" Height="16" Canvas.Left="124" Canvas.Top="133"/> <Ellipse Fill="Black" x:Name="dot2" Width="16" Height="16" Canvas.Left="221" Canvas.Top="40"/> <Line Stroke="Black" x:Name="line1" X1="{Binding ElementName=dot1, Path=(Ca...

Child item in TreeView not updating

I copied the basic method of having checkbox in a treeview from the official Silverlight toolkit Checkboxes in a TreeView example. When a user clicks on a parent TreeViewItem I want all of the child items to be checked, as in the above example. This works fine when the parent is collapsed, clicking the checkbox puts a tick in the paren...

Why am I getting exception when binding IList to a combo box?

I have the following classes/interfaces. I'm getting an ArgumentException saying "Complex DataBinding accepts as a data source either an IList or an IListSource". But, I am setting it to an IList. What am I doing wrong? public interface IOriginList : IList<IOriginEntry> { ... } public class OriginList : Interfaces.IOriginList { ...