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. Make silverlight app on page a "singleton"

Make silverlight app on page a "singleton"

Scheduled Pinned Locked Moved WPF
htmlhelpquestion
8 Posts 4 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.
  • D Offline
    D Offline
    dbrenth
    wrote on last edited by
    #1

    So I have a silverlight app. The page can be referenced with arguments so when someone click on a link in another html page it starts up the silverlight app web page and works according to the arguments. The problem is that the link on the other html page can be clicked again and it will also start up the silverlight app in *another* web page and work according to the arguments. Basically I can have two or more of my silverlight app running. Is there a way to tell that second click that the silverlight app is already up and running and to accept these new arguments - without having to reset the entire silverlight app? I made it work where the existing app starts over again (it doesn't look good that way), but I just want the app to respond to the new arguments passed in by the link clicked on the html page. Is that even possible? Thanks

    Brent

    M P A 3 Replies Last reply
    0
    • D dbrenth

      So I have a silverlight app. The page can be referenced with arguments so when someone click on a link in another html page it starts up the silverlight app web page and works according to the arguments. The problem is that the link on the other html page can be clicked again and it will also start up the silverlight app in *another* web page and work according to the arguments. Basically I can have two or more of my silverlight app running. Is there a way to tell that second click that the silverlight app is already up and running and to accept these new arguments - without having to reset the entire silverlight app? I made it work where the existing app starts over again (it doesn't look good that way), but I just want the app to respond to the new arguments passed in by the link clicked on the html page. Is that even possible? Thanks

      Brent

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      As there is no method for an SL app to receive data from an aspx page (except the initial parameters) then I don't think this is possible. Caveat, I'm fairly new to SL so don't take this as a definitive answer.

      Never underestimate the power of human stupidity RAH

      A 1 Reply Last reply
      0
      • D dbrenth

        So I have a silverlight app. The page can be referenced with arguments so when someone click on a link in another html page it starts up the silverlight app web page and works according to the arguments. The problem is that the link on the other html page can be clicked again and it will also start up the silverlight app in *another* web page and work according to the arguments. Basically I can have two or more of my silverlight app running. Is there a way to tell that second click that the silverlight app is already up and running and to accept these new arguments - without having to reset the entire silverlight app? I made it work where the existing app starts over again (it doesn't look good that way), but I just want the app to respond to the new arguments passed in by the link clicked on the html page. Is that even possible? Thanks

        Brent

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        Would you want a browser plugin that could hijack the default behaviour of your browser? I wouldn't. If the app opens up in a new window, then how is this any different from having a hyperlink with a jump target on it? The SL runtime has to behave itself like any other browser component, so it has to respect the same airspace issues.

        I'm not a stalker, I just know things. Oh by the way, you're out of milk.

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        A 1 Reply Last reply
        0
        • D dbrenth

          So I have a silverlight app. The page can be referenced with arguments so when someone click on a link in another html page it starts up the silverlight app web page and works according to the arguments. The problem is that the link on the other html page can be clicked again and it will also start up the silverlight app in *another* web page and work according to the arguments. Basically I can have two or more of my silverlight app running. Is there a way to tell that second click that the silverlight app is already up and running and to accept these new arguments - without having to reset the entire silverlight app? I made it work where the existing app starts over again (it doesn't look good that way), but I just want the app to respond to the new arguments passed in by the link clicked on the html page. Is that even possible? Thanks

          Brent

          A Offline
          A Offline
          AspDotNetDev
          wrote on last edited by
          #4

          So, sounds like you want the first click to open the Silverlight application in a new window, but you want the second click of that same link to cause the Silverlight app to change in some way. If that is correct, then that should be doable. I'm pretty sure you can pass variables from one window to another window opened by that first window using JavaScript. I am also fairly certain that you can interact with a Silverlight control using JavaScript, even after the Silverlight control has been created. See here and here (note: I didn't read those fully, but they seem like what you are looking for).

          [WikiLeaks Cablegate Cables]

          D 1 Reply Last reply
          0
          • M Mycroft Holmes

            As there is no method for an SL app to receive data from an aspx page (except the initial parameters) then I don't think this is possible. Caveat, I'm fairly new to SL so don't take this as a definitive answer.

            Never underestimate the power of human stupidity RAH

            A Offline
            A Offline
            AspDotNetDev
            wrote on last edited by
            #5

            Mycroft Holmes wrote:

            there is no method for an SL app to receive data from an aspx page

            Pretty sure that's not correct. See my answer below.

            [WikiLeaks Cablegate Cables]

            M 1 Reply Last reply
            0
            • P Pete OHanlon

              Would you want a browser plugin that could hijack the default behaviour of your browser? I wouldn't. If the app opens up in a new window, then how is this any different from having a hyperlink with a jump target on it? The SL runtime has to behave itself like any other browser component, so it has to respect the same airspace issues.

              I'm not a stalker, I just know things. Oh by the way, you're out of milk.

              Forgive your enemies - it messes with their heads

              My blog | My articles | MoXAML PowerToys | Onyx

              A Offline
              A Offline
              AspDotNetDev
              wrote on last edited by
              #6

              Not sure what you mean by "hijack the default behavior". Seems to me the OP is just building a web application and would like to have the second click act differently than the first click. More specifically, the first click should open a new window and the second click should interact with that opened window. Sounds both reasonable and possible to me (see my answer below).

              [WikiLeaks Cablegate Cables]

              1 Reply Last reply
              0
              • A AspDotNetDev

                Mycroft Holmes wrote:

                there is no method for an SL app to receive data from an aspx page

                Pretty sure that's not correct. See my answer below.

                [WikiLeaks Cablegate Cables]

                M Offline
                M Offline
                Mycroft Holmes
                wrote on last edited by
                #7

                AspDotNetDev wrote:

                Pretty sure that's not correct

                Therefore the caveat, interesting looking article, it does imply there can be an interaction between the 2 spheres after the SL app is created.

                Never underestimate the power of human stupidity RAH

                1 Reply Last reply
                0
                • A AspDotNetDev

                  So, sounds like you want the first click to open the Silverlight application in a new window, but you want the second click of that same link to cause the Silverlight app to change in some way. If that is correct, then that should be doable. I'm pretty sure you can pass variables from one window to another window opened by that first window using JavaScript. I am also fairly certain that you can interact with a Silverlight control using JavaScript, even after the Silverlight control has been created. See here and here (note: I didn't read those fully, but they seem like what you are looking for).

                  [WikiLeaks Cablegate Cables]

                  D Offline
                  D Offline
                  dbrenth
                  wrote on last edited by
                  #8

                  Here's what I have tried. I created another silverlight "application" which is merely a control that looks like a hyperlink. Then I can use the LocalMessageSender to talk to my main app and also talk to the web page that my "control" app lives on. The only problem left is that typically when a page changes, the tab in the browser flashes or goes red (at least this is the behavior in IE). This doesn't happen here. The user has no clue that anything happened until he goes to the main silverlight app page and everything shifts. It appears that the main app doesn't run the Message Received event until AFTER the tab becomes active again.

                  Brent

                  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