wpf-4

Forcing initialization of a HwndHost

In my WPF application, I host Win32 content using HwndHost. However, creating a HwndHost does not create the native window. Rather, this is done in the overridden BuildWindowCore() method which is called sometime later by WPF. My hosted content needs the window handle of the native window for its own initialization. Unfortunately, there...

Coerce a WPF TextBox not working anymore in .NET 4.0

In my WPF application I have a TextBox where the user can enter a percentage (as int, between 1 and 100). The Text property is databound to a property in a ViewModel, where I coerce the value to be in the given range in the setter. However, in .NET 3.5, the data is not shown properly in the UI after being coerced. In this post on MSDN, ...

wpf visibility problem

Default Visibility enum contains Collapsed Hidden Visible I need another one name NotCreatable. When set Visibility to Notcreatable, current Element must not created on view level. Because I have 2 class inherits from A public Class B:A { Property B1;} public Class C:A { Property C1;} my xaml <stackpanel DataContext="{Binding ob...

VistaBridge and Desktop window manager in WPF 4

I have started using WPF a short while back, and I'm in the progress of reading the book Pro WPF in C# 2008. Here they are using P/Invoke to "DmwApi.dll" to create Aero glass effect on windows, and they use the VistaBridge created by MS to create the new Task Dialog boxes. So basically what I'm curious about is if WPF 4 (that is not c...