For more efficient to get the control pattern, change to use TryGetCurrentPattern instead of GetCurrentPropertyValue.