[IronPython] Silverlight code need help (Repost)
Andrew Evans
andrew.canit at gmail.com
Tue Jan 12 02:50:50 CET 2010
Hello again
You must be getting sick of me :-P j/k
Ok I have a simple video player setup ultimately I would like to connect it
to a Database. I am writing the database code but I am unsure how to $_GET a
value in IronPython. Although I will be honest and haven't done to much
research as of yet ;-) that will begin tonight.
But if you have any advice on passing values to IronPython that would be
greatly appreciated
On Mon, Jan 11, 2010 at 2:32 PM, Jimmy Schementi <
Jimmy.Schementi at microsoft.com> wrote:
> And to answer your initial question about images in buttons, here's how to
> do it:
>
> from System.Windows.Controls import Button, Image
> from System.Windows.Media.Imaging import BitmapImage
>
> btn = Button(
> Width = 25,
> Height = 20,
> Content = Image(
> Source = BitmapImage(Uri("images/stop.jpg", UriKind.Relative))
> )
> )
>
> This assumes that "images/stop.jpg" is relative to the XAP file of your
> application. To add an image to a System.Windows.Controls.Button, you must
> use System.Windows.Controls.Image. The Image control then lets you set its
> Source, which is where System.Windows.Media.Imaging.BitmapImage comes into
> play. Confusing, I know =(
>
> This syntax uses IronPython's ability to use Python's named parameters to
> set properties; it makes working with Silverlight and WPF objects a lot less
> painful. Not using named parameters would look like this:
>
> btn = Button()
> btn.Width = 25
> btn.Height = 20
> img = Image()
> img.Source = BitmapImage(Uri("images/stop.jpg", UriKind.Relative))
> btn.Content = img
>
> Oy =P
>
> Let me know if you have any other Silverlight questions,
> ~Jimmy
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100111/9d4464a9/attachment.html>
More information about the Ironpython-users
mailing list