图片地址:

<Image Name="imgBomb" Stretch="Fill"  Width="100" Height="100"  Source="/CrazyBomb;component/Images/SleepState.png" MouseLeftButtonDown="imgBomb_MouseLeftButtonDown" />

 

按钮背景:

<Button Name="btnOverGame" Click="btnOverGame_Click" Width="100" Height="100" Visibility="Collapsed">
                <Button.Background>
                    <ImageBrush ImageSource="/CrazyBomb;component/Images/OverIcon.jpg" />
                </Button.Background>
</Button>

 

WP弹出提示框是一样的。

string scoreMessage = string.Format("Your Score : {0} !", GetScore());
            MessageBox.Show(scoreMessage, "GameOver", MessageBoxButton.OK);

 

也可以使用匿名方法

btnSettingItem.Click += delegate(object o, RoutedEventArgs e)
                    { MessageBox.Show("SettingItem is Clicked!", "Click", MessageBoxButton.OK); };

 

修改启动页面

WMAppManifest.xml 文件的

<Tasks>
      <DefaultTask Name="_default" NavigationPage="MainPage.xaml" />
    </Tasks>

 

快捷方式标题名字

image

WMAppManifest.xml 文件的

  <App xmlns="" ProductID="{689bb09d-e38a-4ce7-bbf8-7e4080ee0db8}" Title="wp7SaveImage背景设置"

 

页面导航

NavigationService.Navigate(new Uri("/Page1.xaml", UriKind.Relative));

 

应用程序栏

<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar>
            <shell:ApplicationBarIconButton IconUri="/icons/appbar.check.rest.png" Text="OK"/>
            <shell:ApplicationBarIconButton IconUri="/icons/appbar.cancel.rest.png" Text="Cancel"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

 

属性值加×

纯数字代表固定高度(像素),数字加×代表按比例分配,即在固定值分配完成了后,按比例分配,如:10×、100、20×、30× ,会先分配固定值100,然后按10:20:30的比例分配高度或者是宽度。

 

匿名方法现在可以省略到如下程度了。

if (null==_timer)
           {
               _timer = new DispatcherTimer();
           }
           _timer.Interval = TimeSpan.FromSeconds(2);
           _timer.Tick += (sender, e) =>
               {
                   Index++;
                   if (Index==AdvWords.Length)
                   {
                       Index = 0;
                   }
                   _mangoIndicator.Text = AdvWords[Index];
               };
           _timer.Start();

posted on 2011-09-23 12:16  冯瑞涛  阅读(563)  评论(0编辑  收藏  举报