Three practical tips for Silverlight today, I watched a video tutorial on the Silverlight discovery journey and found something useful. I will extract it now to share with you what I personally think is quite good. I. DebugSilverlight application method: Method 1: Silverlight reference namespace: System. Diagnost
Three practical tips for Silverlight today, I watched a video tutorial on the Silverlight discovery journey and found something useful. I will extract it now to share with you what I personally think is quite good. I. DebugSilverlight application method: Method 1: Silverlight reference namespace: System. Diagnost
Three practical tips for Silverlight today, I watched a video tutorial on the Silverlight discovery journey and found something useful. I will extract it now to share with you what I personally think is quite good.
I. DebugSilverlight application method:
First:
1. Silverlight reference namespace: System. Diagnostics;
2. Write Debug. WriteLine ("content to be output") where necessary ");
3. When debugging, You can output "content to be output" in the output window"
Second:
1. Reference namespace: System. Windows. Browser;
2. Write HtmlPage. Window. Alert ("alert information") where necessary ");
3. alert can output "alert information" during operation ";
I personally think these two methods are quite good, especially the first one, which is much easier than setting a breakpoint for debugging. If there is no output in that place, it means you know where an error has occurred.
2. Use full screen for Silverlight
1. Reference namespace: System. Windows. Interop;
2. Write ContentmyContent = newContent (); myContent. IsFullScreen =! MyContent. IsFullScreen;
In this way, you can control whether the running program is full screen.
3. Timer
1. Reference namespace: System. Windows. Threading;
2. instantiate the Timer object:
- DispatcherTimertimer=newDispatcherTimer();
- timer.Interval=TimeSpan.FromMilliseconds(10);
- timer.Tick+=newEventHandler(timer_Tick);
- voidtimer_Tick(objectsender,EventArgse)
- {
- //todo
- }
In this way, a timer has been completed.
However, to execute it, you must write timer. Start (); to Stop it, write timer. Stop ();
I think the above three points will be very useful when learning Silverlight, especially the first point. I personally think it may be useful in other development scenarios. I hope you will make great efforts.
Http://www.slfans.com /? Action-viewnews-itemid-17423
Silver Powder-Silverlight enthusiast http://www.slfans.com/