wpf

Is binding from two datasources possible?

Hello, I would like to know, if it is possible to do something like this in XAML. <Binding Source="{StaticResource baseData}" XPath="/baseData/nodes[@value={StaticResource actualData},XPath=/actual/node}]/text" /> The code-example ist not possible. But how could I select a node from baseData with the value of the node /act...

make Listbox items in WPF not selectable

I have a listbox in WPF, and when they select an item, it shows an ugly colors Can I make all the items non-selectable? ...

WPF DataGrid update issue

Hi all, I am facing a scenario here. I have a main class which initializes a DataGrid added in MainWindow of wpf application. There is a thread class in which DataTable object is passed by ref and that thread is responsible for updating the DataTable. As the thread runs the DataTable gets updated but but the view does not get updated. ...

How to raise event when Current application property is changed.

I have a WPF application. In my App.xaml.cs I save the full name of the logged in user as follows: App.Current.Properties["FullName"] = GetValueFromDatabase(); I have two screens/windows in the same application. First is the users scrren, which has a an editable WPF data grid where I can update full name of the current user. Seco...

A good collection to use when binding to a DataGridView in C#.

What would be the best collection to use when binding a list of data to a DataGridview in C#? I'm currently using just a Generic List but the data grid doesn't update when there is objects added or removed from the list. I've looked at using a BindingList or a ObservableCollection, but can't decide which would be best to use that would...

MouseOver event are missing alternately

I'm using a modified form of treeview, for the treeviewitem there is a template to show a textbox with a done button in a popup. I have used a static class to find if the mouseOver (IInputElement currentPosition = Mouse.DirectlyOver;) event on any of the other treeview item to highlight them other than the one in Popup textbox. Items ar...

TypeConverter for generic type used in xaml

I am looking into initializing members of generic types declared in XAML. This is targeting the (reduced) generics support in WPF 4 and future Silverlight. (I have tried the scenarios below using x:TypeArguments and XamlReader.Load in VS2010 Beta 2, but will use TestClassInt32 : TestClass<int> { } for simplicity, as it has the same behav...

TreeView Sync to SelectedItem in View Model

I have a ViewModel on top of a WPF TreeView control. I want the ViewModel to be able to set and read the SelectedItem from the TreeView. However, the SelectedItem property of the TreeView is not bindable. I am able to set and get the selected item in the code behind (using the ItemContainerGenerator and TreeViewItem.IsSelected = true) b...

WPF Dynamic resource reference

HI Am load a string xaml with DynamicResource assigned to a Background property. Is there a way to get the reference of the dynamic resource. Background="{DynamicResource Color1}" I want to get the resource reference assigned to a Dependency property at runtime Pl help ...

Why dependency properties?

Why did Microsoft go the route of making dependency properties and dependency objects instead of using reflection and maybe attributes? ...

DataBinding of a UserControl via ControlTemplate

Hello, I'm playing around with the Infragistics xamDataGrid. I'd like to display in a "Field" (= Cell) a custom UserControl and have for it the Field's DataContext. Somehow the DataContext is always null :-) Here is the XAML: <UserControl.Resources> <Style x:Key="MyTestUserControl" TargetType="{x:Type igDP:CellValuePresenter}"> ...

WPF attach popup with a control

I have a scenario where I am displaying a popup on my control. I am able to do this using PlacementTarget, Position, etc. My problem is when I resize the window and move it to somewhere else in the desktop, the popup remains stationary meaning it doesn't move with the control set as PlacementTarget. I was able to hide it in case of oth...

WPF - example with DataGridComboBoxColumn

Sometimes the easiest examples are the hardest to find . . . I have a datagrid with 2 columns. One column contains role information, the other column should have a combo box with a list of available users. The data in the combobox is unrelated to the data in the first column. I'm thrown off by the fact that the combobox does not have a...

[WPF] Clip region inside the border of geometry

for a given geometry with border width , How do I get the clip region which exclude the border ? ...

Problem binding DataGridComboBoxColumn.ItemsSource

Hello! I have 3 tables: Item - which is the DataContext - it has a navigation column Group Group - has a navigation column Category. I want to have in the DataGrid both (Category & Group) columns and when I choose a category it should display in the group col only the Category.Groups. Here is the code I am working on: <tk:DataGrid Au...

Are third party controls as good a value for WPF as they are for Winforms?

During my days doing Winforms development, I constantly found myself struggling against System.Windows.Forms controls. Then I used DevExpress WinForms controls and I would never even think about going back to the default controls. With my very introductory (think "Hello, world") understanding of the new WPF way of doing things (screen ...

listbox itemtemplate for selected item

Hi I am using Listbox with ItemTemplate, and when I select an item from the list, it shows blue background How can I style the selected item, to be similar to non-selected one? ...

WPF what is the equivalent of SelectedIndexChanged for a datgrid combo box column?

How can I can an event to fire similar to selectedindexchanged with the datagridcombobox column type? ...

Which has better rendering performance, Stackpanel or Canvas+TranslateTransform? WPF/Silverlight

I always use a Canvas when I'm laying out my visuals usually because I will need adjust the RenderTransform.TranslateTransform to animate in some way. A colleague recently told me that unless I explicitly need to animate I should always use the A Stackpanel because it is faster than a RenderTransform.TranslateTransform when laying out ob...

How to set a .PNG image as a TILED background image for my WPF Form?

I'm learning WPF on my own and I can't seem to find a way to make this work. Here's my code: <Window x:Class="Test.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Test" Height="600" Width="800" > <DockPanel> <Menu DockPanel.Dock="Right" ...