Is it possible to use Zoom functionality of whole Silverlight application (CTRL+MouseWheel / zoom in browser) in Out of Browser mode?
Asked
Active
Viewed 653 times
2 Answers
0
You can use the following in your Application_Startup:
RootVisual = new WebBrowser() {Source = new Uri(Current.Host.Source, "../")};

Bernhard
- 195
- 1
- 11
0
Ok.. I have implemented this code for "Zoom In" and "Zoom Out" Button Click.
In Button Click Event :
commonwidth = commonwidth + (commonwidth * zoomPercent / 100) //For Zoom Out
commonwidth = commonwidth + (commonwidth * zoomPercent / 100) //For Zoom In
Then Call this Method :
Private Sub ChangZoom()
If Not fresult Is Nothing Then
If fresult.Count() > 0 Then
Dim mainFrame As StackPanel
mainFrame = fresult(_currentPage)
Dim docBorder As Border
docBorder = mainFrame.Children(1)
Dim docImage As FrameworkElement
docImage = docBorder.Child
If Not docImage Is Nothing Then
Dim actualWidth As Double
Dim actualHeight As Double
actualWidth = commonwidth 'Me.ActualWidth - 30
actualHeight = Me.ActualHeight
Dim newHeight As Double
newHeight = actualWidth * docImage.Height / docImage.Width
docImage.Width = actualWidth
docImage.Height = newHeight
RenderResutlFrame(_currentPage)
End If
End If
End If
End Sub
Public Property ImageUrl As String Implements IDocumentViewer.ImageUrl
Get
Return _imageUrl
End Get
Set(ByVal value As String)
_imageUrl = value
'Me.Dispatcher.BeginInvoke(AddressOf OnInitialized)
End Set
End Property

Bhavin
- 27,155
- 11
- 55
- 94

Jignesh.Raj
- 5,776
- 4
- 27
- 56