/// <summary>
 ///     Translator for individual property
 /// </summary>
 private void ForegroundPropertyTranslator(object host, string propertyName, object value)
 {
     SWM.Brush brush = value as SWM.Brush;
     if (brush != null)
     {
         bool     defined;
         SD.Color wfColor = WindowsFormsHostPropertyMap.TranslateSolidOrGradientBrush(brush, out defined);
         if (defined)
         {
             WinFormsAdapter adapter = GetAdapter(host);
             if (adapter != null)
             {
                 adapter.ForeColor = wfColor;
             }
         }
     }
 }
        private void BackgroundPropertyTranslator(object host, string propertyName, object value)
        {
            SWM.Brush brush = value as SWM.Brush;

            if (value == null)
            {
                //If they passed null (not to be confused with "passed us a non-null non-Brush"),
                //we should look up our parent chain.
                DependencyObject parent = host as WindowsFormsHost;
                do
                {
                    brush  = (Brush)parent.GetValue(SWC.Control.BackgroundProperty);
                    parent = VisualTreeHelper.GetParent(parent);
                } while (parent != null && brush == null);
            }

            WinFormsAdapter adapter = GetAdapter(host);

            if (adapter != null && brush != null)
            {
                WindowsFormsHost windowsFormsHost = host as WindowsFormsHost;
                if (windowsFormsHost != null)
                {
                    SWF.Control child = windowsFormsHost.Child;

                    if (HostUtils.BrushIsSolidOpaque(brush))
                    {
                        bool     ignore;
                        SD.Color wfColor = WindowsFormsHostPropertyMap.TranslateSolidOrGradientBrush(brush, out ignore);
                        adapter.BackColor = wfColor;
                    }
                    else
                    {
                        SD.Bitmap backgroundImage = HostUtils.GetBitmapForWindowsFormsHost(windowsFormsHost, brush);
                        HostUtils.SetBackgroundImage(adapter, child, backgroundImage);
                    }
                }
            }
        }