Silverlight multi-page with browser back/forwards - silverlight

I can present multiple pages in Silverlight using
Content = new DetailsPage();
However is this can be confusing to a user who may not even know the page is in Silverlight and would be expecting to hit the back button on the browser.
Obviously I can add my own buttons but this doesn't seem right.
How can I allow "normal" browser navigation using the back/forwards button?

In Silverlight 2, you can still handle navigation. It's just a more manual process.
Call
HtmlPage.Window.NavigateToBookmark("blah");
to add the "#blah" to the end of the URL.
Call
string bookmark = HtmlPage.Window.CurrentBookmark;
to find out where you currently are. People are also tying into jquery/Asp.net AJAX libraries to use their navigation support.
In Silverlight 3, you can use the Navigation Framework to do some of this automatically. File->New Project->Silverlight Navigation Project.

You should really formulate a question.
I'll assume that you want to know how to achieve multi-page navigation with browser back-button support.
There one simple answer, which is to use Silverlight 3 where it is supported out of the box, as well as in-app navigation using the address bar.
Release date is set for july 10, so there's not much longer to wait.
Be careful, you cannot at the moment install both Silverlight 2 and 3 on one machine, and there is no end-user plugin available (only developper runtimes, to install manually).

Related

Reuse model and store from ExtJS in Sencha Touch

I already have an ExtJS app but now I'm trying to build a mobile version with Sencha Touch. I want the browser to detect if it's running on mobile or not. That works fine, but what is my next step?
I have it redirected to a /mobile folder with a new index.html and that works fine until I try to reach classes from a parent class.
Is it possible to load the mobile app.js instead of the extjs app.js in the primary index.html?
I don't think you will be able to get away with having just one application. Ultimately you would need to create two different apps - one using ExtJs framework, another using Sencha Touch.
Whether you will be able to share some code is a good question. I think you should be able to share models, but that's about it. And even though - I would not recommend doing that either. Because even if show similar information from the same back end in both full and mobile version of your application, you might not need all of it in the mobile application. And if you don't need all of it - your models will be different.

Silverlight Notification API in-browser

I'd like to use the Notification API to create toast notifications for a Silverlight app designed to run both in and out of the browser, but the NotificationWindow class is only available OOB.
Does there exist anything that can replicate the behaviour inside the app? My idea is to have a container in the bottom right of the screen overlaying all other content. Then, create a wrapper which detects OOB-mode, passing params to the Notification API if possible, or populating and showing my own container if not. Is there anything that does this available?
It seems strange that MS chose not to implement something like this, as has been pointed out before.
Displaying a notification in browser is simple. You just need to use a popup and make it appear in the right place. See the following post as an example.
Now the difference with that approach is that the notification will show inside the browser. In OOB it shows outside the window and it's visible even if the windows is minimized. Due to security reasons it's not possible to directly do this.
Out of interest, Chrome Applications like Tweetdeck and Gmail, are able to display notifications outside of the browser. I think this might be a possiblity, but not exactly a Silverlight and cross browser solution.

Silverlight navigation problems under IIS

I’m totally confused.
I’ve hosted my app under IIS on my machine (windows 7). If then I open IE and enter "http://localhost/MyApp.aspx#SomePage" it will really open the app and then navigate to that “SomePage” page. If then I’ll navigate to another page, address bar updates accordingly (i. e. "http://localhost/MyApp.aspx#SomeOtherPage"). So everything is fine.
But if I enter in browser "http://mypcnetworkname/MyApp.aspx#SomePage" it simply opens my app with the default page and doesn’t navigate to SomePage. If then I'll navigate to another page, address bar also doesn’t update. Navigating through screens doesn’t update nor history frame not address bar and vice verca — looks like browser navigation is disconnected from silverlight navigation (but I’m still able to navigate through application using hyperlinkbuttons in it).
What can I do to make it work? I guess it’s more iis configuration problem (however everything is default, except mime type for silverlight) than related to silverlight.
P. S. It’s an silverlight 4 app but I do have silverlight 5 installed on my machine.
one way to get around this would be use asp.net to write SomeOtherPage to the launch paramters of the html object.
You then can parse these values when you launch the application and make the switch your self in silverlight
heres a link on passing paramerters: Link

How get XAP name from Silverlight application with MEF?

I am writing Silverlight 4 application with Navigation framework and MEF.
In my application each menu for navigation must load on MEF project and show it.
But there are some problems. First of all I can't navigate to page of other XAP(see David Polls post). To do that I need DynamicNavigation.dll and must create extra pages, which is not acceptable in my case. Other soluction can be found on davidezordan.net. This version is looks much better.
Second problem for me is that example works great if there is on additional XAP, but if I load 2 or more XAPs(by clicking on menus for navigation), I can't decide which page to show.
If 2 XAPs are loaded MEFModuleList contains 2 pages and I can't get any information about them to decide which page to show.
One solution is to hard code XAP name of each project in pages, which will be loaded to MEFModuleList by Attribute or other way, but it is not good solution.
Is there any other way to solve this problem?

Is there a "Browser Control" to host a website inside Flash/Silverlight?

I'm looking for something similar to the VB6 / .Net Winforms "Browser Control", that let's you show a browser inside your application.
I don't want to just render a page, I want it to be a fully-functional browser, in which people can click links, will run Javascript, etc.
In essence, what I want is an IFrame, only that it runs inside a Flash app, or a Silverlight app.
The ultimate reason for this is that I want to defeat IFrame busters. I'm making a web app that lets you see other sites inside of it, and I'm running into a bunch of sites that have this code:
var t=top.location,w=window.location;if(t!=w) t.replace(w);
(that's from eBay BTW)
which essentially pops the user out of my site and into theirs.
My hope is that by using a "browser control" of some sort, inside a plugin sandbox, "top", will be top for that browser control, and not for my site.
Of course, if you have any other ideas to achieve the same, they'll be more than welcome.
Edit: I've tried the Component One control suggested by Bill, but it didn't work for these purposes, because it's creating an IFrame outside of the SilverLight control, so it executes in the same context as the page hosting Silverlight, which is what I'm trying to avoid.
Northcode SWF Studio allows you to add browser window on the stage in Flash. I personally use SWF Studio as a third party SWF2EXE tool to extend the power of Flash projectors. It's quite stable and powerful. As far as browser control is concerned here is the example you can download and test if it serves your purpose. Check the Browser APT here.
We've not built a component to enable folks to do this but we're open to suggestions here. That being said, easiest solution is an iFrame, but word of caution in that when you overlay an iFrame over the the top of Silverlight we've seen customers experience perf issues as a result (mostly due to alpha transparency of the iframe etc).
This isn't isolated to Silverlight, Flash suffers the same issue as it has to do with browsers and rendering within the given operating system.
HTH.
Scott Barnes / Rich Platforms Product Manager / Microsoft.
I use the HTML control created by Component One. It has the limitation that the Silverlight object in the page should be set to windowless, but otherwise it works very well.
It's an old post but I'll add my tupence answer. I used the DivElements free control for Silverlight link text and it works quite nicely. It just positions the div accurately so that it looks like it's on top.
As for the other such controls, you've got to set the windowless property of the Silverlight container to true.
It works really well for me and I'm able to seemlessly have Google maps and the Acrobat plugin displayed side by side with my Silverlight application.
PS: because the component just adds a <div> to the page, you can't do stuff like having it load dynamically Javascript file like in the <header> tag.
PPS: when setting the HTML code "by hand", be sure to hook up on the DocumentReady or Loaded event before playing with the HTML DOM.
Hope that helps someone.

Resources