19 Aug 2012 @ 12:03 AM 

First, before I begin, let it be known, I love Silverlight, and I plan to keep developing in it (visit my site here at jamonjoo.com).  That said, I don’t know why I have the feeling that all this Silverlight stuff is a ploy to get developers onto Windows 8, which just so happens to be XAML based; I hope I’m wrong.  All I can say is if Silverlight becomes a “Microsoft-Device-OS-Only Cross-Device Platform” [say that 5 times fast], then it will confirm my suspicion. I can only hope that Moonlight will start supporting multiple OS’s and devices also in time, and perhaps that may be a saving grace (and perhaps Microsoft should help it do so – it would only work in their favor), but I wouldn’t hold my breath.  Honestly, the whole thought of having to resort back to HTML/JavaScript makes me feel a bit feral.  I have yet to see companies cooperate with standards; even in healthcare HL7 interface communications (I’ve done a lot of work in software development for Healthcare).  The only true way to build something to run across multiple systems, devices, etc., and have it look/run the same everywhere is NOT by standards, but to either 1. Have a single company create and maintain the development platform (tainted sometimes by money and politics), or 2. Built it open source by the community (which will probably lack somewhat in quality and coherency (due to volunteers), and good development tools).

Of course, the other “SMART” thing MS could do (and may be doing [see: http://bit.ly/NLo0jm]) is to continue to have SL as a means to run software cross-platform, while also supporting XAML/C# apps it in all their own platforms.  This might attract many developers to the Microsoft platforms, knowing that they can also easily have versions to run on other non-MS platforms as well (which I assumed SL was going all along a few years back).

In conclusion, if SL doesn’t work out, then I’m creating my own, and HTML/JS can [insert vulgar statement here] … anyone else on board!? LOL ;)

All that said, I suppose also, in time, if SL5 gets deployed with Windows 8 – along with the increase in XAML/C# apps, and the market place – and since SL5 I’m sure will be around for quite some time, there’s a good chance there will be a future time when SL5 (at the very least) will still be a great platform to use, since it may be on the majority of computers around the world (http://bit.ly/8l4Y9Q). Honestly, I’m still optimistic in any case. ;)

 

Share
Posted By: James
Last Edit: 19 Aug 2012 @ 05:02 PM

EmailPermalinkComments (0)
Tags
Tags:
Categories: Silverlight
 30 May 2012 @ 3:58 AM 

I have have a solution that works really well for those who need to know when a child element is added or removed within their custom control. The ‘Children’ property is actually found by the parser using the “ContentProperty” attribute, and I think it’s inheritable. Anyhow, if you simply put this in your derived class:

new public ObservableCollection<UIElement> Children { get { return _Children; } }
readonly ObservableCollection<UIElement> _Children = new ObservableCollection<UIElement>();

Then all the added elements will now go to this new collection instead! :) All you have to do it listen to the “CollectionChanged” event.

Share
Posted By: James
Last Edit: 17 Jun 2012 @ 04:01 AM

EmailPermalinkComments (0)
Tags
Categories: Coding, Silverlight
 11 Jul 2010 @ 1:35 PM 

In my solution, I have a Silverlight application using WCF services and a single DataModels.cs file with contents similar to the following. The only thing to remember is to add the WindowsBase reference to your WCF service project in order to use the same ObservableCollection<> template object.
(in my case, I put DataModels.cs in the WCF project, and created a virtual file link to it from the Silverlight project)

This is a sample of the code I use:
____________________________________________________ ____________________________________________

// <...other using statements...>
using System.Collections.ObjectModel; // ObservableCollection<> is added via WindowsBase (WindowsBase.dll).

#if !SILVERLIGHT
[DataContract]
public partial class CPPLoginState
{
    [DataMember]
    public bool Ok { get; set; }
    [DataMember]
    public string UserName { get; set; }
    [DataMember]
    public Int32 UserID { get; set; }
    [DataMember]
    public ObservableCollection Roles { get; set; }
}
#endif
public partial class CPPLoginState
{
    public CPPLoginState()
    {
        Ok = false;
        UserName = "";
        UserID = 0;
        Roles = new ObservableCollection();
    }
}

________________________________________________________________________________________________

The trick here is in the Silverlight proxy’s use of the “partial” modifier for it’s class definitions. This allows “adding” code to them. :)

I must say, it only took one week working with Silverlight (from knowing nothing, not even WPF) and I’m almost done with a fairly complicated control library and host application. Silverlight + WCF really does == RAD development. :D

Share
Posted By: James
Last Edit: 13 Jul 2010 @ 01:35 AM

EmailPermalinkComments (0)
Tags
Tags: , ,
Categories: Silverlight
 11 Jul 2010 @ 3:36 AM 

So, you have two projects: WCF & Silverlight, and put a break point on code in a shared class between the two projects. Visual Studio breaks on the line, but as soon as you hit F10 or F11, the code simply “continues” as if to ignore your step request.

This very scenario really messed with me for a few months, and the reason I didn’t investigate much at the time was because I could simply create many breakpoints and run between them. Recently, however, I had code too complex to keep doing this without pulling my hair out, so I investigated again and suddenly got an idea regarding meta data. Perhaps there’s an option preventing this from working on the “root” class. You see, Silverlight-side service references create classes from server side data types (where specified), and my shared code was using partial classes to add methods to both sides (server and client). The problem is that the shared code file isn’t decorated with meta data tags, but the auto-generated client-side code IS, and in fact, this was the line:

[System.Diagnostics.DebuggerStepThroughAttribute()]

So, I did a “replace all” to clear all occurrences and presto! My life just got a little better. ;)

Share
Posted By: James
Last Edit: 13 Jul 2010 @ 01:36 AM

EmailPermalinkComments (0)
Tags

 Last 50 Posts
 Back
Change Theme...
  • Users » 18
  • Posts/Pages » 65
  • Comments » 3
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Games



    No Child Pages.

About/Help



    No Child Pages.

Contact



    No Child Pages.