what's wrong with the DocumentViewer's Find method ?
I open one XPS document with the control DocumentViewer, invoking the control's Find method which would pop up find dialog on the MSDN specification, but nothing to happen. Why?
I open one XPS document with the control DocumentViewer, invoking the control's Find method which would pop up find dialog on the MSDN specification, but nothing to happen. Why?
Hi Beam,
Sorry I didn't respond earlier, I didn't see this posting until now.
Do you have a custom template for your DocumentViewer? There isn't actually a dialog for showing the Find UI, it's a Control that gets loaded into the main UI at run-time.
Here's what happens:
After a Template (aka Style) has been applied, it looks for a ContentControl that has the Name set to "PART_FindToolBarHost". If it is found, the FindUI is inserted into that. At that point, your find invokations should work. If the ContentControl isn't found, the Find code is not enabled.
If you are not using a custom template, can you post a code snippet that shows how you are trying to invoke Find?
thanks,
heather
_
This posting is provided "AS IS" with no warranties, and confers no rights.
So does that mean the document viewer with custom template cannot execute Find command? If not, whats the alternative?
No -- a custom template can have Find support, as long as it contains a ContentHost element with Name="PART_FindToolBarHost". The Find toolbar will appear inside of this ContentHost. There are no public APIs for Find in DocumentViewer, so the only means to expose Find UI in a custom template is through this method.
Hope that helps,
Josh