wpf

Inheriting styles in custom WPF controls

I have a datagrid, and certain columns need to contain text that is linked to a detail window. So, in order to make it a bit easier on myself, I created a UserControl that is basically a Button with a control template that contains a TextBlock (I could have done this a number of other ways, I know, but I figured the button already expose...

How is WPF Data Binding using Object Data Source in Visual Studio 2010 done?

This is probably mostly a question about how to use the VS 2010 IDE tools in a way the Microsofties didn't specifically intend. But since this is something I immediately tried without success. I have defined a .NET 4.0 WPF Application project with a simple class that looks like this: Public Class Class1 Public Property One As Strin...

2-Way databinding with Entity Framework and WPF DataGrid

I'm having trouble adding an Entity Framework entity to a ObjectContext's EntitySet automatically using the WPF 4.0 DataGrid's add functionality. Here's the setup: DataGrid-->BoundTo-->ListCollectionView-->BoundTo-->EntitySet When I interactively add a row to the DataGrid, the EntitySet does not have a new entity added to it. Updating ...

Can you use data binding with the Content property of a WPF Frame?

I can use data binding to set the initial Content of a WPF Frame, but subsequent changes to the the bound property (implemented using INotifyPropertyChange) do not seem to change the content. Also, does anyone know if binding directly to the Content property in this way will cause the bound item to appear in the Frame or NavigationWindo...

Is there a logical progression to application development?

I am currently working on an application in WPF/C# for personal use. I am not a "classically trained" programmer. Simply a hobbiest that likes to code in his spare time. Is there any accepted approach to the progression of application development? I. E.; Make it work, add fault tolerance, create a gui, then performance optimization. Or m...

ValueConverter not invoked in DataTemplate binding

I have a ComboBox that uses a DataTemplate. The DataTemplate contains a binding which uses an IValueConverter to convert an enumerated value into a string. The problem is that the value converter is never invoked. If I put a breakpoint in StatusToTextConverter.Convert(), it never is hit. This is my XAML: <ComboBox ItemsSource="{Bin...

Looking for an image rotator similar to WPF Carousel

Is there a good article or source code where I could find an WPF image rotator (moves automatically) similar to WPF carousel? I'm not really interested with DevExpress Carousel Control for WPF. I'm only looking for a simpler approach for this one. ...

WPF MenuItem Color when set to black wont change to grey when disabled.

When the top menu item foreground is set to black and the background is set to white everything works fine for both XP and Windows 7. But we are using a main menu bar that is black and with white foreground. This causes issues in windows 7 only. Why is it that when you set a menuitem foreground to black it wont change to grey when dis...

How can I tell when a screen's WorkingArea changes (i.e. task bar is moved)?

I have some windows docked to edges/corners of the working area, and I need to know if/when the WorkingArea of the screen changes so I can update the position of those windows. I've attempted to tackle this before to no avail, as I recall. ...

Wpf: Why is WriteableBitmap getting slower?

There is a simple MSDN example about WriteableBitmap. It shows how to draw a freehand line with the cursor by just updating one pixel when the mouse is pressed and is moving over a WPF -Image Control. writeableBitmap.Lock(); (...set the writeableBitmap.BackBuffers pixel value...) writeableBitmap.AddDirtyRect(new Int32Rect(column, ...

How to print WPF FlowDocument within local report?

Hi, in one of our applications we're using alocal RDLC-report (displaying using a ReportViewer control) to print some tables and text entered by the user. We'd like to give the user the ability of formatting the text. I thought I might use the respective WPF controls (embedded into the Windows Forms application) to make things easy. Q...

Wpf: Loading DataGrid in Groupbox causes Groupbox to be too tall

I have a GroupBox that contains a stackpanel holding a textbox and a datagrid. When I use the textbox to populate the datagrid. Sometimes I need to load the datagrid with values. What I am noticing is that when the groupbox renders when the datagrid has values that the height of the groupbox is maxed out to the size of its parent contain...

Entity Framework 4.0 Databinding with sorting not working

I want to do something that I thought would be very simple. I want to bind a generated Entity Framework EntityCollection to a WPF DataGrid. I also want this grid to be sortable. I have tried all kinds of things to make this happen, including using a CollectionViewSource. However, nothing seems to work. Using a normal CollectionViewSourc...

WPF: Is there a built-in TreeGrid / TreeListView?

I need something just like this: (I need both the TreeView and the ListView aspects. That is, Hirearchy and Columns.) But, I need it in WPF. is this something that is built in, or am I going to have to build it myself? I assume it has to be somewhere in the framework, since VS2010 is build in WPF. Edit: I have managed to get some ...

WPF data templates

I'm getting started with WPF and trying to get my head around connecting data to the UI. I've managed to connect to a class without any issues, but what I really want to do is connect to a property of the main window. Here's the XAML: <Window x:Class="test3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentatio...

visual studio 2010 crystal reports wpf

I created my report but I cant seem to bind the report viewer with the report source? I think they changed the way things are done? ...

Using gdi+ with InteropBitmap

Is it possible to use WPF's InteropBitmap together with gdi+ ? Any examples ? (I need it for 2D drawing, many small objects; I know how to use gdi+ with WriteableBitmap => (see post by Danko) , but after all I've read InteropBitmap should be faster) fritz ...

WPF - TextChangedEventArgs being fired twice, and when can e.Changes be greather than 1?

TextChangedEventArgs is being fired twice in my RichTextBox control. Is this normal? Also, when will e.Changes (you know the TextChangedEventArgs) be > 1. The only case I can think of is someone pasting content into it. But other times it seems in normal typing a person can really only change 1 paragraph right? ...

C#/WPF FileSystemWatcher on every extension on every path

I need FileSystemWatcher, that can observing same specific paths, and specific extensions. But the paths could by dozens, hundreds or maybe thousand (hope not :P), the same with extensions. The paths and ext are added by user. Creating hundreds of FileSystemWatcher it's not good idea, isn't it? So - how to do it? Is it possible to watc...

How to save user imputed value in TextBox? (WPF, XAML)

How to save user imputed value in TextBox? (WPF XAML) So in my xaml window I have a TextBox. User sturts my application inputs some values in to it and presses a button or hints Enter. He closes an app. Opens it up again. How to make his inputs be saved in that TextBox in WPF? ...