#眉標=Windows Phone、XNA、Silverlight #副標=Windows Phone開發系列(2) #大標=Windows Phone 7應用程式開發資源 #作者=文/圖 沈炳宏 ======程式1 =========== Partial Public Class DemoUserControl Inherits UserControl Public Sub New InitializeComponent() Me.DataContext = {"Hello from RUN!PC"} End Sub End Class ================ ======程式2 ===========   ================ ======程式3 =========== private void button1_Click( object sender, RoutedEventArgs e) { webBrowser1.Navigate( new Uri(“http://www.runpc.com.tw”, UriKind.Absolute)); } ================ ======程式4 =========== protected override void LoadContent() {  spriteBatch = new SpriteBatch(GraphicsDevice);  Texture2D texture1 = Content.Load ("GameThumbnail");  Texture2D texture2 = Content.Load ("GameThumbnail"); …  sprite2Height = texture2.Bounds.Height;  sprite2Width = texture2.Bounds.Width; } ================ ======程式5 =========== protected override void Draw(GameTime gameTime) {  spriteBatch.Begin( SpriteSortMode.BackToFront, BlendState.AlphaBlend);  spriteBatch.Draw( texture1, spritePosition1, Color.White); … } ================ ======程式6 =========== protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); … base.Update(gameTime); } ================