Live Chat Icon For mobile
Live Chat Icon

How can I reflect via data binding the current Zoom value of a DocumentViewer in a TextBlock?

Platform: WPF| Category: DocumentViewer

This example shows how to reflect the ‘Zoom’ value of a DocumentViewer in a TextBlock.

[XAML]

<Window x:Class='SDKSample.Window1'
        xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
        xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height='*' />
      <RowDefinition Height='*' />
    </Grid.RowDefinitions>

    <DocumentViewer Name='dvZoomSource' Grid.Row='0' />

    <TextBlock  Grid.Row='1'
        Text='{Binding ElementName=dvZoomSource, Path=Zoom, Mode=OneWay}' />
  </Grid>
</Window>

Share with

Related FAQs

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

Please submit your question and answer.