binding

WPF - Do not show Context menu when ListView is empty

I have a ContextMenu bind to ListView, but I don't want to be the menu shown when the ListView is empty. I tried direct binding to element, tried binding using FindAncestor, but none of these works and the menu is always shown when I click right mouse button in the ListView. What would be the correct binding? <Grid> <ListView x:Name="lo...

How to create a lazy-seq generating, anonymous recursive function in Clojure?

Edit: I discovered a partial answer to my own question in the process of writing this, but I think it can easily be improved upon so I will post it anyway. Maybe there's a better solution out there? I am looking for an easy way to define recursive functions in a let form without resorting to letfn. This is probably an unreasonable reque...

exception in initializer error

I am using Netbeans. I did some things with bindings and now whenever I start my program, before it even intializes the form, it gives me an error The exception in thread main is ocuring before the form is even an intialized object yet. The form is not even an object yet. Every line in my main() causes an exception. Random stuff. ...

WPF/MVVM: RichTexBox as datagrid cell editor, put formatting code into ViewModel ?

I really wonder what I can put in the ViewModel. If its needed to be tested might some say... But when the properties like CaretPosition (to get the selected Text) are no dependency properties, then better forget about the ViewModel. At the moment I have this in the codebehind: private void rtbContent_SelectionChanged(object sende...

ElementName vs. FindVisualAncestor

How does the XAML engine search for Binding.ElementName vs RelativeSource.AncestorType. It would take a huge different when I am searching for a parent Window or Page (that x:Name was set in it), if the ElementName searches up (meaning starting from near current element up the tree levels children, then it's better to use the AncestorTy...

jQuery.click not binding on elements added with jQuery

I have a calendar where I can ad events to a list. It works like this: I click save, and data is saved to DB using jQuery.post To refresh the list, I call getList() which returns a html list of events I replace the existing list with the new one. The problem is, that the new element is added after page load, thus not binding. I thin...

Dynamic/instant resize in JavaFX

How do you create a JavaFX application that (instantly) dynamically resizes? Right now I have coded a simple application that dynamically resizes but the layout changes don't display until after the release of the mouse button on a drag. I want instantly see the results/layout changes before this button release. I'm assuming this is do...

silverlight binding to a dependency property in a custom control

I've got a custom control ive created that is instanced in my view, in my custom control (a text box) i have a dependency property set up which is bound to the text value, this all works correctly and updates. However I now want to bind a dependency property of my view to the dependency property of my control but I cant get this to quite...

Multiple activities binding to a service

Hi All, I have a service component (common task for all my apps), which can be invoked by any of the apps. I am trying to access the service object from the all activities, I noticed that the one which created the service [startService(intent)] has the right informaion. But rest does not get the informaion needed. My Code is as below: ...

WPF + MVVM - Access object/property in UserControl

Hi! I have searched the net for a way to access an object/property within a UserControl. I have a Page object in my view in wich i load a usercontrol: <UserControl:RichTextEditorControl Height="350" /> How do i access an object/property which resides in the viewmodel of my view from my usercontrol? To put my problem in practice: i h...

access the Window's DataContext from within a DataGrid

I have some problem to access the Window's DataContext from within a DataGrid. The DataGrid is bound to a IBindingList: public IBindingList Items{ get; set; } private void initItems() { //ItemFactory is a Linq2SQL Context, Items is the view of availabe Items this.Items = this.ItemFactory.Items.GetNewBindingList...

Silverlight UpdateTarget() workaround for BindingExpression

Hello there, Can anyone suggest a way to create in Silverlight a workaround for UpdateTarget() method that exists in WPF? Removing the existing binding that exists on the DP and setting the value manually is not an option for me. Thanks ...

[WPF] How to draw a simple volume bar fast / databinding ?

I have a INotifyPropertyChanged derived class with a Volume property (float, 0.0f - 1.0f) that gets set on a fixed frequency (say 30fps). I'd like to draw a tiny volumebar displaying this in my window. I don't want to use a normal databound progressbar, I'd prefer something simpler (and faster :)). Is there a proper way to simply draw a...

WPF: Getting source of a Binding

I have a reference to a Binding instance, which was defined with an ElementName in XAML. How can I get, at runtime, the actual element instance being the effective Binding's source? The same question holds for bindings with Source, implicit DataContext, etc: how to I get the effective source, given only the Binding instance? And, if ma...

Bindings in two diferent Datatemplates for the same control

Hi, I'm doing a generic controller, right now is one button from telerik with two direferents datatemplates. Each dataTemplate has an specific key to id and in code-behind i change between them. My problem is i cannot do the binding to my properties. For example: My Xaml looks like: <telerik:RadButton x:Class="Itim.Framework.Silv...

Why Storyboard value wouldn't get from a resource or binding?

I have construction below and it works: <Storyboard x:Key="GrowOnStart"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Left)" Storyboard.TargetName="window"> <EasingDoubleKeyFrame KeyTime="0" Value="1024"/> Why it doesn't work if I try something like this: <EasingDoubleKeyFrame KeyTime="0" Value=...

WPF: Displaying templated objects

This seems basic, but I want to display a representation of some CLR objects that currently exist in a DataContext. I've already set up DataTemplates for how I want them to look, I just want to plop them into the visual space. I tried this, but it doesn't help: <StackPanel> <Binding Path="CalibrationA" /> ...

jQuery event delegation for select/options in Chrome

I am trying to bind a simple click event to an the selected option of a pulldown. $('select#myselect').delegate(':selected', 'click', function() { alert('selected'); }); This code works in Firefox, but not Chrome/Safari. Can I use the .delegate() to bind an option for a pulldown menu like this? If so, how? If not, what is...

Bind to NSTreeController selectionIndexPaths

Hello, I want to bind to a NSTreeController's selectionIndexPaths programatically by doing the following (so that I can get a string a selection and display in a text view) [activePDFView bind:@"name" toObject:treeController withKeyPath:@"selectionIndexPaths.nodeName" options:options]; The tree controller is bound to a NSMut...

What is c++ equivalent of JNDI?

Is there anything equivalent to JNDI in C++? I am not just looking ldap related libraries. I am interested to know the equivalent API's/Libraries available in C++. Common API for look-up, where implementation can handle against DNS, LDAP, Registry, FileSystem, DB. ...