Silverlight Navigation(PRISM) to show in Browser? - silverlight

I'm not even sure how to properly ask this question. I'm new to Silverlight and what I'm trying to accomplish is web application that can be referenced using hyperlinks in browser like so:
myapp.com/MaintainUser?UserKey=1
So, I already created modular app with PRISM and using their RegionManager.RequestNavigate and passing URL's here and there. Seems to be working. But browser does not reflect what I'm doing. URL always stays at
myapp.com
I'm not even sure if what I'm doing possible. And if it is, can you point me in correct direction? Or at least terminology.. I thought Navigation will take care of this.

What you are looking for is called deep linking and it's supported by the Silverlight runtime since version 3. However, you should not confuse this with Prism navigation, which is not integrated with the browser.
Here's an quick intro to the standard Silverlight navigation framework.

Related

angular typescript dock layout engine

I'm looking for dock layout engine for angularjs written in typescript. I found Dockspawn but it is written in DART and it's not compatible with the rest of my project. Does somebody know any dock layout engine (even paid ones) for angularjs in typescript?
I think your real problem is that dockspawn was abandoned. This is something I built at my company (which, sorry, we don't sell software)and it turns out that Angular is the worst thing you could use to build a layout engine like this.
Managing scope chains among components that are constantly changing positions, opening/closing, resizing, and floating is entirely too complicated for this type of project. You will end up with 15 step bug reports everywhere, and unless you have a perfect algorithm set in place before ever developing anything you will end up spending weeks re-writing code.
Solution (and not the one you want to hear): drop it. Web design is meant for developing pages within the browser, not for developing windows with tabs within your browser window which is full of tabs. The control and flexibility is very nice, but there is always a way to provide the user with just as much control by setting up panels on the page in the positions in which they will be consistently used the most.
Sooner or later someone will develop what you are looking for and release it, but it probably won't be in Angular and it's definitely going to cost money.
You should be able to use Dockspawn because at runtime DART is JavaScript, so as TypeScript. You just need to find a way to make TypeScript aware of Dockspawn and you can do that using a Type definition file.
The types definition file for Dockspawn is available online.
You can install this kind of files using a tool known as tsd. You can find a basic example here.

Use Glimpse on Sillverlight application?

Is it possible to use glimpse on an Silverlight app or is it made for ASP only?
I tried searching something on their page on how to set up Glimpse for SL-Projects, but haven't found anything yet.
So, I've been wondering if anyone has set up Glimpse correctly. Has anyone tried it yet and can tell us, how its working so far?
We haven't done anything specific for Silverlight. That said, if within your app, you are calling through to JS to make ajax calls, Glimpse will pick those up within the Ajax tab and if you are making calls to the server directly through the SL runtime, they will picked up in the history tab. So you should be able to get some pretty good information out.

CEF 3 workaround missing features

I'm building an application that is using CEF 3 (version 1650) in WPF (meaning I'm using OSR mode) using Xilium.CefGlue as a wrapper.
After a lot of research I've found several features I can't get to work nor workaround:
Focus Management - I need to tell when the last focusable item in the page lost focus due to a Tab press (or the first item due to Shift+Tab)
Javascript Alerts - I got them to work for standard schemes, but not for custom schemes (also found a bug regarding it). I'm looking for a way around it.
Favicons - Seems CEF3 did not implement favicon support. I guess I can look for favicon.ico in the root directory for standard schemes, but what about favicons linked in the HTML itself?
User Permission Notification - I only found permission request events for geolocation request, but I also need for other things such as getUserMedia. Any idea how?
Zoom - This one works except for getZoomLevel, that for some reason always returns zero. Does anyone knows why or how to get around it considering it does remember each page's last zoom?
Process Model - I can't get multiple browser windows opened manually (that is, not via javascript's openWindow) all with the same custom scheme to open in the same render process (already tried all different process model parameters I know of). As far as I understand, it should be possible. What am I missing?
Thank you in advance for your help.
Focus Management is it OnTakeFocus you are looking for?
Favicons has an open enhancement issue in the CEF project
For anyone who finds their way to this question, favicon support is now available in the official CEF builds.

Why does NavigationService on Silverlight/WP7 uses Strings over Classes?

Given that C# is a leans more towards a strongly typed language, why did the designers chose navigation based on URIs over Classes?
NavigationService.Navigate(new Uri("/MyPage.xaml", UriKind.Relative))
fails at run time if MyPage is missing.
If there were a method that support passing a PhoneApplicationPage as a argument like
NavigationService.Navigate(new MyPage());
Navigation related errors can be caught at compile time.
Why was this not an inherent design in Silverlight/WP7 ?
Only the WP7 dev tools team can say for sure, but absent their input, I'll give it my best shot. My guess is that it arises out of using a plug-in framework for client application development. Web Silverlight doesn't even really have the concept of navigation. You can switch frames in and out of the applications main frame, but that's not really navigation persay. So, when they were asked to use Silverlight as a client application tool for WP7, they had to decide how they were going to navigate around.
The most obvious way to solve the navigation problem, if you're a team that's been building internet applications, is to make something as close to the internet model as possible. This allows developers to carry internet applications to the browser and do minimal rewrites of their code. Think about it, if you had a web application that used relative URLs to move between application pages, your WP7 could reuse most of that navigation logic with only slight modifications to use the new NavigationService. This also minimizes the changes from core Silverlight that the WP7 version has to make, making everything easier to keep synchronized between platforms.
It obviously isn't the best way of doing things, and it makes state maintenance between pages a royal pain in the ass, but I can at least see why they decided to do it this way. The main flaws, in my experience, are the runtime checking of navigation destinations (instead of compile time with classes), passing parameters (every page needs an OnNavigatedTo that parses out variables) and maintenance of non-trivial objects between pages (I've taken to just using Singletons to hold relevant objects as a sort of poor-man's cache). I'm hoping for at least some modification to the navigation paradigm in 7.5 or 8, but I'm not holding my breath.
This navigation model was inherited from Silverlight on the desktop (and WPF before it). It's important to note: this is not a String-based model, but rather a URI-based model. The difference here is key: we're not talking about an arbitrary string to point to some XAML, we're talking about a universal locator for a resource that is a page within the application. By addressing navigation this way, your application actually has more than one entry point -- any URI within the application can be a valid entry point. And by making navigation URI-based, you ensure that the "state" of your application as it relates to what you're looking at can be serialized, accessed at any time from any direction, etc.
Imagine, for example, that you have a link on a webpage (or in an email, or anywhere else) that you want to open in your application. Click the link, and because the URI fully describes the resource that the application should display (e.g. an item in a catalog, filters on a search, etc.), you can jump straight to it (a.k.a. deep-linking). This isn't implemented on Windows Phone 7 (at least not from other apps, but it's really how the back button, etc. work), but the model comes straight from Silverlight on the desktop (the Navigation framework is in the Silverlight SDK), and you can see where they might take it on Windows Phone in the future.
Again, the power of the URI is its universality -- it is a common way to identify a resource. Without it, you're stuck with a tight coupling of anything that wants to navigate into your application and the application itself.
Silverlight/WP7 navigation service is fairly lacking in many regards, but there are a fair number of frameworks around that allow you to navigate to the ViewModel/View. Some examples:
Windows Phone MVP
Columbus
Xamling Core
In Caliburn Micro (MVVM framework) you have a nice way of handling navigation using only ViewModels - "Screens, Conductors and Composition"
Also keep in mind that using frames you can use routing in Silverlight to map one or more user-friendly URLs to the same .xaml file. If you would specify only the view class then Silverlight wouldn't know to which URL to map to.
Passing query parameters for state managment might be ugly, but it allows your application to be stateless which has some advantages (e.g. deep links) and fits the stateless nature of http web applications.

using silverlight for user interface only

I am planning to make a web application, using silverlight for frontend. requirement is: this frontend will be just an empty shell, and it must be language independent. it will get everything it needs to display and use from server, therefore making it language independent.
i tried to find tutorials, but there is nothing.
as far as i understand, silverlight uses xaml for all its data, so just generating it with whatever language i want shouldn't be a problem. but i don't have any silverlight experience or knowledge, so i'm not sure what is the best way to do this. for example, i don't know how will new content be generated, and what kind of structure silverlight requires.
can anyone give me some starting points?
Your requirements are rather demanding. If i can summarise:
silverlight will be the front end (or container)
you don't know what it will be showing
the content may be dynamically generated
everything, including the visual content, will be retrieved from the server
If i have misunderstood then by all means correct me or adjust your question.
Those requirements are not trivial, especially when you have no prior experience in Silverlight. Fetching data from the server is a normal behaviour in Silverlight, but fetching any generated UI content will be a slow and inefficient use of the technology platform. Silverlight is delivered via the browser, and runs on the client. If you are going to have generated UI, then you may want to consider using straight HTML instead (you can generate the contents using ASP.Net or a scripting language such as PHP). Alternatively, you can generate your required UI views from within the Silverlight app itself by either swapping in and out the appropriate pre-built piece of UI (or controls), programmatically adding new controls into the visual tree, or by loading XAML using the XamlReader class.
This answer may or may not help you much, but like i said before - put some more specific details into your question and you will get more specific answers (either add comments under your question, or post a new more specific question if you cannot edit your current one).
Edit: i have just come across this blog article from Jeff Prosise explaining the use of the INavigationContentLoader interface in Silverlight 4 to dynamically load pages from either remotely or locally. It is a detailed write-up, with a lot of code samples, it may be of use to you.
I would suggest you start at http://Silverlight.net
The "Learn" section has lots of videos that can get you started. http://www.silverlight.net/learn/

Resources