wpf

Is anyone really using ThumbnailAttribute for Toolbox icons?

I was putting finishing touches on a new WPF/Silverlight custom control and decided that this time I would go with .NET 3.5 SP1 requirement (for WPF version). So, I decided to go with recommended new way of setting toolbox icon/image with ThumbnailAttribute. After spending some time on it I couldn't make it work and turned for help to Go...

WPF with an Asp.Net MVC Background

As an Asp.Net MVC developer, what is the best starting point to dive into WPF? ...

how to preload images in a background thread?

In my WPF app i need to load some images. I only need to display one image at a time. If i load the image when it's needed, there is a slightly delay. So i thought to myself: "Hey, why not do some preloading in a background thread? Can't be that hard." I have some experience with threads, but not enough to know that this thought was wron...

How to change textbox focus color?

How to change textbox focus color? I am using diffrent colored textboxes. Example dark violet, but keyboard focus is black. This is bad combination. How i can change textbox focus to gain more visual contrast? ...

Bi-directional view model syncing with "live" collections and properties (MVVM)

I am getting my knickers in a twist recently about View Models (VM). Just like this guy I have come to the conclusion that the collections I need to expose on my VM typically contain a different type to the collections exposed on my business objects. Hence there must be a bi-directional mapping or transformation between these two types...

1 Link To Learn WPF

Which link would you give me to learn WPF from scratch? ...

WPF Setting the default style on a TextBlock overrides the style for a Label

Setting the default style on a TextBlock causes the style in the Label and other controls to be set as well. This only happens if you put the styles in the Application resources, when I place the style in the Window resources everything is fine. I have also found that the VS 2008 Designer and XamlPadX display the Label as you would expe...

WPF: Change background color of border on left mouse button down

DON'T BE SCARED OFF, THE QUESTION IS SIMPLE! Below is a style I use for buttons in my application. Now I'm trying to change the background color of the Border element that has the name "Background" when the user clicks the button with the left mouse button. How do I do that? <Style TargetType="{x:Type Button}"> <Setter Property="T...

Is is possible to host Silverlight widgets from a WPF app?

If I wanted to create some Silverlight widgets and host them within WPF is this possible? I've searched for examples & found a few concepts online but no approaches that actually panned out / work / and a bunch of dead links. Has anyone successfully done this or any ideas for how to do this? Any help is appreciated. ...

WPF window hosting usercontrol

Hi, I have a usercontrol that I use to edit some objects in my application. I have recently come to an instance where I want to pop up a new dialog (window) which will host this usercontrol. How do I instantiate the new window and pass any properties that need to be set from the window to the usercontrol? Thanks for your time. ...

WPF: How should I organize my code amongst the source files?

I see a Window1.xaml and its associated .cs file, which are the main window. Then there's also app.xaml and app.xaml.cs. First, what is the point of App? It seems to be empty. I'm assuming I should put local variables to the Window on its cs file, and variables related to the whole program on App? ...

How to center an element in wpf canvas

How can I center an element in wpf canvas using attached properties. Please help. ...

Custom RichTextBox and Text Property Binding

I have created a custom RichTextBox control and exposed a Text property. The Text property is defined as follows: public string Text { get { return new TextRange(Document.ContentStart, Document.ContentEnd).Text; } set { AppendText(valu...

Video preview in C#

I have a webcam capture app and I'm trying to implement a video preview in my WPF UI. Capturing happens in a C++ DLL. I have a current solution but I'm not too happy with it. The main goal is that the video preview in the UI doesn't interfere with the C++ DLL much, as it has to compress the video frames and write them to disk. I won'...

Validating Telerik editable GridView row.

Hi, I'm using an Telerik RadGridView in a WPF application, which has two editable columns - Quantity and Cost. I have created a model for displaying this data in the grid. e.g :: [HasSelfValidation] class Item { public int Quantity{get;set;} public decimal Cost{get;set;} [SelfValidation] public void ValidateQu...

WPF - print the contents of a frame

I have a WPF window that contains a frame that displays varions WPF pages. Is it possible to print the contents of that frame? If so, what are the objects I should be looking at? ...

Passing more than 1 argument to a converter

Question: How can you pass an instance of an object from the view model to a converter along with the value to be converted to a converter? Info: I'm working on an inventory program for people on our factory floor who receive incoming shipments. While receiving a shipment they will mark down who the shipping company was and who the dr...

Designing an architecture in a technology where expertise is lacking.

At my company we are undertaking a large task of creating a new software architecture for our products. Our current architecture has been in use for many product iterations and lasted a long life and it is time for it to retire. The UI architecture is currently implemented in WTL/ATL 3.0 and COM. We have just completed the design of t...

Why wont my inner control center in my ItemsControl?

<Window x:Class="Shell" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.codeplex.com/CompositeWPF" xmlns:System="clr-namespace:System;assembly=mscorlib" Title="Referee" MaxWidth="800" MaxHeight="600" > <W...

Changing UserControl background based on SelectedValue from combobox

What I try to do: I have a list of person profiles in the background that I use with my combobox. The trigger is to change the background based on the gender of the person (bool Role.IsFemale). When I handle the SelectionChangedEvent in the code, I can see the Selectedvalue is true or false. I could now change the background directly or ...