In the last blog, Windows Phone 7, the latest development ToolPak, introduced the phoney project, which has introduced a fading message hint, this article will expand the message that the hint message appears with a glass border, similar to the effect of the Windows 7 form.
Let's take a look at the effect after the run:
In fact, to put it simply is to add a glass to the pop-up box style.
The specific changes are as follows:
Open the FadingMessage.cs file under the Phoneytools project, find the Standardmessage method, add the following code
#region Border LinearGradientBrush brush = new LinearGradientBrush (); Brush.
EndPoint = new Point (0.5, 1); Brush.
StartPoint = new Point (0.5, 0);
GradientStop GS1 = new GradientStop (); Ess.
Color = Color.FromArgb (58, 11, 32, 45); Ess.
Offset = 0;
GradientStop GS2 = new GradientStop (); Gs2.
Color = Color.FromArgb (62, 255, 255, 255); Gs2.
Offset = 0.25;
GradientStop GS3 = new GradientStop (); Gs3.
Color = Color.FromArgb (255, 255, 255, 255); Gs3.
Offset = 0.5;
GradientStop GS4 = new GradientStop (); GS4.
Color = Color.FromArgb (62, 255, 255, 255); GS4.
Offset = 0.75;
GradientStop GS5 = new GradientStop (); GS5.
Color = Color.FromArgb (191, 255, 255, 255); GS5.
Offset = 1;
GradientStopCollection GSC = new GradientStopCollection (); Gsc.
ADD (GS1); Gsc.
ADD (GS2); Gsc.
ADD (GS3); Gsc.
ADD (GS4); GsC.add (GS5); Brush.
GradientStops = GSC;
#endregion #region Background LinearGradientBrush BRUSHFORBG = new LinearGradientBrush ();
Brushforbg.endpoint = new Point (0.5, 1);
Brushforbg.startpoint = new Point (0.5, 0);
GradientStop gsBg1 = new GradientStop ();
Gsbg1.color = Color.FromArgb (33, 255, 255, 255);
Gsbg1.offset = 0;
GradientStop gsBg2 = new GradientStop ();
Gsbg2.color = Color.FromArgb (192, 255, 255, 255);
Gsbg2.offset = 0.287;
GradientStop gsBg3 = new GradientStop ();
Gsbg3.color = Color.FromArgb (255, 255, 255, 255);
Gsbg3.offset = 0.683;
GradientStop gsBg4 = new GradientStop ();
Gsbg4.color = Color.FromArgb (33, 255, 255, 255);
Gsbg4.offset = 1;
GradientStopCollection GSC2 = new GradientStopCollection (); GSC2.
ADD (GSBG1); GSC2.
ADD (GSBG2); GSC2.
ADD (GSBG3); GSC2.
ADD (GSBG4); Brushforbg.gradientstops = GSC2; #endregion var thecontainer = new Border () {//background = Phonebrushes.phonecontrastbackground Brush,//borderbrush = Phonebrushes.phoneborderbrush, Background =brushforbg,//modified to transparent background borderb Rush = brush,//modified to glass border BorderThickness = phonethicknesses.phoneborderthickness, Cornerradius = new C Ornerradius (5)};