zoukankan      html  css  js  c++  java
  • windows8开发学习笔记

    • XAML行列定义
      <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
              <Grid.RowDefinitions>
                  <RowDefinition></RowDefinition>
                  <RowDefinition Height="Auto"></RowDefinition>
                  <RowDefinition Height="Auto"></RowDefinition>
              </Grid.RowDefinitions>
             <Grid.ColumnDefinitions>
                      <ColumnDefinition></ColumnDefinition>
                      <ColumnDefinition></ColumnDefinition>
      	</Grid.ColumnDefinitions>
       </Grid>

    • 保存配置数据
      //恢复数据
      protected override void OnNavigatedTo(NavigationEventArgs e)
      {
      	ApplicationDataContainer container = ApplicationData.Current.LocalSettings;
      	if (container.Values.ContainsKey("ListBoxIndex"))
      	{
      		MyListBox.SelectedIndex = (int)ApplicationData.Current.LocalSettings.Values["ListBoxIndex"];
      	}
      }
      //保存数据
      private void MyListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
      {
      	ListBox list = sender as ListBox;
      	if (list != null)
      	{
      		if (list.SelectedIndex > -1)
      		{
      			ApplicationDataContainer myContainer = ApplicationData.Current.LocalSettings;
      			myContainer.Values["ListBoxIndex"] = list.SelectedIndex;
      		}
      	} 
      }

    • MessageDialog
      private /*async*/ void TextBlock_Tapped(object sender, TappedRoutedEventArgs e)
              {
                  MessageDialog msg = new MessageDialog("测试成功.");
                  msg.Commands.Add(new UICommand("Yes"));
                  msg.Commands.Add(new UICommand("No"));
                  msg.Commands.Add(new UICommand("林武"));
                  /*IUICommand result =await*/ msg.ShowAsync();
              }
      去掉其中的注释后,需要等待对话框显示后,函数才会执行完,使用的是异步机制同步化的方法。此外,MessageBox最多只支持3个按钮。非必要时不建议使用该方法显示消息。
  • 相关阅读:
    mysql删除重复数据
    Spring缓存注解
    Spring事物不回滚
    java.net.MalformedURLException: no protocol: www.baidu.com
    shred:减少删除文件的还原度
    rm命令防止误操作
    软链接:要根据软链接来写路径
    linux与windows文本文件间的转换:针对回车换行
    cat:文本编辑工具
    算术运算;赋值
  • 原文地址:https://www.cnblogs.com/arbboter/p/4225207.html
Copyright © 2011-2022 走看看