# any silverlight programmers?



## Braveheart (Jun 24, 2009)

I've been messing with it lately and its cool, much better than flash IMO...has anyone else tried developing with it?


----------



## Kreij (Jun 24, 2009)

I was delving into it for awhile when it first came out, but I don't have an IIS server here at work.
I could easily set one up, but have too many other projects lately.
It does do some very cool stuff, though.

I just read an article recently about HTML5 having rich multimedia content built into it so people would not have to use flash or Silverlight. We will see.


----------



## FordGT90Concept (Jun 24, 2009)

I made two applets with it but concluded that to do some of the simplest tasks require way too much work (like getting data from a database via PHP).  They also made simple ToolTip text much more complicated.  It needs a lot of work before it becomes a viable product.


----------



## ZenZimZaliben (Jun 24, 2009)

I read the same article regarding HTML5, however we are talking about 5 years out before it's even deployed, and probably another 2 before browser acceptance. HTML5 will completely kill the need for FLASH, SWISH, SilverLight, and many java based web apps.


----------



## FordGT90Concept (Jun 24, 2009)

ZenZimZaliben said:


> I read the same article regarding HTML5, however we are talking about 5 years out before it's even deployed, and probably another 2 before browser acceptance. HTML5 will completely kill the need for FLASH, SWISH, SilverLight, and many java based web apps.


Great.  As long as it is secure and doesn't allow access to the computer without explicit user consent, I'll be happy.  I'm sick of all this CSS, XML, HTML, JS, Java, Flash, PHP, ASP, ASPX, yada yada yada.  The more that gets unified, the better.


----------



## Kreij (Jun 24, 2009)

FordGT90Concept said:


> Great.  As long as it is secure and doesn't allow access to the computer without explicit user consent, I'll be happy.  I'm sick of all this CSS, XML, HTML, JS, Java, Flash, PHP, ASP, ASPX, yada yada yada.  The more that gets unified, the better.



I'm with you on that one.


----------



## ZenZimZaliben (Jun 25, 2009)

Yeah...wouldn't it be awesome to just have just a couple languages to learn that suited all your needs and was a World wide standard.


----------



## Braveheart (Jun 25, 2009)

HTML5 will be amazing, i was just reading a big article on it at work, my co-workers were wondering why i was yelling and jumping for joy as i read a magazine


----------



## Braveheart (Jun 26, 2009)

how do you embed silverlight apps in a website?


----------



## ZenZimZaliben (Jun 26, 2009)

http://developer.yahoo.com/dotnet/silverlight/embedding.html


----------



## FordGT90Concept (Jun 26, 2009)

Braveheart said:


> how do you embed silverlight apps in a website?


I just used what was in the TestPage.html file.

In the head (handles displaying of errors):

```
<script type="text/javascript">
        function onSilverlightError(sender, args) {
        
            var appSource = "";
            if (sender != null && sender != 0) {
                appSource = sender.getHost().Source;
            } 
            var errorType = args.ErrorType;
            var iErrorCode = args.ErrorCode;
            
            var errMsg = "Unhandled Error in Silverlight 2 Application " +  appSource + "\n" ;

            errMsg += "Code: "+ iErrorCode + "    \n";
            errMsg += "Category: " + errorType + "       \n";
            errMsg += "Message: " + args.ErrorMessage + "     \n";

            if (errorType == "ParserError")
            {
                errMsg += "File: " + args.xamlFile + "     \n";
                errMsg += "Line: " + args.lineNumber + "     \n";
                errMsg += "Position: " + args.charPosition + "     \n";
            }
            else if (errorType == "RuntimeError")
            {           
                if (args.lineNumber != 0)
                {
                    errMsg += "Line: " + args.lineNumber + "     \n";
                    errMsg += "Position: " +  args.charPosition + "     \n";
                }
                errMsg += "MethodName: " + args.methodName + "     \n";
            }

            throw new Error(errMsg);
        }
    </script>
```

In the body where you want it to display:

```
<object data="data:application/x-silverlight," type="application/x-silverlight-2-b2" width="100%" height="100%">
			<param name="source" value="CHANGE_THIS_VALUE.xap"/>
			<param name="onerror" value="onSilverlightError" />
			<param name="background" value="white" />
			
			<a href="http://go.microsoft.com/fwlink/?LinkID=115261" style="text-decoration: none;">
     			<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
			</a>
		</object>
```


This uses Object, not much JS.  The linking to JS files I believe was Silverlight 1.0 spec and not 2.0.

Note to edit the "CHANGE_THIS_VALUE.xap" to point to the name of your XAP file.


----------



## Braveheart (Jun 27, 2009)

coolio, oh and BTW, i love your sig.


----------



## Dippyskoodlez (Jun 27, 2009)

ZenZimZaliben said:


> I read the same article regarding HTML5, however we are talking about 5 years out before it's even deployed, and probably another 2 before browser acceptance. HTML5 will completely kill the need for FLASH, SWISH, SilverLight, and many java based web apps.



FF3.5 beta, and Safari both have HTML5 support started. Chrome might too. 5 years is probably not quite true, considering initial support is already here (There's even a website that hosts videos in the new HTML5 standard, similar to youtube.).


----------



## Dark_Webster (Jun 27, 2009)

Dippyskoodlez said:


> FF3.5 beta, and Safari both have HTML5 support started. Chrome might too. 5 years is probably not quite true, considering initial support is already here (There's even a website that hosts videos in the new HTML5 standard, similar to youtube.).



And the Welcome page of Safari 4 is HTML5 . It's pretty good.


----------



## Braveheart (Jun 28, 2009)

serious? i had no idea, im going to go get the new safari


----------

