随笔 - 705  文章 - 0  评论 - 1103  阅读 - 138万 

图片地址:

<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   冯瑞涛  阅读(569)  评论(0编辑  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
点击右上角即可分享
微信分享提示