tags:

views:

2048

answers:

4

I currently have a Silverlight canvas that exceeds the viewable area of the screen (I'm letting the users drag the viewable areas around to navigate). I'm trying to display a modal popup that always shows up in the middle of the viewable area, and I can't seem to find any property that tells me what currently is on the screen. Basically if the user has panned down to the bottom and clicks something that causes a modal popup to appear it is stuck at the far top of the screen.

Any ideas anyone?

Thanks ~Steve

+1  A: 

I don't think this is possible since the visibility isn't being surfaced. Perhaps with some fun JavaScript to figure out where the panning is?

Shawn Wildermuth
A: 

Quite true. I wound up creating a holding canvas, making that full screen, and putting everything else as a child canvas within that. The modal popup now comes up in the holding canvas.

A: 

What does this return???

App.Current.Host.Content.ActualHeight

App.Current.Host.Content.ActualWidth
Gabriel Guimarães
A: 

Gabriel Guimarães one works good.

App.Current.Host.Content.ActualHeight(and ActualWidth) does bring the browser size inside. Good for calculating position. And of course you can use LayoutUpdated on your main control to double check the sizes and resize stuff if need be.

TrueHarlequin