Shortcut Key
F1: Back button
F2: Home (start) button
F3: Search button
Pause: replace screen keyboard with keyboard input
For more shortcut keys refer to: http://bit.ly/emulatorshortcuts
Icon
Shows the three button icons:
If a custom icon is used, you need to change the build action of the resource to content instead of resource.
Three build actions
Files whose build action attribute is set to content are directly packaged in xap files as independent files.
Files whose build action attribute is set to resource will be embedded into the DLL file in the xap package.
Files whose build Action property is set to none are not stored in the xap package in any form.
For multimedia files, you must use the content format for better performance.
Microsoft's standard answer is that using "content" is better than "resource. Because Windows Phone 7 optimizes the file and network stream, but the memory stream does not. Set to content. These files are stored in the xap package as independent files.
If it is set to resource, they will be compiled into the DLL, which will increase the DLL file sizeProgramIt is slower to start.
Content-Type images can be loaded asynchronously, while resource-type images can only be loaded synchronously in DLL. However, in some cases, synchronous loading is also required.
If you do not want to protect the icon file, do not compile it into the DLL as a resouce.
Save data
With isolatedstorage, the author encapsulates a setting class, which is used as follows:
Setting <int> savedcount = new setting <int> ("savedcount", 0 );
This. savedcount. value = This. Count; // save
This. Count = This. savedcount. value; // read
The source code is as follows:
View code Using System. Io. isolatedstorage;
namespace windowsphoneapp
{< br> // encapsulates a key/value pair stored in isolated storage applicationsettings
Public class setting
{< br> string name;
T value;
T defaultvalue;
bool hasvalue;
PublicSetting (StringName, t defaultvalue)
{
This. Name = Name;
This. Defaultvalue = defaultvalue;
}
Public T value
{
Get
{
// Check for the cached Value
If (! This . Hasvalue)
{
// Try to get the value from isolated storage
If (! Isolatedstoragesettings. applicationsettings. trygetvalue (
This . Name,Out This . Value ))
{
// It hasn' t been set yet
This . Value = This . Defaultvalue;
Isolatedstoragesettings. applicationsettings [ This . Name] =This . Value;
}
This . Hasvalue = True ;
}
Return This. Value;
}
set
{< br> // Save the value to isolated storage
isolatedstoragesettings. applicationsettings [ This . name] = value;
This . value = value;
This . hasvalue = true ;
}< BR >}
PublicT defaultvalue
{
Get{Return This. Defaultvalue ;}
}
//"Clear" cached value:
Public VoidForcerefresh ()
{
This. Hasvalue =False;
}
}
}
Application bar
WP's application bar icon and iPhone's tab bar icon switch.
The application bar can have up to four buttons.
To customize the button icon: A 48*48 pixel icon without a circle border. If the icon is not realistic, it is probably because the build action is not set to content.
In the Application bar menu, the following functions should be put: uncommonly used functions with poor descriptions of icons. The number of menu items cannot exceed 5.
Opacity attribute of application bar
When the value is less than 1, the visible page will be longer (72 pixels ). Transparency can be customized, but only the following three types are recommended: 1, 0.5, and 0.