Template:SilverlightEmbed

    Table of contents
    No headers
    /***
        USAGE:
    
        SilverligthtEmbed(source, width, height)
            Embed a Silverlight control on a page.
        
        PARAMETERS:
    
        source : str
            Source URI where the Silverlight.xap file is located.  If uri is not a valid URI, it is assumed to be the name of
            a file attachment on the current page.
    
        (optional) width : num (default: 450)
            Width in pixel or percent for the Silverlight control.
    
        (optional) height : num (default: 400)
            Height in pixel or percent for the Silverlight control.
    
    ***/
    
    // check if uri parameter points to a 
    var source = $0 ?? $source;
    if(!uri.isvalid(uri)) {
        let source = page.files[source].uri;
    }
    
    // embed silverlight code
    <object data="data:application/x-silverlight," type="application/x-silverlight-2" width=($1 ?? $width ?? 550) height=($2 ?? $height ?? 400) > 
        <param name="source" value=(source) /> 
        <param name="background" value="white" /> 
        <param name="minRuntimeVersion" value="2.0.31005.0" /> 
        <param name="autoUpgrade" value="true" />     
        <a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"> 
            <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/> 
        </a> 
    </object> 
    
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by