wpf

WPF DataGrid ComboBox causes InvalidOperationException

I am getting an InvalidOperationException('DeferRefresh' is not allowed during an AddNew or EditItem transaction.) from my datagrid when I try to edit the value of a combo box column. The items I am showing all have a reference to one other item in the same list so this is what I am using the combobox for. It is bound to the same collect...

How to keep a data-bound list reverse-sorted

I have a listbox bound to a collection. I would like the ListBox to always reverse the order of the items. This handler--hooked up to the control's load event--works for the initial load, but not thereafter. Ive tried using the SourceUpdated event but that doesnt seem to work. How do I maintain a constant active sort? MyList.Items...

Is a WPF application managed code only?

I want to use WPF in an app. I want to write it in C++. Does the application have to be managed? I know that I can mix managed with unmanaged. I'm wondering if I can have the whole application be unmanaged. ...

ColumnSeries Style and Layout WPF Chart Control

I'm using a chart and column series in the WPF toolkit to display a value for each month of the year. Everything is working good and the chart loads except it looks like junk since the series labels on the X axis are all overlapping and I cannot figure out how to get the sizing correct. When using the lineseries the chart seems to size...

Expression Blend 3 Default Images Location Problem

I'm using Expression Blend 3 to do the visual side of our project. In the project, we have a folder, named "Images", which we want to use to contain all of our image data. In Expression, though, whenever we add a new image, it adds it directly to the project root, and has all references to the image pointed there. Currently, we do all...

How can I get the position of a key on a keyboard

I am writing my own on screen keyboard. The only piece missing is the position of each key on the keyboard. Windows allows you to get the keyboard layout: http://msdn.microsoft.com/en-us/library/ms929433.aspx But how does one get the position of a key for a given layout? ...

Apple Dock like (Magnify items near mouse) control in WPF?

Does anyone know of any WPF controls that act like the Apple Dock (something like this). If not how would you go about creating one? A horizontal listbox of images is simple but I can't seem to recreate the smooth magnification of the images based on where the mouse is. Any help would be appreciated. ...

Wpf Bring to Front

I have a ItemsControl which uses a Canvas as as as the ItemsPanel. The itemsTemplate hosts a Custom Control. When the control is clicked I would like it to "move to the front". I know I can do this with the ZIndex in my control like so: private void MyControl_PreviewMouseDown(object sender, MouseButtonEventArgs e) { if(((FrameworkE...

ToggleButton Checked Event Handling

I have ToggleButtons that are dynamically created based on my datasource. I would like to have only one togglebutton checked at a time when a user clicks one. How can I accomplish this? <UserControl.Resources> <ItemsPanelTemplate x:Key="HorizontalMiniDrawerList"> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemp...

WPF ListBox retain view on SelectedItem on change of Style

Hi, I have a ListBox whose Style and ItemTemplate I change in code-behind on click of specific buttons. listbox.ItemTemplate = FindResource("dataTemplateView1") as DataTemplate; listbox.Style = FindResource("listBoxStyle1") as Style; There are three possible views so there are three sets of data template and style. The DataTemplate c...

Is there a better alternative to Dataset in both WPF and Silverlight?

Hello: I developed WPF / XAML applications that invoke objects (functions or Web services) which retrieve data from various sources (SQL Server DB, Active Directory, Oracle DB, SAP RFC, XML files, flat files, etc.). These objects always return Datasets, which then bind to datagrids for displaying information to the user, additionally ...

Binding Errors in DataTemplated ListBoxItems

Currently i have a user control which contains a listbox of other visual element user controls; which (for this special case) have been data templated. <Grid> <ListBox ItemSource="{Binding Path=UserControlCollection}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> ...

silverlight 4 automatic printing ssrs reports

hi i wrote a small app in WPF based on the link below , that contacts the SSRS server, sends a report name & parameters and gets a report printed automatically on the client default printer. My clients are very keen on this one click printing idea. http://blogs.msdn.com/b/bryanke/archive/2004/02/11/71491.aspx now here is my problem: I...

WPF Application base class?

Hi, I'm not even sure if this is even possible, but I've just started WPF development on a few new projects and tried to wrap up some common functionality by creating a mini-framework. Just things like exception handling and thread management. What I would like to do is replace this line... public partial class App : Application with...

WPF Printing over DrawingContext

Does someone has a link to learn how to print directly over the DrawingContext-class in WPF? ...

How can I animate show/hide of an item in an ItemsControl, but only animate if the window is already visible?

I have an ItemsControl with a number of elements, each one with its own ViewModel instance. Each item's ViewModel knows whether that item should be visible (currently each ViewModel has a Visibility property that the UI binds to). When my window first opens, some of these items are visible, others are collapsed. Later, some items' visibi...

Restricting Pixel shader on particular area of image

Hello, Is there any way to restrict Pixel shader on particular area of image. BR ...

Show Print Preview using FlowDocument?

How can i show print preview and setting paper size in WPF using FlowDocument? ...

Is there any way to apply shader effect on particular cell of a Grid

Hi, Is there any way to apply shader effect on particular cell of a Grid. BR ...

WPF KeyGesture not accepting a Shift+Alphanumeric key combination.

I'm attempting to execute some WPF commands with help of WPF KeyGesture class. Application works fine until I specify a key combination consisting of Shift modifier and an alphanumeric key. For example, following instantiation: new KeyGesture(Key.M, ModifierKeys.Shift) throws an exception: 'Shift+M' key and modifier combination is n...