If you understood correctly that you say that when the control scrolls from the ViewPort application, then although the visible property remains valid, FrameworkElement.FindName ("") cannot find it.
I assume that you have worked through all the basics of re: Xaml scoping, etc. If you add controls dynamically, you are sure that you are coming from the correct parent element, etc. If so:
Using RedGates Reflector, we see that FrameWorkElement.FindName is implemented as follows:
public object FindName(string name) { return XcpImports.DependencyObject_FindName(this, name); }
XcpImports.DependencyObject_FindName is implemented as
[SecuritySafeCritical] internal static DependencyObject DependencyObject_FindName(DependencyObject referenceDO, string name) { int num; IntPtr ptr; CheckThread(); if (name == null) { throw new ArgumentNullException("name"); } uint hr = FindNameNative(JoltHelper.Context, (uint) name.Length, name, referenceDO.NativeObject, out num, out ptr); GC.KeepAlive(referenceDO); if ((hr != 0) && (hr != 0x80004005)) { throw Error.MarshalXresultAsException(hr); } return (DependencyObject) ConvertDO(ptr, num, true); }
So, if you do not encounter an exception, I think the most interesting line is probably:
uint hr = FindNameNative(JoltHelper.Context, (uint) name.Length, name, referenceDO.NativeObject, out num, out ptr);
What is included in the native code and is determined using the dll import in XcpImports:
[DllImport("agcore", EntryPoint="FindName", CharSet=CharSet.Unicode)] private static extern uint FindNameNative(IntPtr context, uint cString, [MarshalAs(UnmanagedType.LPWStr)] string name, IntPtr referenceObject, out int typeIndex, out IntPtr obj);
Not to be confused with Developers Express AgCore.
This article about ZdNet (circa 2007) by Ed Burnett:
http://www.zdnet.com/blog/burnette/dissecting-silverlight/297
Says that:
agcore.dll (2.2M installed) is the main ActiveX control that is responsible for rendering and Silverlight events, including audio and video decoding.
It also says that:
npctrl.dll (460K) is a wrapper for agcore.dll that makes it work inside Firefox.
So my first question. Is your problem consistent in every browser? Perhaps this is the shell for agcore.dll in some browser / version, which is the problem, and not the core technology (agcore.dll).