How can I host a Windows Forms Composite Control in Windows Presentation Foundation ?

You can choose to keep your Windows Forms application primarily intact and migrate portions of your application to WPF where it makes sense. You can do this by identifying those areas of your application that are a good fit for WPF features and convert only those areas to WPF. For example, you may want to convert only a few of your forms to WPF and keep the rest of the application based on Windows Forms. Using this method, you could simply popup instances of WPF pages or windows from your Windows Forms application. Additionally, you may want to actually swap-out Windows Forms controls for WPF controls on a form resulting in a hybrid form when the controls co-exist in peaceful harmony.

How can I use Windows Forms in a WPF application ?

You can have a WPF application popup a Windows Form much in the same way that you can popup a WPF window from a Windows Forms application. Furthermore, you can place Windows Forms controls side-by-side with WPF controls on a WPF window or page-by-page using the WindowsFormsHost control that ships as part of the interoperability layer.

How can I style a Separator used as a Menu Item ?

Separator controls inside Menu elements appear differently from Separator controls outside a Menu. When you create a Menu with a Separator, the control automatically applies the Style identified by the SeparatorStyleKey property. Styles are placed in resource dictionaries and are searched for by their keys. To change the Style of a Separator inside a Menu, you must use the SeparatorStyleKey property to create your new Style. The following example demonstrates this. [XAML] <Style x:Key='{x:Static MenuItem.SeparatorStyleKey}’ TargetType=’Separator’> <Setter Property=’OverridesDefaultStyle’ Value=’true’ /> <Setter Property=’Template’> <Setter.Value> <ControlTemplate TargetType='{x:Type Separator}’> <Border Width=’30’ Height=’4′ Margin=’4′ Background=’Red’/> </ControlTemplate> </Setter.Value> </Setter> </Style>

How do I access / edit the metadata associated with an Image ?

The ‘BitmapMetaData’ class provides metadata information contained by the image. This metadata can be one metadata schema or a combination of different schemes. WPF inherently supports the following image schemas: ExchangableImageFile (Exif). PNG Textual Data. ImageFileDirectory (IFD). InternationalPressTelecommunicationsCouncil (IPTC). ExtensibleMarkupLanguage (XMP). [C#] Stream pngStream = new System.IO.FileStream(‘winter.png’, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite); PngBitmapDecoder pngDecoder = new PngBitmapDecoder(pngStream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); BitmapFrame pngFrame = pngDecoder.Frames[0]; InPlaceBitmapMetadataWriter pngInplace = pngFrame.CreateInPlaceBitmapMetadataWriter(); if (pngInplace.TrySave() == true) { pngInplace.SetQuery(‘/Text/Author’, ‘Me’); } pngStream.Close();