ArtemisComm.Proxy.UI.SQLLogger.Extensions.UIThreadGetValue C# (CSharp) 메소드

UIThreadGetValue() 개인적인 메소드

private UIThreadGetValue ( this me, DependencyProperty dp ) : object
me this
dp System.Windows.DependencyProperty
리턴 object
        public static object UIThreadGetValue(this DependencyObject me, DependencyProperty dp)
        {
            object retVal = null;
            if (me != null)
            {
                if (Application.Current.Dispatcher != System.Windows.Threading.Dispatcher.CurrentDispatcher)
                {
                    retVal = Application.Current.Dispatcher.Invoke(
                        new Func<DependencyProperty, object>(me.GetValue), dp);

                }
                else
                {
                    retVal = me.GetValue(dp);

                }
            }
            else
            {
                retVal = null;
            }
            return retVal;

        }