wpf-binding

How to get the caller of a WPF Converter?

Hi, I try to get the element which calls a converter in it's Convert function. The reason is, that I've got a style for TreeViewItems, and want to Bind the BackgroundColor to the Content(If there are subitems or not). Therefore I need the Converter, who needs to know what the correspondenting Item contains, and in my opinion therefore...

WPF bind to datagrid from template

hello, i'm new in wpf. I have a DataGrid form wpftoolkit and i need to show button in template only when row is selected and the record is not last(new record item) <dg:DataGrid AutoGenerateColumns="False" DockPanel.Dock="Top" ItemsSource="{Binding Source={StaticResource Entries}}" Name="dataGrid" ...

WPF Binding individual text boxes to an array....

If my programmer creates a .dll that I can reference in my WPF project, and his .dll contains an array or collection of continuously changing data, what is the best way for me to update many individual controls on my WPF form? The controls will be objects like textBlocks... The .dll can contain any type of data object for my program to...

How to change ancestor's property with a trigger on template child

I have a combobox and I have templated its control template. Togglebutton is a part of the control template. Now when a event is raised on the togglebutton(ex: Checked), I want to change combobox property(ex:Foreground). How to do this? Can we do this using relativesource? ...

Binding a property on on a great-grandchild to an ancestor

I'm not even sure how to express this, so im very sorry if the title is confusing.. My XAML (simplified) looks like this: <UserControl x:Class="PBA.Application.Client.UserControls.UserControls.FreqReserve.OverView" xmlns:FreqReserve="clr-namespace:PBA.Application.Client.UserControls.UserControls.FreqReserve"> ... <DockPanel> ...

Assigning a command to the EventSetter

Hello, How to assign a command to the Handler in EventSetter, I want to to write this: <Style x:Key="ItemStyle" TargetType="{x:Type ListBoxItem}"> <EventSetter Event="PreviewMouseDoubleClick" Handler="{Binding MyDoubleClickCommand}"/> ...

Display Dynamic Number in WPF TabItem Header

I have a TabControl where every item contains a User Control called Timeline. This "Timeline" has a property called "Number" which changes during runtime. I want to make the property "Number" to be displayed in the TabItem header. And i have really no idea how to do that to be honest. My first thought is that i have to create a Custom ...

WPF/Silverlight XAML: How do I bind a SQL bit field to a True/False combobox or listbox?

I store True/False values as bit fields in SQL Server. The fields are nullable. What is the XAML syntax to bind a bit field to a WPF combo box so the user can choose True/False or blank (null)? By the way, I'm binding to a strongly-typed dataset/datatable. Drag and drop binding has simplified binding to other datatypes. I certainly don...

TextBlock Databinding

Hi When I run following code textblock is not changing. My guess is databinding is missing either in code or XMAL. XAML <Window.Resources> <ObjectDataProvider x:Key="PersonObj" ObjectType="{x:Type local:Person}" MethodName="GetFirstName" /> </Window.Resources> <Grid> <!--<TextBlock Margin="26,7,12,...

ObservableCollection<T> binding through MVVM doesn't update the view

Hello, I have the following simplified ViewModel public class UserViewModel : IUserViewModel { public DelegateCommand<object> NewUser { get; private set; } public ObservableCollection<UserInfo> UserList { get; set; } public UserViewModel( ) { NewUser = new DelegateCommand<object>( OnNewUser ); this.UserLi...

how to hide a button that is bound to a command that cannot execute?

hello, the title says it all, instead of disabling the button which happens automatically, i would like to hide (or rather collapse the visibility of) the button. thanks for your help konstantin ...

How can I change the color of each character in a textblock

I am writing a little diff tool and need to be able to change the color of a character depending on if its the same, added, removed. What would be the best way to handle this? Is a textblock a good control to start with? ...

WPF Binding Alternatives / Enhancements

I love WPF bindings, but I often find myself wish I could do a little more. PyBindings seem like a good start, but the Python syntax seems very clunky and out of place in a XAML file. Are there any alternatives out there? Something with a simpler syntax, that allows for quick comparisons & conversions so that I don't have to write (an...

WPF Hierarchial Treeview Multbinding Mixed List Problem

I'm having a tough time solving this simple issue : I am using a treeview with HierarichalDataTemplate to show an hierarchy of two entities : Organization and Unit. The Organization has a many to many relation with itself as it could have sub organizations. And each Organization has one to many relation with Unit, as an organization co...

Wpf Popup placement

Hello, Is there any chance I can place popup next to an item from ListBox? I use MVVM, list is bound to elements, and for some choosen elements I want to show popup next to the item. I have list of elements and I want to show popup when I click on specified list element, but popup should be shown next to selected list item. I tried so...

WPF Dynamic menu associated with the object?

Hi everyone. I'd like to be able to create dynamic menus associated with certain object. Let’s say, I will have 3 listview container with one style where I also have a Menu. I need to generate different menu items from collection of the RoutetUICommands in relation on each listview. I was trying to solve this puzzle but took me a while a...

Cinch version of ViewModel command to close a View

Without wanting to bug sacha too much, does anyone know what the Cinch V2 way of closing a View from a ViewModel command? Previously I have used a RelayCommand in the ViewModel base to accept the Escape keybinding command action and wired up a RequestClose event in the View code behind to do this. ...

How to update Frame source from two listboxes on selected item value???

Hi, I hope to find an answer on how to achieve functionality I am trying to have. I have two listboxes. I generate content for them from XML. I also define UriSources in XML. I'd like to find out how to achieve a navigation by clicking any listbox item in any listbox. As a result, I need to be able to update Frame's Source property from...

What is the Dependency property in WPF.

Hello EveryOne, What is the Dependency property in WPF and Silverlight. Why we required and where we can use it. Thanks... ...

how to pass an integer as ConverterParameter?

hello, I am trying to bind to an integer property: <RadioButton Content="None" IsChecked="{Binding MyProperty, Converter={StaticResource IntToBoolConverter}, ConverterParameter=0}" /> and my converter is: [ValueConversion(typeof(int), typeof(bool))] public class IntToB...