My Silverlight series (13) -- Silverlight windows

Source: Internet
Author: User
As we all know, we have many desktop applications on Microsoft's Windows platform, which makes our life rich and interesting. With the popularity of bsstructure applications and RIA applications, many desktop applications have released Ajax and flex versions. Without installation, upgrades and maintenance become easier.
As a type of RIA, Silverlight has many advantages in interaction. If Windows Explorer is the carrier of desktop applications, Internet Explorer is the carrier of Silverlight applications. (If you use ff, do not scold me. I still like IE, because it provides better support for SL ). In the past, I added and modified some sl2 files Code , The concept of Explorer is moved to Silverlight to simulate the features of the window class on WPF. Because my art skills are not good, there are no art cells, and I don't use blend very much, the ui I made is really not very nice. However, at least the basic functions are almost implemented. Here I will give a brief introduction.
Almost all of the main functions of this project are implemented by the control explorer and form. The former can be customized, such as wallpaper, Desktop shortcuts, and taskbar, and all form objects are managed in a unified manner; the latter is mainly used to support logic functions such as maximizing, restoring, minimizing, dragging, and changing the window size and position. The running effect is about (this is my own cottage version of MSN ):

The use of the Explorer class and Form class is relatively simple. Explorer only needs to be written in the XAML, and generally becomes the root element of application. Current. rootvisual, so that it can be filled with the entire Silverlight application. The Form class can be used like childwindow introduced in silverlight3, except that the explorer attribute needs to be set before show. Otherwise, a null pointer will appear.

It is very easy to implement a form on this basis. Because form itself is a contentcontrol, it can be defined in XAML as follows: < Provider: Form X: Class = "Silverlightwindow. helloworld"
Xmlns = "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
Xmlns: x = "Http://schemas.microsoft.com/winfx/2006/xaml"  
Xmlns: Provider = "CLR-namespace: winformprovider. controls; Assembly = winformprovider"
Width = "600" Height = "400" Icon = "Icon.jpg" Title = "Hello World" Top = "100" Left = "100"
Showintaskbar = "True" Minwidth = "500" Minheight = "300" >
< Provider: form. trayareaicon >
< Provider: trayareaicon Icon = "Icon.jpg" DoubleClick = "Trayareaicon_doubleclick" />
</ Provider: form. trayareaicon >
< Grid X: Name = "Layoutroot" Background = "White" >
< Textblock >
Hello, There is a form, it will show with 100px xoffset and 100px yoffset
< Linebreak />
You can resize it, and drag it, or close it
< Linebreak />
I don't konw how to create an introduction documentation
< Linebreak />
However, I think this control is quite easy, you can do it as WPF window
< Linebreak />
< Linebreak />
< Linebreak />
And don't be surprised if the footer disappers from taskbar when you minimize the form
< Linebreak />
It is because I think if there is a trayarea icon, footer is useless
</ Textblock >
</ Grid >
</ Provider: Form >

In addition, the background Code provides a wide range of public and protected attributes, methods, and events, so we can implement many functions. For details, refer to the code and examples.

I have released this project (including examples) to codeplex: http://silverlight?#codeplex.com/, which is an alpha=. If anyone is interested, contact me to complete it.
I carefully read the requirements for putting Article on the home page. I feel like this article is a 4) software release article, however, I hope that more people will see this article. If you like Silverlight and think this project is of great value, please join us to enrich and improve this project.
finally, I would like to celebrate that I have earned 2000 points on the Silverlight official website (http://silverlight.net/forums) and successfully promoted to contributor. Souvenir:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.