Silverlight for Windows Phone 7-popup

Source: Internet
Author: User

For Windows Phone 7 developers, I want to tell users that they do not use progressbar.ProgramRunning. A progress dialog box is displayed. You can use Popup.

 

Front-end

<Popup X: Name = "progresspopup" width = "300" isopen = "false" horizontalalignment = "center"
Verticalalignment = "TOP" D: layoutoverrides = "width, horizontalmargin" margin = "89,203,">
<Border borderthickness = "10" borderbrush = "black" background = "darkgray" padding = "30,30">
<Stackpanel>
<Textblock maxheight = "100" foreground = "white" fontweight = "bold" fontsize = "36" X: Name = "TXT" text = "1">
<Textblock. triggers>
<Eventtrigger routedevent = "textblock. Loaded">
<Beginstoryboard> <storyboard>
<Doubleanimation autoreverse = "true" Duration ="
From = "1.0" repeatbehavior = "forever" storyboard. targetname = "TXT" storyboard. targetproperty = "opacity" to = "0.0"/>
</Storyboard>
</Beginstoryboard>
</Eventtrigger>
</Textblock. triggers>
</Textblock>
</Stackpanel>
</Border>
</Popup>

 

Background

Public partial class mainpage: phoneapplicationpage
{
Storyboard _ timer = new storyboard ();

Int I = 0;
Public mainpage ()
{
Initializecomponent ();

_ Timer. Duration = timespan. frommilliseconds (10 );
_ Timer. Completed + = new eventhandler (_ timer_completed );
_ Timer. Begin ();
I = convert. toint32 (txt. Text );
}

Private void phoneapplicationpage_loaded (Object sender, routedeventargs E)
{
This. Dispatcher. begininvoke (new action () => progresspopup. isopen = true ));
}

Void _ timer_completed (Object sender, eventargs E)
{

If (I <= TXT. maxheight)
{
I ++;
This.txt. Text = I. tostring ();
_ Timer. Begin ();

Return;
}

This. Dispatcher. begininvoke (new action () =>{ progresspopup. isopen = false ;}));
}

}

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.