Difference between revisions of "Working with SIlverlight"

From PeformIQ Upgrade
Jump to navigation Jump to search
Line 9: Line 9:
* http://archive.msdn.microsoft.com/silverlightut
* http://archive.msdn.microsoft.com/silverlightut
* http://weblogs.asp.net/scottgu/archive/2008/04/02/unit-testing-with-silverlight.aspx
* http://weblogs.asp.net/scottgu/archive/2008/04/02/unit-testing-with-silverlight.aspx
* http://msdn.microsoft.com/en-us/magazine/dd458800.aspx


=C#=
=C#=

Revision as of 11:01, 5 October 2011

Some Links

The journey begins...


C#


public Page()
{
    InitializeComponent();
    HtmlDocument htmlDoc = HtmlPage.Document;
    HtmlElement  htmlEl  = htmlDoc.GetElementById("Input");
    ...
    // Add an event handler for the Convert button.
    htmlEl = htmlDoc.GetElementById("Convert");
    htmlEl.AttachEvent("onclick", new EventHandler(this.OnConvertClicked));
}

void OnConvertClicked(object sender, HtmlEventArgs e)
{
    HtmlDocument htmlDoc = HtmlPage.Document;
    HtmlElement input    = htmlDoc.GetElementById("Input");
    HtmlElement output   = htmlDoc.GetElementById("Output");
    output.SetAttribute("value", input.GetAttribute("value").ToUpper());
}