binding

jQuery simple pager rebinding

Hi everyone - I basically have a rebinding issue but none of the solutions I've found has specified how to remove a binding entirely (and for a plugin-based function, not like unbind("click")). For the SimplePager plugin, basically it adds a cool pager element at the bottom of the page, but I lose the AJAX binding after I perform a sep...

Using custom ModelBinder to have strongly typed TPH models in controller actions-- is this smelly?

Here's a little background on my solution: ASP.Net MVC app Using Linq-to-SQL with table-per-hierarchy inheritance Using DataAnnotationsModelBinder as default So I have a Device abstract class and then a series of derived classes (ServerDevice, DiskDevice, PSUDevice, etc) that inherit from it in the proscribed Linq-to-SQL way. I have...

Passing two command parameters using a WPF binding.

I have a command which I am executing from my XAML file using the following standard syntax: <Button Content="Zoom" Command="{Binding MyViewModel.ZoomCommand}"/> This worked fine until I realized that I needed TWO pieces of information from the view in order to make this operation complete the way users expect (the width and height of...

Is there any way to temporarily detach a binding in WPF?

Background: I have a ListView/GridView with several columns. In some situations, only some of the columns are shown. Since there is no Visible property for GridViewColumns in WPF, I set the width of the columns I want to hide to zero. Visually, this achieves the desired effect (and I actually modified the ControlTemplate for the GridVie...

Does ItemsTemplate+DataTemplate obscure bindings?

At several points in my current application, I have an ItemTemplate such as the following: <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <ToggleButton Ma...

Items in ObservableCollection not updating the view

Hi, I'm stumped here. I have an observable collection that holds business objects. I have it bound to ItemsSource of a ListBox. I am updating the X and Y of my object and it is being displayed correctly in the UI during runtime as it is bound the the Item top and Left. But, here is where the problem is. I have also bound some data to be ...

WPF Bindings won't update unless I recreate the entire list???

Background: I have a List<T> in my ViewModel defined as... private List<FooBar> _fooBars; public List<FooBar> FooBars { get { return _fooBars; } set { if (value == _fooBars) return; _fooBars = value; OnPropertyChanged("FooBars"); } } FooBar is defined as... public class FooBar { public st...

Silverlight datagrid cell edit event

I have a checkbox column bound to a dependency property. When editing the checked property is it possible to update the bound property immediately rather than waiting for the cell to lose focus? Thanks, Mark ...

How to do simple Binding in Silverlight?

I understand that Silverlight 3.0 has binding but just want a simple example on how to use this to read a property from a class. I have a class called Appointment which as a String property called Location: Public Property Location() As String Get Return _Location End Get Set(ByVal Value As String...

Basic Problem with Asp.net MVC UpdateModel(myClass)

In my Controller in a Asp.net MVC 1 app I want to use UpdateModel to populate a variable with POST data in my controller. I've looked at dozens of examples but even the most basic ones seem to fail silently for me. Here's a very basic example that's just not working. What am I doing wrong? public class TestInfo { pub...

How to put a unicode character in XAML?

I'm trying to do this: <TextBlock Text="{Binding Path=Text, Converter={StaticResource stringFormatConverter}, ConverterParameter='&\u2014{0}'}" /> To get a to appear in front of the text. It doesn't work. What should I be doing here? ...

WPF UserControl Command Parameter Binding to an object on the Parent

Hi, I have a UserControl Tasks.xaml that is used within a couple of property pages that inherit from a PropertyPageBase class - which itself inherits from UserControl. Within the Tasks UserControl, I want to use a Context menu command and the CommandParameter needs to bind to a DependencyProperty called Data on the PropertyPageBase cla...

WPF two-way binding: how do I update a TextBox with a formatted version of the value it just set?

I have a class, called DateField, that has a string Value property. If you set this property to a string that can be parsed into a valid date, the property setter sets Value to the properly formatted date, e.g.: private string _Value; public string Value { get { return _Value; } s...

ContextMenu Binding Source within a DataGrid using MVVM

I've got a datagrid column as below: <toolkit:DataGridTemplateColumn> <toolkit:DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Path=LabelName}" Background="{Binding Path=Color}"> <TextBloc...

[ASP.NET MVC] How do I bind data in a database to my data classes?

As a simplified example, I have the following data classes: public class Employee { public string FirstName { get; set; } public string LastName { get; set; } public Position Position { get; set; } } public class Position { public string Title { get; set; } public string Description { get; set; } public decimal ...

Binding to the selected TabItem content

I have a Window with two controls: control1 is a control that has a bunch of buttons that execute RoutedCommands; the second control is a TabControl that is bound to a list of documents. The TabControl ContentTemplate is a user control, control2, that has a ListView. I would like to bind the DataContext of control1 to the ListView of con...

jquery unbinding is it necessary? (replacing elements)

I have some elements with events bound. Before I remove those elements, do I need to unbind them first? If I don't will they cause problems? Thanks. Edit: I realized I phrased the question incorrectly, so now I'm making an edit, excuse me for that, I but I think it makes more sense to do this than make a new question. I would have to ...

Core Data bindings with subviews and multiple NIBs

I have a document-based Core Data app. My main Core Data entity has several string fields, most of which are bound to NSTextFields, but one is bound to an NSTextView. I am using the technique for view switching (with multiple view controllers) as explained in the Hillegass book. All of my subviews are controlled by a ManagedViewControll...

How to TemplateBind to BorderThickness.Top (or Bottom or Left or Right)?

Hi friends. I wonder if it is possible to bind a structure element like BorderThickness.Top to TemplatedParent's corresponding property. I have tried <Border Margin="0" Padding="{TemplateBinding Padding}" BorderBrush="{TemplateBinding BorderBrush}"> <Border.BorderThickness> <Thickness Left="0" Right="0" Top="{TemplateBinding...

Prism - Commands Not Firing

Hi, I've got a view <UserControl x:Class="Modules.NavigationMenu.Views.NavigationMenuView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300"> <StackPanel> <Button Command="{Binding InspectionCommand}">Inspection</Button> <Button Com...