wpf

GridViewColumn content and VerticalAlignment

hi there, i want to display some information in a listview using the GridView. i have several GridViewColumns and everything works fine. However, want the GridViewColumns content to have a VerticalAlignment (Top in this case) but the gridvewcolumn intself doesnt offer a VerticalContentAlignment dependency property. when using DisplayM...

How do you implement Localization in Windows Presentation Foundation (WPF)?

Please share you experiences regarding how you localized your WPF applications to support multiple languages and any resources that helped you in it? Thanks for your feedbacks. ...

How to set focus in WPF page reload?

I've got a WPF browser-like application with a few pages. When I switch between pages, I'd like to set the keyboard focus. When a page is loaded the first time, this works by calling Control.Focus() in the constructor. But when I switch between pages this does not work anymore - the focus is just on the first field, and ignores my atte...

Transfer Dependency Property value of a UserControl to a Control inside it

I have a UserControl (Composite control) that can be shown as the following pseudo XAML code: <UserControl> <DockPanel> <TextBox /> <Button /> </DockPanel> </UserControl> I use this custom control in a bunch of places and style some of them with a WPF Style. This style sets the Background property of the UserControl to a c...

How to embed a png in an Adobe Illustrator or Expression Design file to create XAML

I have an AI file. I paste it into Expression Blend and then export the XAML for use in my WPF project. Works for most of my files, but some export the XAML plus a seperate png file. What can I do so that the png is embedded into the paths of my image and not a seperate image? Can it be done? ...

What's the difference between a schema namespace and an assembly reference in WPF?

Why is it that there are two kinds of references in xaml. One looks like this: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" But mine look like this: xmlns:WPFToolKit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit" Why can't I do this: xmlns:local="http://myschema.mydomain.com/MyControlNamespace Thanks t...

What's the best approach to printing/reporting from WPF?

I have an upcoming project which will have to be able to print simple reports from its data. It'll be WPF-based, and I'm wondering which way to go. I know that WPF introduces its own printing technology (based on XPS) which looks quite easy to use. However, part of me wonders whether it would just be easier to use the ReportViewer contr...

WPF - Managed BitmapEffect

Is there a way to write a BitmapEffect in 100% Managed Code? I know that it would run a lot slower than using unmanaged code, but I'd like to write a BitmapEffect but its been a long time since I've done any C++ programing, plus the application might have to run in partial trust (so unmanaged code won't be permissible). The effect is goi...

In a WPF ListBox with more than 1000 Image Items the Zoom Images become slow

I met a problem when deveoping a photo viewer application. I use ListBox to Show Images, which is contained in a ObservableCollection. I bind the ListBox's ItemsSource to the ObservableCollection. <DataTemplate DataType="{x:Type modeldata:ImageInfo}"> <Image Margin="6" Source="{Binding Thumbnail}" ...

WPF -- Where do you draw the line between code and XAML?

I'm a long-time C#/.NET programmer but totally new to WPF and the System.Windows.Controls namespace and XAML. The more I learn about it the more I realize that you can do pretty much all of your GUI initialization and event handling glue in either XAML or in code (say C# code or VB.Net code). My question is to those who have been wo...

Prevent user from resizing columns with WPF ListView

hi there, i wonder how i can prevent a user from resizing GridViewColumns withing a WPF ListView control as google doesn't came up wit a solution. probably one of the wpf guru's over here ;) ...

WPF quickstart documentation

I am totally new to WPF and looking for good quickstart documentation to start with. I will buy the book WPF Unleashed from Adam Nathan, but thats more a reference than a quickstart i think. I just want you to tell me your favorite links and books and maybe demo applications concerning wpf development. Focus of answers should be on be...

What design patterns have you used in your WPF efforts and which do you like?

I have been looking at the Model-View-ViewModel pattern that is suggested by several people out there (especially John Gossman, take a look at this post and this podcast), but what other patterns (if any) have people used and liked ... and where do they add value? I have also stumbled across: Model-View-ViewModel Presentation Model Da...

How to make Silverlight control invisible to mouse actions

How can I get a UIElement to ignore mouse clicks on it and pass it through to the control behind it? I have a 50% transparent UIElement which covers another element. When I attempt to click on the background element, the mouse click is captured by the foreground semi-transparent UIElement. ...

WPF ComboBox doesn't stay open when used in a Task Pane

I have a strange bug with WPF Interop and an Excel Addin. I'm using .Net 3.5 SP1. I'm using Add-in Express to create a Custom Task Pane for Excel 2003. Within that taskpane I'm using ElementHost to host a WPF UserControl. The UserControl simply contains a Grid with a TextBox and ComboBox. My problem is that whilst everything displays pr...

WPF DocumentViewer Find-function and FixedPage documents

Hi there, .Net contains a nice control called DocumentViewer. it also offers a subcontrol for finding text in the loaded document (that's at least what it is supposed to do). When inserting FixedPage's objects as document source for the DocumentViewer, the find-functionality just does not find anything. Not even single letters. I haven...

What are the BEST resources for learning WPF & .NET?

I'm a longtime C/C++ Unix guy. I recently started work in a new position that's gonna eventually require C# and WPF (and probably some LINQ). What are the best resources to quickly come up to speed on all these Microsoft technologies? Years ago I read Petzold's book and loved it because it was so complete and by the end I really felt lik...

Selecting a node in virtualized TreeView with WPF

Is there a way to select manually a node in virtualizing TreeView and then bring it into view? The data model I'm using with my TreeView is implemented based on the VM-M-V model. Each TreeViewItem's IsSelected property is binded to a corresponing property in ViewModel. I've also created a listener for TreeView's ItemSelected event where...

How do I determine an image loaded successfully from a URI in Silverlight 2.0 (RC0)?

In the following code below: Image img = new Image(); img.Source = new BitmapImage(new Uri("http://someURL/somefilename.jpg", UriKind.Absolute)); how can I determine if the image successfully loaded (when there's a valid URI)? i.e., The URI is a valid format, but the file may not exist. ...

WPF Routed Events Across Element Tree Branches

I am wondering what the correct mechanism to enable communication between controls in WPF is. My goal is to not use conventional events and have to manually wire them up. The default behavior of routed commands (tunneling, bubbling) seems to be along the right lines but I guess I'm missing something. Routed events are a new infrastr...