locked
what's wrong with the DocumentViewer's Find method ?

    Question

  • 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?

    Friday, December 23, 2005 6:15 AM

Answers

  • 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.

    Friday, February 24, 2006 11:56 PM

All replies

  • 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.

    Friday, February 24, 2006 11:56 PM
  • So does that mean the document viewer with custom template cannot execute Find command? If not, whats the alternative?

    Thursday, September 28, 2006 5:59 PM
  • 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

     

    Friday, September 29, 2006 8:38 PM
  • Is there anyway to style PART_FindToolbarHost?

     

    Thanks,

     

    Peter

    Friday, February 15, 2008 5:49 PM
  • Heather,

     

    When you say "inserted into that", what do you mean?  Somebody else suggested that If I created a "PART_FindToolBarHost" that had the same naming convention and element tree, that  it was possible.  Any ideas?

     

    Thanks in advance.

     

    Peter

    Friday, February 15, 2008 5:54 PM