Live Chat Icon For mobile
Live Chat Icon

How can I extend the style of a DocumentViewer ?

Platform: WPF| Category: DocumentViewer

The following style uses the ‘BasedOn’ attribute to extend the default DocumentViewer style.


<Window x:Class='SDKSample.Window1'
      BasedOn='{StaticResource {x:Type DocumentViewer}}' 
      TargetType='{x:Type DocumentViewer}'>
      <Setter Property='Background'>
          <LinearGradientBrush StartPoint='0.5,0' EndPoint='0.5,1'>
            <GradientStop Offset='0.0' Color='#CC99CCFF' />
            <GradientStop Offset='1.0' Color='White' />
    <DocumentViewer  Style='{StaticResource MyDVStyleExtend}' Name='MyDocumentViewer'/>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.