TrakHound_UI.ImageBox.SetBackgroundColor C# (CSharp) Method

SetBackgroundColor() private method

private SetBackgroundColor ( ImageSource img ) : void
img ImageSource
return void
        void SetBackgroundColor(ImageSource img)
        {
            if (img != null)
            {
                img.Freeze();

                if (backgroundcolor_THREAD != null) backgroundcolor_THREAD.Abort();

                backgroundcolor_THREAD = new Thread(new ParameterizedThreadStart(SetBackgroundColor_Worker));
                backgroundcolor_THREAD.Start(img);
            }
        }

Usage Example

        private static void ImagePropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs eventArgs)
        {
            ImageBox imgBox = (ImageBox)dependencyObject;

            imgBox.SetBackgroundColor(eventArgs.NewValue as ImageSource);
        }