I ended up hacking it a bit...

I wanted to bind the values for the clip (as you can move the item around the 
screen) - i.e. it's a magnifying glass for an image...

You can't do this though:

<Canvas.Clip>
                <RectangleGeometry Rect="{Binding MyRect}"/>
Where myrect is a Rect object from the ViewModel...

I ended up doing this in c# -

Private Sub doClip()
        Dim avmb As AnnotationViewModelBase = CType(DataContext, 
AnnotationViewModelBase)
        Dim r As New Rect(0, 0, avmb.ConfiguredWidth, avmb.ConfiguredHeight)
        Dim rect As New RectangleGeometry()
        rect.Rect = r
        LayoutRoot.Clip = rect

avmb.ConfiguredWidth is from the ViewModel and changes as the drags happen... 
I'm not happy with this solution so if anyone can tell me how to bind to that 
Clip stuff...




From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of .net noobie
Sent: Friday, 19 September 2008 3:14 PM
To: listserver@ozsilverlight.com
Subject: Re: [OzSilverlight] Canvas Overflow

Could you used a "ScrollViewer", might not be exactly what you after, but might 
be able to stop your canvas from going bigger than you wanted?


On Fri, Sep 19, 2008 at 1:27 PM, Jordan Knight <[EMAIL PROTECTED]<mailto:[EMAIL 
PROTECTED]>> wrote:

Hi all,



I can't for the life of me figure out how to stop elements in a canvas from 
overflowing :)



I want to truncate content when is too big :)



Cheers,



Jordan
------------------------------------------------------------------- 
OzSilverlight.com - to unsubscribe from this list, send a message back to the 
list with 'unsubscribe' as the subject.
Powered by mailenable.com<http://mailenable.com> - List managed by 
www.readify.net<http://www.readify.net>



--
.net noobie(tm)
------------------------------------------------------------------- 
OzSilverlight.com - to unsubscribe from this list, send a message back to the 
list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net



------------------------------------------------------------------- 
OzSilverlight.com - to unsubscribe from this list, send a message back to the 
list with 'unsubscribe' as the subject.

Powered by mailenable.com - List managed by www.readify.net

Reply via email to