Multiple instances of Silverlight gallery - silverlight

I wanted to try was to make an asp website which would include pictures in multiple Silverlight galleries. The reason why I want to do this is that I want something in this fashion:
Text describing some places.
Gallery with several pictures that are relevant for the text.
Text describing some other places.
Gallery with several pictures that are relevant for the other places.
etc.
I managed to use the popular SlideShow2 (http://slideshow2.codeplex.com/) but I ran into problems with multiple instances of the Silverlight object. If I put two galleries on the page they work correctly, if I put more of them then two of them work (oddly for example first and third out of nine). Is there some Silverlight restriction for a size of objects you can load? Also - is it a reasonable approach to place the object there more times? I wonder if it is a big slowdown.
Anyway, what would you suggest to use for the described scheme? I don't necessarily require a slideshow of the pictures (though it would be nicer) but I would like the galleries to be in Silverlight.
EDIT - Slideshow2 link corrected

First off, make sure you're using the updated SlideShow2 (http://slideshow2.codeplex.com/). Your post mentioned the older SlideShow1.
This issue might be related to the order in which the browser is rendering the Silverlight object. Try instantiating the Silverlight object using the Javascript CreateObject function in Silverlight.js.
Remove all of the declarative objects as mentioned in Step 1 of the Quick Start Guide
Add the following script for each of your galleries:
.
document.write("<div id=\"silverlightControlHost\">");
Silverlight.createObject("http://PathToMyXAP/MyXap.xap", document.getElementById('silverlightControlHost'),"slPlugin",
{
//Enter XAP params here
},
{ onError: onSilverlightError }
);

If you find a Gallery using a later version of Silverlight, the performance might be greatly improved.

Related

How to add personal icons in Glade without polluting hierarchy

I've been looking for solutions for several weeks now, but I'm having a bit of trouble finding and understanding (in cases where I find documentation).
I'm currently developing an application for a school project. But I used a GtkToolPalette (https://developer.gnome.org/gtk3/stable/GtkToolPalette.html) so that the user can have icons to drag and drop into a drawing area. The problem is that first of all, these icons are very specific to what I want, so I can't find them in the icons that Glade/GTK3 already offers. Second, if I add all the icons one by one in Glade via the buttons on my GtkToolPalette it creates images each time (i.e. a lot) in the hierarchy of my objects, widgets and it completely pollutes my Glade workspace.
Is there a way to make all these additions cleanly. At the moment, I haven't found any method via glade. However, I finally found this https://developer.gnome.org/ThemedIcons/ but I don't really understand the method.
Does anyone know of an effective method?
Thank you in advance for your attention and your answers :)

What's the use of the layout managers in the (new) GUI Builder of Codename One?

I am trying to create a new project with the new GUI BUilder (I've already made hand-coded project). I watched Steve Hannah's tutorial about creating a sign-in form. If the sign-in form was hand-coded then it would have to use eg a Y-BoxLayout Manager. However in the tutorial everything is laid-out without resorting explicitly to this layout manager what I understand because the designer provides the layout.
But I wonder why new the GUI Builder offers such containers with specific layout managers ? What are the use cases when they should be used, and are they meant to be used as is (as ready-to-use examples) or the designer should remove the components inside with custom ones ?
Thanks in advance for the shed lights ;-)
The current version (3.7.2 and earlier) works best with a flat layout (i.e. not nesting subcontainers). The next release will include improvements that make it easier to work with nested layouts.
There are many reasons why you might want to use a nested layout. A couple of use-cases that come to mind are:
If you're laying out a form that has more than one logical section and you want to be able to lay them out independently. In this case using a couple of sub-containers that both use LayeredLayout themselves can make things a little easier.
If the layout has a nested list (i.e. box-layout-y) that you will populate in code at runtime with content that you load from a web-service, etc..

How to reuse content with Sencha Touch

I want to build a mobile site in Sencha which showing HTML content on a tablet device, containing many objects/divisions/containers with similar layouts and properties.
Take this example window:
Is there a best practice or recommended way to achieve reusability and DRY for writing those containers in Sencha Touch 2?
What types of objects would you use? Does it make sense to use HTML div objects + CSS?
Also, does it make sense to use Sencha in this case?
Here is how you would achieve that layout using Sencha Touch:
Unfortunately it is pretty hard to explain, but hopefully it makes sense.
I've also created a very simple example of this layout, viewable here: http://www.senchafiddle.com/#jxiA8 (make sure you press Run).
As for which objects/components; they would all be Ext.Containers. Ideally you would use the MVC structure to create custom classes (which would extend Ext.Container) for each of these items.
This is definitely a great use case for Sencha Touch. It is great for creating rich applications like this.
Best approach to render the list of items in the Orange and Yellow containers is probably with a DataView.
Relying on itemTpl to draw each item as per the official documentation of the Ext.dataview.DataView component or using an item renderer, as per the dive into dataview article. (Note that the code in that article may not work as sencha as changed a lot between the different beta versions - #rdougan's associated demo on github may be more recent).
I did expand on the layout code contributed by #rdougan to add an example of how to implement the Reusable dataviews (gist).
That demo code also contains a quickly baked solution for data injection (applyStore and injectStore), so to make it possible to define an "OrangeContainer" once and only once and pass down different data for the "highlighted" and "list" versions of the views at the top and bottom of the screen, respectively. I have no idea whether this is a good or reliable way to do it. I would be interested in feedback on this.

Silverlight Composite application

I'm trying to figure out what would be best solution to the problem I'm facing. I have a Silverlight application which should be composed from different modules. I can use Prism, place regions and load modules and fill regions with loaded modules but this is not enough in my situation. Here's what I want to accomplish:
For most views that gets loaded from different xap files, I should place an element somewhere in the shell, which will perform navigation to the dynamically loaded view.
That element (which links to dynamically loaded view) should support localization and should have dynamically assignable data templates, different module links should have different content/data template (I'm thinking writing data templates in xaml files on the server and reading them from silverlight via XamlReader, maybe there's a better way?).
Uri mapping and browser journal should work with navigation. Silverlight default navigation mechanism better suits my needs than the one found in Prism.
The architecture should support MVVM.
I think thats all. I just couldn't think of a good architecture which will satisfy all my needs. Any help would be greatly appreciated.
I do not know of a single product/solution that would cover all your requirements, so here are some comments on each:
If one area of the shell has a region that supports multiple items, you just register a control of type link/button etc with the same region name in each module. For example we register views based on the Telerik TadRibbonTab (instead of UserControl) with a region named "views" which is a RibbonBarTab with a region named "views". Every module then adds its its own button to the list. You can do the same thing with any multi-item container.
Localisation is a completely different issue and can be solved in a number of ways. See my answer here: Load Resources ".resx" from folder in Silverlight
A custom navigation mapper can be made to behave like the standard one, without messing up the support for Prism regions. The one we created encodes GUI information such as current selections (current view and item selections etc) into the URL. That means we are in total control of the state and the URL controls the state.
Hardly anything stops you using MVVM as that is one small feature for separating views from code-behind data.
I will be interested in what other solutions are proposed as we are always looking for new ideas too.

Is a drag-over checkbox list useful?

A while ago I created a drag-over check box list which allows you to check many check boxes in a single gesture. Do you think it is viable and usable on the web where people might not know how to use it. The default behaviour still works for the individual check boxes.
1 - The idea
The idea is nice and can probably be used in professional applications where you have direct contact with users and can explain them how things work, but not necessarily on public websites where users don't want to RTFM and are just looking for familiar behaviours. Unless it was just a sample exercise or a control meant to be included it in a control pack, it violates the YAGNI principle ;)
2 - The implementation
You certainly noticed that the implementation is buggy (at least on IE7 and FF3.1B2). Sometimes, a gesture above all checkboxes will select all of them but one or two. Moving the mouse over the div's above or below the list will stop the drag (I know it's a "feature", but it's not very user friendly). I Checked the source code and to be honnest, while it looks pretty neat, I just didn't want to deal with it because it is plain javascript. Don't you know that...
3 - Possible improvements
...you can write less and do more with a javascript library, typically jQuery. I would completely rewrite this control as a jQuery plugin. It will provide you with a lot of tools to make your code much easier to write, maintain and extend. Just try it, you'll love it. This is from a technical point of view. From a user point of view, try to make you control as familiar as possible, like what Angela suggested, windows explorer : a nice selection rectangle, the ability to use shit + click, or something like that. Finally, remember that for many windows checklistbox users, "selected" and "checked" are two different things.
The demo definitely needs a few enhancements to make it even a little bit useful (although I am not sure if it would be enough):
Allow the dragging to start somewhere that is not a check box.
Allow selection by dragging over the labels as well.
This problem seems similar to the action of selecting multiple files in a file explorer like Windows Explorer. Maybe it can work like the action of selecting multiple files by dragging a rectangle shape around the items to be selected (select one corner, drag to the other corner)? This has the advantage of being similar to an interface element that people may already be familiar with.
For some reason I can't open your link (it says my ip address was blocked). But I think what you're looking for is what I already did in jquery, I uploaded a plugin which I basically ported from crossbrowser.com's dragcheck functionality, it was to be found at http://plugins.jquery.com/project/dragCheck but currently the jquery plugin site is being revamped and my plugin has disappeared. I'm trying to see if they're going to put it back up or if I have to create a new project again...
Anyways until we get that worked out you can see a demo here: http://jsbin.com/ibihi

Resources