zoukankan      html  css  js  c++  java
  • XAML 属性设置Windows Phone笔记

    图片地址:

    <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();

  • 相关阅读:
    Servlet的生命周期
    Servlet中的请求与响应
    Servlet中的相关的配置文件信息:
    转发与重定向的区别,笔记无法转过来,所以直接放链接了,可以直接查看
    JSP入门中的一些案例代码:
    一些已经有些模糊的小知识(一)
    JSP入门五之request,out,response对象的应用
    JSP入门四
    JSP入门三 不知道如何将笔记同步过来只能这样了
    来自(乐唯科技)的面试问题..
  • 原文地址:https://www.cnblogs.com/finehappy/p/2186049.html
Copyright © 2011-2022 走看看