Improved wpf demo

Here is an improved version of the wpf demo.  The older posts build script still applies.

I need to attribute this site for giving me hints to go in the right direction.

import System

import System.Windows

import System.Windows.Controls

import System.Windows.Navigation

  

class Exer1(NavigationWindow):

            para as TextBlock

            button as Button

           

            def constructor():

                        para = TextBlock(Text:”Hello World!!!”, FontSize:36)

                        para.VerticalAlignment = VerticalAlignment.Center

                        para.HorizontalAlignment =HorizontalAlignment.Center  

                        # create a button


//<![CDATA[

//]]>
                        button = Button(Content:”Click Me”, Height:30, Width:100)

                        # display the textblock when the button is clicked

                        button.Click += NavButtonClick

                        # display the button first

                        Navigate(button)

                       

            protected def NavButtonClick(sender as object, e as RoutedEventArgs):

                        Navigate(para)

                                   

                       

[STAThread]

def Main():

            app = Application()        

            Exer1().Show()

            app.Run()

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s