Silverlight三个实用技巧
Silverlight三个实用技巧今天,我看了Silverlight发现之旅的视频教程,发现一些东西挺有用的。我现在就把它摘出来,让大家来分享一下这些我个人觉得挺好的东西。 一、DebugSilverlight应用程序的方法: 第一种: 1.Silverlight引用命名空间:System.Diagnost
Silverlight三个实用技巧今天,我看了Silverlight发现之旅的视频教程,发现一些东西挺有用的。我现在就把它摘出来,让大家来分享一下这些我个人觉得挺好的东西。
一、DebugSilverlight应用程序的方法:
第一种:
1.Silverlight引用命名空间:System.Diagnostics;
2.在程序必要的地方写:Debug.WriteLine("想要输出的内容");
3.Debug的时候,在输出窗口就可以输出“想要输出的内容”
第二种:
1.引用命名空间:System.Windows.Browser;
2.在程序必要的地方写:HtmlPage.Window.Alert("alert的信息");
3、运行的时候就能够alert出“alert的信息”;
这两种方法,我个人觉得都很不错,特别是第一种,比在哪个地方设置断点来调试方便多了。只要看到那个地方没输出,就等于知道了哪个地方出现了错误。
二、Silverlight使用全屏
1.引用命名空间:System.Windows.Interop;
2.在程序必要的地方写:ContentmyContent=newContent();myContent.IsFullScreen=!myContent.IsFullScreen;
这样就可以控制运行程序是否全屏。
三、实现Timer计时器
1.引用命名空间:System.Windows.Threading;
2.实例化Timer对象:
<ol> <li> <span><font>DispatcherTimertimer</font></span><span>=</span><span><font>newDispatcherTimer</font></span><span>(); </span> </li> <li> <span><font>timer.Interval</font></span><span>=</span><span><font>TimeSpan</font></span><span>.FromMilliseconds(10); </span> </li> <li><span>timer.Tick+=newEventHandler(timer_Tick); </span></li> <li><span>voidtimer_Tick(objectsender,EventArgse) </span></li> <li><span>{ </span></li> <li><span>//todo </span></li> <li><span>} </span></li> </ol>
就这样,一个timer已经完成了。
但是要让它执行,就必须写上timer.Start();要停止的话就写上timer.Stop();
以上这三点,我觉得在学习Silverlight的时候,一定会很有用,特别是第一点,我个人觉得在其他开发可能也会很有用。希望大家努力拍砖吧。
本文:http://www.slfans.com/?action-viewnews-itemid-17423
银光粉-Silverlight爱好者 http://www.slfans.com/

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Practical Tips to Quickly Solve Tomcat404 Errors Tomcat is a commonly used JavaWeb application server and is often used when developing and deploying JavaWeb applications. However, sometimes we may encounter a 404 error from Tomcat, which means that Tomcat cannot find the requested resource. This error can be caused by multiple factors, but in this article, we will cover some common solutions and tips to help you resolve Tomcat 404 errors quickly. Check URL path

Practical tips for efficiently resolving large file read exceptions in Java require specific code examples. Overview: When processing large files, Java may face problems such as memory overflow and performance degradation. This article will introduce several practical techniques to effectively solve Java large file reading exceptions, and provide specific code examples. Background: When processing large files, we may need to read the file contents into memory for processing, such as searching, analyzing, extracting and other operations. However, when the file is large, the following problems are often encountered: Memory overflow: trying to copy the entire file at once

In our daily work and study, we often encounter situations where we need to merge the contents of two pages of a Word document into one page, such as printing to save paper or making a booklet, etc. Although the Word software itself does not provide direct functions to achieve this operation, we can use some techniques to achieve this goal. Below we will share some practical tips to help you quickly and easily merge two pages of a Word document into one. 1. Reduce the page size In a Word document, we can merge two pages into one by adjusting the page size.

Learn practical tips for Java regular expression syntax, step by step, with specific code examples. Regular expressions are a powerful tool that can be used for pattern matching and replacement of strings. In Java, string operations can be easily handled using regular expressions. This article will introduce you to some practical tips about Java regular expression syntax and provide specific code examples. Basic matching patterns for regular expressions in Java use the java.util.regex package. To use regular expressions, you can use Patter

Practical tips and code samples for drawing charts in Python Introduction: Data visualization is an indispensable part of data analysis. Python, as a powerful programming language, provides multiple libraries and tools to make charting simple and easy. This article will introduce some practical tips and code samples for drawing charts to help readers better use Python for data visualization. 1. Matplotlib library Matplotlib is a widely used drawing library in Python, which can draw many types of charts.

With the continuous development of computer hardware, the popularity of multi-core CPUs, and the efficiency requirements of modern applications, multi-threaded programming has become an inevitable topic in the field of Java programming. In Java, multi-threaded programming relies on the Thread class and Runnable interface. Java provides a series of thread components that can help us create and manage multiple threads. This article will introduce some practical tips for multi-threaded programming in Java to enable you to better perform multi-threaded programming. Thread creation and starting Java

Practical skills of Chinese C language software With the acceleration of globalization, Chinese C language software has become more and more important. When developing software, Chineseizing the software interface, prompt information, logs and other content can improve the user experience and make the software more easily accepted by Chinese users. This article will introduce some practical techniques to help developers convert content in C language software into Chinese. At the same time, it will be accompanied by specific code examples to help readers better understand and apply these techniques. 1. Use wide character encoding. In C language, wide character encoding is a

A new choice for cross-platform development: Practical skills to master the Go language In the field of modern software development, cross-platform development has become an important requirement. In order to be able to run their applications on different operating systems and devices, developers need to find a cross-platform development language that is both efficient and easy. The Go language has become a new choice for many developers. Go language is a statically typed programming language developed by Google. It has many unique advantages in cross-platform development. This article will share some practical tips for mastering the Go language to help readers
