wpf

WPF Blurry Images - Bitmap Class

I am using the following sample at http://blogs.msdn.com/dwayneneed/archive/2007/10/05/blurry-bitmaps.aspx within VB.NET. The code is shown below. I am having a problem when my application loads the CPU is pegging 50-70%. I have determined that the problem is with the Bitmap class. The OnLayoutUpdated() method is calling the Invalida...

Unable to retrieve the module type Error

I'm using prism as an example; this is my first time playing with WPF. I've written two modules; orderModule and orderDetailModule. I was able to run my app and have them populate on one screen, now I'm trying to have only one module load and load the other with a button click. I was loading my modules in code before, then I noticed pris...

Are there any good documents or websites that show design guidelines for XAML GUIs?

I am looking for some guidelines or standards for XAML GUI design... or even a very good set of examples that show nice GUI that I can use as a starting point. Over the years I have grown into a very good Battleship Grey Dialog designer, but those are old, and ugly now... and I need to revamp a couple of product GUIs. I know with XAML...

How can I "Click Through" a control in WPF?

I have an order entry form that has a listbox with a list of line items. I have my items template, and one of the values is a ComboBox in each of my Items. Now, my form can also create Credit memo's in addition to purchase orders, but when I am creating a credit memo, I want to put the words "Credit Memo" over the list box, however, th...

XAML in Database - Getting Very Meta

How would you go about making an application that can edit it's own look and feel? Can tweak its own XAML files? then reload them. I'm thinking a notepad-like text editor, not a visual designer. All the event/code would be bound right after display from an "iron" scripting language. ...

Implementing AllowColumnReorder

Hi, I have a control that inherits from TreeView (System.Windows.Controls.TreeView from WPF Framework) and it implements a GridViewColumnCollection to show columns next to the tree. However now I need to implement AllowColumnReorder in case we don't want users to reorder the columns, how can I achieve this? Here's the code for the TreeVi...

Sorting CollectionViewSource using custom IComparer

I'm trying to sort a collection derived from CollectionViewSource, which simply has SortDescriptions for sorting. Unfortunately I need to be able to use my own custom IComparer, but I can't seem to find a way to do that. Think of a datagrid and I have my own multi-column sort algorithm. I'm thinking one way to do it is to use a collectio...

Where is the sample code for the Visual Studio 2010 extension to format code comments?

I was at PDC last year and saw a demo of an add-in for the next version of Visual Studio (2010), where the display of code comments for a C# code file had custom formatting. I was under the impression that he code for this add-in was available somewhere, but I've not been able to find it anywhere. The talk to which I'm referring was ...

How can I set the TabIndex on a WPF Expander control?

In this example window, tabbing through goes from the first textbox, to the last textbox and then to the expander header. <Window x:Class="ExpanderTab.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" ...

How to rewrite WPF routed commands dispatching mechanism

Hi there. Can I extend WPF commands routing in a way so it would first check whether command can be invoked in the focused field and if not in some other (never changing)? Is there any hooks for that? Maybe you don't know whether that would work but saw something similar somewhere on the net and can spare the link? Abstract example For...

When would ShowDialog() return null?

WPF's Window.ShowDialog method returns a nullable boolean. So does CommonDialog.ShowDialog. Now, I understand cases where these would return false (user clicked Cancel or pressed Esc), and when they would return true (code sets Window.DialogResult to true, probably in response to OK being clicked). But null? My first thought is that cl...

How can i set the caret position to a specific index in passwordbox in WPF

Hi I need to set the cursorposition inside the passwordbox explicitlyin WPF. i couldn't see the selectionstart property in passwordbox. Any help? ...

Where's the Events bookmark ?

I've installed .NET 3.5 SP1 and I still dont't see the Events bookmark. The compiler was reinstalled few times, still without result. I have VS 2008 Professional Edition I mean: ...

WPF: Printing a multi-page TextBlock

I'm using a FlowDocument to print in WPF using the method described here but I'm running into problems trying to span multiple pages. Just under the root of the FlowDocument, I have a textblock, eg: <Paragraph> <TextBlock Text="{Binding Directions}" /> </Paragraph> If the text it's bound to is longer than one page, only one page i...

Adding rows to wpf datagrid

Hi all, I need to select a set of rows from one wpf toolkit datagrid and want to add it in another wpf toolkit datagrid. The code I used is as follows: foreach(DataRowView row in MyFirstDataGrid.SelectedItems) { MySecondDataGrid.Items.Add(row); } But the problem here is, it just adds empty rows in the second datagrid without any co...

WPF XAML Bindings and CurrentCulture Display

I'm seeing some invalid behavior from XAML documents when the CurrentCulture is changed. When I have some elements like this in a Window: <Window x:Class="WpfLocalizationLocBaml.Test" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:glob="clr-names...

WPF, change bindings based upon a trigger, possible?

I have a usercontrol, that when one property changes, the bindings change for a number of different embedded controls (in the same user control). Before I waste too much time, is this something that can be done with a Trigger or DataTrigger? I can do it in code behind but this seems 'dirty'. ...

What does Cannot modify the logical children for this node at this time because a tree walk is in progress mean?

Hi, I am setting the DataContext of an object in the completed method of a background worker thread. For some reason, I get an error saying: Cannot modify the logical children for this node at this time because a tree walk is in progress pointing to the Chart1.DataContext=allDates line. What does a tree walk is in progress mean? I'...

Replace Desktop with WPF Application

Wondering if it is possible to replace the desktop (ie. icons, wallpaper) with a WPF Window, Frame or something that I can interact with using WPF and C#? I also don't want it to hide when Show Desktop is clicked. I'm guessing I'll need to use some Win32 APIs or something? Anyone have any examples, or can anyone point me in the right di...

WPF: Dynamic MarkupExtension- ReRendering/Updating of value

Hey everyone, I´m using a markupextension for loading internationalized strings in a WPF application like this: <Button Content="{Translate MyText}"/> My markupextension is named "TranslateExtension" and it searches a value for the key "MyText" from a database. It does this in the ProvideValue(IServiceProvider serviceProvider) me...