none
[WPF] When UserControl import other UserControl in Paragraph(xaml), How to hide imported UserControl's FlowDocumentScrollView? RRS feed

  • 질문

  • Hi, I need your help:)

    When UserControl import other UserControl in (xaml - FlowDocument - Table - TableCell -) Paragraph,

    I have two FlowDocumentScrollView.

     How to hide imported UserControl's FlowDocumentScrollView?

    So, I do other UserControl's  FlowDocumentScrollView VerticalScrollBarVisibility="auto".

    but I need to change Paragraph's height in parent UserControl.

    when printing, it don't fit in one page. It become two page. And don't divided Table.

    In common, Page's end cut Table, but All table move to next page.

    Maybe, because UserControl is in Paragraph.

    Also, ScrollViewer.VerticalScrollBarVisibility="Hidden" is don't work in parent UserControl.

    I think it don't work FlowDocumentScrollView.

    So, To Print Table(imported UserControl) in one page,

    I have to access FlowDocumentScrollView's property in parent UserCotrol,

     and change imported UserCotrol's size rate in parent UserControl.

    ( But without parent UserControl's FlowDocumentScrollView zoom, I work all parent UserControl. I don't want that.)

    Please let me know how to hide imported UserControl's Scroll, and not to omit imported UserControl but one page(so need to change view rate).


     

    2011년 10월 7일 금요일 오전 11:07

답변

  • Hi,

    Thanks for posting here.

    Visual Tree

     

    1.       How to hide imported UserControl's FlowDocumentScrollView?

     

        UserControl1.XAML

         <FlowDocumentScrollViewer x:Name="FlowDocumentScrollViewer1"

     

               UserControl1.XAML.CS

               public void HideFlowDocument()
         {
             FlowDocumentScrollViewer1.Visibility = Visibility.Hidden;
         }
     
         public void ShowFlowDocument()
         {
             FlowDocumentScrollViewer1.Visibility = Visibility.Visible;
         }
     
     

               UserCotnrol2.XAML

              <local:UserControl1 x:Name="importedUserControl" />

     

              UserControl2.XAML.CS

        private void HideChildUserControl()
        {
            importedUserControl.HideFlowDocument();
        }

     

     

    2.       let me know how to hide imported UserControl's Scroll

     

    I try to see imported UserControl’s scroll but can’t see it

     

     

    3.       change imported User Control’s view rate

    UserControl1.XAML

          <FlowDocumentScrollViewer x:Name="FlowDocumentScrollViewer1"

     

    UserControl1.XAML.CS

     public void DecreaseZoom()

     {

               FlowDocumentScrollViewer1.DecreaseZoom();
           }
     
           public void IncreaseZoom()        
           {
               FlowDocumentScrollViewer1.IncreaseZoom();
           }

     

     

    UserControl2.XAML

          <local:UserControl1 x:Name="importedUserControl" />

     

                  UserControl2.XAML.CS
                       
           private void DecreaseZoom()
          {
              importedUserControl.DecreaseZoom();
          }

     

    Regards,

    Forum Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • 답변으로 표시됨 YoungMin Shin 2011년 10월 11일 화요일 오후 6:47
    2011년 10월 10일 월요일 오전 1:41
    중재자

모든 응답

  • Hi,

    Thanks for posting here.

    Visual Tree

     

    1.       How to hide imported UserControl's FlowDocumentScrollView?

     

        UserControl1.XAML

         <FlowDocumentScrollViewer x:Name="FlowDocumentScrollViewer1"

     

               UserControl1.XAML.CS

               public void HideFlowDocument()
         {
             FlowDocumentScrollViewer1.Visibility = Visibility.Hidden;
         }
     
         public void ShowFlowDocument()
         {
             FlowDocumentScrollViewer1.Visibility = Visibility.Visible;
         }
     
     

               UserCotnrol2.XAML

              <local:UserControl1 x:Name="importedUserControl" />

     

              UserControl2.XAML.CS

        private void HideChildUserControl()
        {
            importedUserControl.HideFlowDocument();
        }

     

     

    2.       let me know how to hide imported UserControl's Scroll

     

    I try to see imported UserControl’s scroll but can’t see it

     

     

    3.       change imported User Control’s view rate

    UserControl1.XAML

          <FlowDocumentScrollViewer x:Name="FlowDocumentScrollViewer1"

     

    UserControl1.XAML.CS

     public void DecreaseZoom()

     {

               FlowDocumentScrollViewer1.DecreaseZoom();
           }
     
           public void IncreaseZoom()        
           {
               FlowDocumentScrollViewer1.IncreaseZoom();
           }

     

     

    UserControl2.XAML

          <local:UserControl1 x:Name="importedUserControl" />

     

                  UserControl2.XAML.CS
                       
           private void DecreaseZoom()
          {
              importedUserControl.DecreaseZoom();
          }

     

    Regards,

    Forum Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • 답변으로 표시됨 YoungMin Shin 2011년 10월 11일 화요일 오후 6:47
    2011년 10월 10일 월요일 오전 1:41
    중재자
  • 2// When imported Usercontorl's height is longer than Parent Usercontol's height, u can see imported Usercontrol's Scroll.

    And I try to hide that scroll, i do imported Scroll's <FlowDocumentScrollView VerticalScrollBarVisibility="auto">.

    (auto hide scroll, when you see all Flowdocument in window.)

    In parent Usercontol, I change imported Usercontol height's value up enough to show all imported Usercontrol, so I hide scroll.

    2011년 10월 11일 화요일 오후 7:08