Contribution:
silverlight
Headline
Web programming in C# with Silverlight
Motivation
The implementation illustrates the development of a client-side user interface accessible via web browser. We used Technology:Silverlight in combination with the Technology:Navigation framework navigation to create an MVC based implementation. The web application is tied to a web service, which is implemented in Contribution:wcf. An advantage of Silverlight is the out-of-the-box back button support.
Illustration
There have to be proxy DTOs enabling the client to receive the serialized data from the web service. These proxies are generated from a Language:WSDL file. The namespace for the generated classes is
namespace silverlight.CompanyServiceReference {
using System.Runtime.Serialization;
// The class "CompanyDto" is the proxy DTO for serialized company data.
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute(Name="CompanyDto", Namespace="http://schemas.datacontract.org/2004/07/wcf.Dto")]
public partial class CompanyDto : object, System.ComponentModel.INotifyPropertyChanged {
...
}
...
// The connection point to the company service provided by the wcf implementation.
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class CompanyServiceClient : System.ServiceModel.ClientBase<silverlight.CompanyServiceReference.ICompanyService>, silverlight.CompanyServiceReference.ICompanyService {
...
}
...
}
GUI
The proxy in combination with the
The illustrated code creates a service client and waits, until the company data are completely delivered to the client. The result is a DTO, which is stored in the
We are now able to fill the GUI with the help of the
txtCompanyName
<TextBlock Height="23" HorizontalAlignment="Left" Margin="59,46,0,0" Name="txtCompanyName" Text="{Binding Name}"
Architecture
The project is represented as two Visual Studio projects:
- silverlight.Web contains the generated bootstrap code for launching the silverlight application.
- silverlight contains the actual implementation. The Language:WSDL file and the generated DTO proxies are located in the folder silverlight/ServiceReferences/CompanyServiceReference. The GUI is provided by Language:XAML files located in the base folder of the project.
Usage
- Follow the Usage section for the Contribution:wcf to create a WCF service.
- Build the project using Visual Studio.
- Open the silverlightTestPage.html from silverlight.Web folder.
Backlinks
User contributions
User edits
Syntax for editing wiki
For you are available next options:will make text bold.
will make text italic.
will make text underlined.
will make text striked.
will allow you to paste code headline into the page.
will allow you to link into the page.
will allow you to paste code with syntax highlight into the page. You will need to define used programming language.
will allow you to paste image into the page.
is list with bullets.
is list with numbers.
will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.
will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.
will allow your to insert code snippets from @worker.
Syntax for editing wiki
For you are available next options:will make text bold.
will make text italic.
will make text underlined.
will make text striked.
will allow you to paste code headline into the page.
will allow you to link into the page.
will allow you to paste code with syntax highlight into the page. You will need to define used programming language.
will allow you to paste image into the page.
is list with bullets.
is list with numbers.
will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.
will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.
will allow your to insert code snippets from @worker.