Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Form_Load equivalent from C#.Silverlight

Form_Load equivalent from C#.Silverlight

Scheduled Pinned Locked Moved WPF
csharpdesignhelpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wizshrutz
    wrote on last edited by
    #1

    This may sound a bit Armature but here it is. What is the Form_load equivalent for a C#-Silverlight. I have to Add shapes based on the available data. 1. I tried Putting the code in the MainPage() that does not work as the canvas actual height is NAN. 2. UserControl_Load() doesn't Work too. I have to add any number of shapes so I can't add add them on design time. Please Help Thanks

    A D 2 Replies Last reply
    0
    • W wizshrutz

      This may sound a bit Armature but here it is. What is the Form_load equivalent for a C#-Silverlight. I have to Add shapes based on the available data. 1. I tried Putting the code in the MainPage() that does not work as the canvas actual height is NAN. 2. UserControl_Load() doesn't Work too. I have to add any number of shapes so I can't add add them on design time. Please Help Thanks

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      Application.Startup[^] is the standard starting point in an SL application. In any case, http://jbarkes.wordpress.com/2010/01/03/drawing-dynamic-shapes-in-silverlight-3/[^] might help you.

      WP7.5 Apps - XKCD | Calvin | SMBC | Sound Meter | Speed Dial

      1 Reply Last reply
      0
      • W wizshrutz

        This may sound a bit Armature but here it is. What is the Form_load equivalent for a C#-Silverlight. I have to Add shapes based on the available data. 1. I tried Putting the code in the MainPage() that does not work as the canvas actual height is NAN. 2. UserControl_Load() doesn't Work too. I have to add any number of shapes so I can't add add them on design time. Please Help Thanks

        D Offline
        D Offline
        dbaseman
        wrote on last edited by
        #3

        It's the "Loaded" event.

        void MyUserControl_Loaded(object sender, RoutedEventArgs e)
        {
        }

        To set up the event handler, you can use

        this.Loaded += MyUserControl_Loaded

        in code behind, or

        Loaded="MyUserControl_Loaded"

        in XAML

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups