![]() This new kind of project is called a "CSHTML5 Project".Ī CSHTML5 project is very similar to a Silverlight/WPF project, in that it contains mainly C# and XAML files. ![]() What is " C#/XAML for HTML5" exactly, and how does the migration workĬ#/XAML for HTML5 (also called "CSHTML5") is an extension for Visual Studio that adds a new kind of project to the "New Project" dialog. Your apps run on any modern browser, without the user installing any plugins, and you can even package them for deployment on iOS and Android via PhoneGap/Cordova, as well as other devices such as Chromebooks, Macs, and Linux-based devices. In fact, C#/XAML for HTML5 is the only solution that lets you reuse most of your SL code, keep coding in a Silverlight-like way, and at the same time generate cross-platform HTML5-based apps. However, if you want your app to run in the browser, or if you want to reach more platforms, you will likely find C#/XAML for HTML5 a compelling choice. If your app targets only Windows-based devices, and if deployment is not an issue for you, you may consider migrating your application to WPF or UWP. In fact, Chrome, Edge, and mobile browsers have stopped supporting it long ago, and FireFox has also stopped supporting it in March 2017. If you have a Silverlight application, chances are that you are looking for a way to migrate it to other technologies. Main steps for migrating a Silverlight/WPF application Differences between a Silverlight/WPF project and a CSHTML5 project What is "C#/XAML for HTML5" exactly and how does the migration work Alternatively, you can hire us to do the full migration for you, and save on licensing costs and more. Note: This page is for "do-it-yourself" migrations. Conclusion: Thus, in the second part of this article series, you explored how to create a LINQtoSQL class, a WCF service and consume the service in Silverlight 2 to access data.Manually Migrate Silverlight/WPF apps to HTML5 using CSHTML5 Figure 2: Output Now, that you know how to retrieve data using a WCF Service, you can tweak the code to make many changes and perform different kinds of data operations. When you save, build and execute and specify language as English, you will get results similar to Figure 2. One is an event handler for Button Click and one is the custom event handler method to assign the retrieved data to the data grid. Namespace DBDemo The last two methods are the most important. Edit as follows: using System using using System.Linq using System.Net using System.Windows using using using using using using using DBDemo.MovieServiceReference You will see MovieService.cs now in the MovieServiceReference directory as a result of the above command. To use it in your current application directory, give the following: path=%path% C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin Then type the command similar to the one in Figure 1 in your application directory, that is, SvcUtil *.wsdl *.xsd /language:C# Figure 1: Using SvcUtil This will generate client code from the local metadata service document. ![]() This tool is typically found in the C:\Program Files\Microsoft SDKs\Windows version xx folder where xx may change based on your machine configuration. To generate a client class that can consume the service, use the SvcUtil tool as shown in Figure 5. Rename the service reference to MovieServiceReference. Click Discover and then select MovieService.svc after it is shown in the Add Service Reference dialog box. To do this, right click on the project, DBDemo and select Add Service Reference. ![]() We begin with adding a service reference to MovieService. Introduction: In this article, we will make use of the WCF service created in the previous part of this article and access data in the Silverlight application, DBDemo.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |