When the title of an application is longer, the title of the application is not full. You can scroll it. You can use either the scrollviewer control or the translatetransform Translation Transform.
1. The scrollviewer control directly sets horizontalscrollbarvisibility = "Auto" to roll horizontally.
< Stackpanel X: Name = "Titlepanel" Grid. Row = "0" Margin =" >
< Textblock X: Name = "Applicationtitle" Text = "My application" Style =" {Staticresource phonetextnormalstyle} " />
< Scrollviewer Width = "480"
Horizontalscrollbarvisibility = "Auto" > < Textblock X: Name = "Pagetitle" Text = "This name seems a little long" Margin = "9,-7, 0, 0" Style =" {Staticresource phonetexttitle1style} " />
</ Scrollviewer >
</ Stackpanel >
2. Use translatetransform to implement translation transformation. This method will not produce the scroll Effect of scrollviewer, that is, where you dial the text, and where it will be.
< Grid X: Name = "Contentpanel" Grid. Row = "1" Margin = "12, 0, 12, 0" >
< Stackpanel X: Name = "Contentpanel2" Background = "Black"
Manipulationdelta = "Contentpanel2_manipulationdelta" Margin = "941,447" >
< Textblock Text = "This is also a little long, but there is no inertial rolling. " Foreground = "White" Fontsize = "100" />
</ Stackpanel >
</ Grid >
Public Partial Class Mainpage: phoneapplicationpage
{
// Create a translation object
Private Translatetransform Transform = New Translatetransform ();
Public Mainpage ()
{
Initializecomponent ();
// Set the transform attribute of stackpanel to Pan Transform
Contentpanel2.rendertransform = Transform;
}
Private Void Contentpanel2_manipulationdelta ( Object Sender, manipulationdeltaeventargs E)
{
// X axis Movement
Transform. x + = E. deltamanipulation. Translation. X;
}
}