Recommended

Skip Navigation LinksHome / Search

Search

 
Results Per Page

Found 3 results for object.
Date between: <not defined> and <not defined>
Search in: News , Articles , Tips , Shows , Showcase , Books

Order by Publish Date   Ascending Title   Rating  

  • 0 comments  /  posted by  Martin Mihaylov  on  Nov 28, 2008 (more than a year ago)

    When using the object element to display our Silverlight application, we can use parameters to configure it (source, onerror, background, minRuntimeVersion and etc.):

    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
        <param name="source" value="ClientBin/Issues.xap"/>
        <param name="onerror" value="onSilverlightError" />
        <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>

    Some of them are predefined in the automatically created TestPages, but we can also add additional parameters like initParams, onload and etc.

    Be sure always to set the value of each parameter, otherwise browsers different than Internet Explorer will not be able to render the object element properly and the "Install Silverlight" badge will appear instead of the Silverlight application. This issue could be a showstopper when embedding Silverlight applications into a web page and is not related to the Silverlight plug-in.

     

    That's it!



  • 0 comments  /  posted by  Denislav Savkov  on  Sep 05, 2008 (more than a year ago)
    Tags: Silverlight , XAML , object

    There are two ways to declare objects in XAML. The most common way is to declare elements using opening and closing tag - using the object element syntax

    XAML

    <objectName><objectName/> 

    It has a shorter version

    XAML

    <objectName/>

    that can be used if the object has no child elements. See how to set a property and how to declare a child element.

    The other way is to create an object indirectly by setting a property. This syntax is used relatively rare. The type or property being set is required to support type converter that takes the string value of the property. This way the object is created from the converter using a string.

    That's it!

  • 2 comments  /  posted by  Denislav Savkov  on  Aug 29, 2008 (more than a year ago)

    If you want to pass initialize parameters to Silverlight application from an HTML/ASPX page, you have to find the place where your Silverlight control is inserted into the page using the <object> element and insert the bold line bellow.

    HTML

    <object data="data:application/x-silverlight," type="application/x-silverlight-2-b2" width="100%" height="100%"> 
        ...
        <param name="initParams" value="param1=value1,param2=value2" />
        ...
    </object>

    As you can see you have to insert one new element <param name="initParams" value="parameters"/> as a child of the <object> element. The syntax for parameters definition is pretty straightforward - you just have to enumerate all parameters and their values separated by commas like this: "parameter1=value1,parameter2=value2,parameter3=value3". Once the initialize parameters have been defined, you can obtain them in your application startup event handler using the InitParams property of the StartupEventArgs like this:

    C#

    private void Application_Startup( object sender, StartupEventArgs e )
    {
        //... Other code here ...
        string param1Value = e.InitParams[ "param1" ];
    }
    
    That's it!

Help us make SilverlightShow even better and win a free t-shirt. Whether you'd like to suggest a change in the structure, content organization, section layout or any other aspect of SilverlightShow appearance - we'd love to hear from you! Need a material (article, tutorial, or other) on a specific topic? Let us know and SilverlightShow content authors will work to have that prepared for you. (hide this)