Пример #1
0
        protected override System.Windows.Size MeasureOverride(System.Windows.Size constraint)
        {
            var uiSize = new System.Windows.Size();

            if (TargetElement != null)
            {
                TargetElement.Dispatcher.Invoke(DispatcherPriority.Normal,
                                                new Action(() => TargetElement.Measure(constraint)));
                uiSize = TargetElement.DesiredSize;
            }

            return(uiSize);
        }