binding

XAML - Generic textbox stylewith triggers / parameters?

Hello all I want to be able to have a generic style template that can switch colors of my textboxes based on a bool. But I don't want to have to create a unique style for each textbox. How do I do this? I have put some sample code below how I might expect this to work. Three textboxes, all with different bindings but attempting to use...

Style template does not reevaluate when Data updates

I have a style template (below) that does not update when my Tag binding updates. The data itself updates and I receive no binding errors so expect everything is bound correctly it is just that the style doesn't seem to update at all. I have notifypropertychanged events in all the right places afaik so doubt this is the issue. Thanks ...

Component Binding in Custom Component

How can i invoke a baking bean from the custom component class before the binding occurs. I have a scenario where the backing bean has to be initialized before the actual binding occurs. Could any one please throw some light on it? ...

wpf binding from a FindAncestor to Dependency Property of custom control

Hi, I've got a custom WPF control with a DependencyProperty MyString I'm using the control within an ItemsControl on my View and want to fish a value out from the ViewModel. As the DataContext of the control becomes each Item in the ItemsSource of the ItemsControl I thought I'd just be able to use FindAncestor but it dosnt seem to wo...

Equivalent Spring custom Collection property editor when using JSF

Hi, I would like to know how to use Converters in Java Server Faces similar to Spring collection property editor Suppose the following model public class Group { private String name; List<User> users = new ArrayList<User>(); // getter's and setter's } And equivalent form <form ...> <h1>Group form</h1> <label ...

auto binding not converting empty string to 0 for int model property

My model object has an int property named SpecialProjectId. That property corresponds to a select box. I am using a default option in the select box. However when I submit the form with the default value the ModelState.isValid keeps being false because the default select option has value="" and for some reason the default binder is NO...

Simple Event Handling in MVVM

Just wondering what people had for ideas on how best to handle events in a ViewModel from controls on a View ... in the most lightweight way possible. Example: <MediaElement MediaOpened={Binding SomeEventHandler} /> In this case we want to handle the MediaOpened event in a ViewModel. Without a framework like Prism, how would on...

Command Binding in hierarchical datatemplate

Hello! I have Menu in my app. I'm visualizing it using hierarchical data template: <MenuItem Header="Main menu" ItemsSource="{Binding ApplicationMenu}" > <MenuItem.ItemTemplate> <HierarchicalDataTemplate DataType="{x:Type tm:RMenuItem}" ItemsSource="{Bind...

do you have to qualify control property names when using the default asp.net mvc model binder

let say your controller action looks like this: public ActionResult Update(Car myCar) { } if you have a textbox that has <input type='text' name='year' value='1990'> it seems like it will bind to the myCar.year field just fine but if you have nested objects or complex lists, etc, it seems like you have to qualify the names of con...

Rendering a non UIElement via binding

If I have an object derived from System.Windows.DispatcherObject but defines a ControlTemplate. public class A : System.Windows.DependencyObject { public ControlTemplate ControlTemplate {get; set;} } which is a member of public class B { public A NonUIElement {get; set;} } Is it possible to render this object via a Binding...

Binding more than one input field to a backing bean property by using Java Server Faces ?

Hi, Suppose i have a month, day and year select. One select for each one. And now i need to bind them to a single backing bean property - java.util.Date. How do i get my goal ? ...

WCF endpoint binding settings don't get updated

All attempts to change configuration settings of WCF self hosted service endpoint fail: public void Start() { BasicHttpBinding binding = new BasicHttpBinding(); binding.Name = "NAVBinding"; //--------------------START editing------------------------------- TimeSpan interval = new TimeSpan(1, 50, 00); // all t...

Trouble passing complex data between view and controller in ASP.NET MVC

Here's a simplification of my real models in ASP.NET MVC, that I think will help focus in on the problem: Let's say I have these two domain objects: public class ObjectA { public ObjectB ObjectB; } public class ObjectB { } I also have a view that will allow me to create a new ObjectA and that includes selecting one ObjectB from ...

How do i retrieve a JSF component value by using EL ?

Hi, Before going on, see this question Its JSF form is shown again as follows <f:view> <h:form> <div> <label>Id</label> <input type="text" name="accountId"/> </div> <div> <label>Amount</label> <input type="text" name="amount"/> </div> <h:comman...

WPF Bind scale of one element to the scale of another

I have a button that I want to bind the scaleX and scaleY to the scaleX and scaleY of another element, how can I do that? The tricky part is that I want to bind it to an element that, at least on initialisation, may not have a ScaleTransform set on it... ...

JQUERY BInding to an iFRAME

Hello, I'm trying to build a "JS Confirm Below leaving the page function" The issue I'm having is that on the page I need this confirmation func I'm using CKEDITOR which creates an iframe for the text editor. // Javascript code that controls the onbeforeunload event function setConfirmUnload(on) { window.onbeforeunload = (on) ? un...

WPF Data Binding with StringFormat when UpdateSourceTrigger is PropertyChanged

I want to have a textbox append a specific string once the user tabs out of the control, i.e. LostFocus, however I prefer the textbox to validate as the user types, so UpdateSourceTrigger is set to PropertyChanged. Is there a way to get this to work in WPF? Looked at this question which is similar but wondering if there is a cleaner ...

javascript jQuery binding

Hi everyone, I have problem with javascript that needs your help, any idea is highly appreciated. I am using jQuery to create an anchor and bind it with javascript function as follow: $(document).ready ( function() { var test = function(arg) { ...

Dynamic document: WPF Combine bound text in a static inline FlowDocument.

Hello, I am trying to achieve something like the follwing: This is a WPF Flow Document shown to user. This has been generated by user Richard Richardson at 01/01/01 23:15:00. Blah blah blah (another 466 lines)... End of message. I want this date and the user name and 466 (and another gazillion literal texts) to come from Bi...

WPF Binding & Converters

I've been recently playing with WPF and I've come across a number of problems that I can't solve. I have the following code in my generic.xaml: <Style TargetType="{x:Type local:ClearButton}"> <Style.Resources> <con:ValueConverter x:Key="converter" /> </Style.Resources> <Setter Property="Width" Value="20" /> ...