Mittwoch, 26. Mai 2010

Neueste Updates für Software-Entwickler - Mai

Meht unter dem Microsoft - Download - Link:

Montag, 17. Mai 2010

Wie ändere ich das Tastaturlayout?

In XAML würde es so aussehen:

<textbox Text="HelloWorld!">
<TextBox.InputScope>
<inputscope>
<inputscopename NameValue="<layout>" />
</InputScope>
</TextBox.InputScope>
</TextBox>

wobei <layout> folgende Werte annehmen kann:

Default - Standard QWERTY keyboard
Text - Standard text with features such as autocorrect and text suggestion
Url - User types a URL
EmailSmtpAddress - User types an e-mail address
EmailNameOrAddress - User types an e-mail name or address
Maps - User types a location to search for on a map
TelephoneNumber - User types a telephone number
Search - User types a search query
NameOrPhoneNumber - User types in the SMS To field
Chat - Text input that uses intelligent features such as abbreviations

... und wer lieber programmiert das Ganze in C#-Code:

InputScope inputScope = new InputScope();
InputScopeName inputScopeName = new InputScopeName();
inputScopeName.NameValue= InputScopeNameValue.Url;
inputScope.Names.Add(inputScopeName);
textbox.InputScope = inputScope;

Mittwoch, 12. Mai 2010

List Box Horizontal ausrichten (Horizontal orientation)

<Listbox Margin="10" x:Name="listBox1">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ListBox>

Samstag, 8. Mai 2010

Windows Phone 7 Gestures

Single Touch

Tap (like a Click)
  • Actions on an item in a two step process. Stop a list from scrolling. Single touch on the screen.
Double Tap (like a Doubleclick) 
  • Toggle between "in" and "out" zoom states of a control or application.
Touch and hold (like right Click)
  • Shows options (context menu) for an item
Pan (like Drag, Hold and Move)
  • Moves content via direct manipulation (content sticks to finger and follows). A pan can reorder or move a specific item.
Flick (like Drag, Hold and Move fast and Release)
  • Moves content
Multi-touch

Pinch and Stretch
  • Continous Zoom. Center of the content is in the middle of the two fingers.

Samstag, 1. Mai 2010

Sound im Windows Phone 7 abspielen.

using Microsoft.Xna.Framework;

using Microsoft.Xna.Framework.Audio;
 
// Sound Effekt laden.
SoundEffect sound1 = SoundEffect.FromStream(TitleContainer.OpenStream("sound1.wav"));
// Sound Effekt aus einem Unterverzeichnis (Subfolder) laden.

SoundEffect sound2 = SoundEffect.FromStream(TitleContainer.OpenStream("Sounds/sound2.wav"));
 
// Sound abspielen
sound1.Play();

Silverlight Performance messen auf dem Windows Phone 7.

Einfach diese Zeile in den Quellcode z.b. in App.cs in den Konstruktor einfügen.
  • Application.Current.Host.Settings.EnableFrameRateCounter = true;
Im Emulator (siehe Bild) oder auf dem Telefon werden die Daten dann angezeigt (ohne der farbigen Erklärung).

 

 
  1. Composition Thread Frame Rate (Storyboards), sollte bei über 45 liegen, bei unter 30 wird die Schrift Rot *, maximal 60 Frames/Sekunde.
  2. UI Thread Frame Rate (alles andere ausser 1.), sollte bei über 30 liegen, bei unter 15 wird die Schrift Rot*, maximal 60 Frames/Sekunde.
  3. Texture Memory Usage (Speicherverbrauch für GUI's)
  4. Surface Counter (Verarbeitungzähler der GPU, Caching-Wert)
  5. Intermediate Surface Counter (Gecachte Oberflächen zur Berechnung der Z-Order)
  6. Fill Rate Counter (Anzahl gezeichneter Pixel pro Frame, 1.0 = 480x800), sollte bei kleiner 2.5 liegen, bei über 3.0 wird die Schrift Rot*, maximal 3.0.
* Hier könnte ein Performance - Problem sein.