当前位置: 首页 > news >正文

安康网站建设公司报价中关村在线电脑网

安康网站建设公司报价,中关村在线电脑网,网站设计岗位的职责与要求,wordpress 仿虎嗅主题本节介绍另一个本地化的方法#xff1a; 在项目中添加资源文件#xff1a;#xff08;这个文件将包含应用程序的默认语言的资源#xff09; 将要名称和值添加进去。#xff08;作为应用程序中向用户显示字符串值#xff09;. 重复上面的方法#xff0c;向项目中添加更多…本节介绍另一个本地化的方法 在项目中添加资源文件这个文件将包含应用程序的默认语言的资源 将要名称和值添加进去。作为应用程序中向用户显示字符串值. 重复上面的方法向项目中添加更多的其它语言资源文件。参见后面的截图   定义默认的区域 1.在解决方案资源管理器中右键单击项目名称选择属性在application选项卡中点 程序集信息。在非特定语言列表中选择默认区域性。此标识语言的默认资源文件 中的字符串。例如如果默认资源文件被命名为AppResources.resx并在该文件中的字符串支持英语则可以选择english作为项目的中立国语言。   添加LocalizedStrings类处理资源文件 public class LocalizedStrings{public LocalizedStrings(){}private static ApplicationBarSample.AppResources localizedresources new ApplicationBarSample.AppResources();public ApplicationBarSample.AppResources Localizedresources { get { return localizedresources; } }}   主工程CS代码 using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using System.Globalization; using System.Threading;namespace ApplicationBarSample {public partial class MainPage : PhoneApplicationPage{#region Initialization/// summary/// Constructor for the PhoneApplicationPage/// The ApplicationBar is initialized. Icon buttons and menu items are added/// to the ApplicationBar and event handlers are set./// /summarypublic MainPage(){InitializeComponent();this.SupportedOrientations SupportedPageOrientation.PortraitOrLandscape;ApplicationBar new ApplicationBar();ApplicationBar.IsMenuEnabled true;ApplicationBar.IsVisible true;ApplicationBar.Opacity 1.0;ApplicationBarIconButton hide new ApplicationBarIconButton(new Uri(/Images/expand.png, UriKind.Relative));//hide.Text hide;hide.Text AppResources.ButtonText;hide.Click new EventHandler(hide_Click);ApplicationBarIconButton opacity new ApplicationBarIconButton(new Uri(/Images/opacity.png, UriKind.Relative));//opacity.Text opacity;opacity.Text AppResources.ButtonText;opacity.Click new EventHandler(opacity_Click);ApplicationBarIconButton enabled new ApplicationBarIconButton(new Uri(/Images/menuenabled.png, UriKind.Relative));//enabled.Text enabled;enabled.Text AppResources.ButtonText;enabled.Click new EventHandler(enabled_Click);ApplicationBar.Buttons.Add(hide);ApplicationBar.Buttons.Add(opacity);ApplicationBar.Buttons.Add(enabled);//ApplicationBarMenuItem foregroundItem new ApplicationBarMenuItem(use foreground color);ApplicationBarMenuItem foregroundItem new ApplicationBarMenuItem(AppResources.MenuItemText);foregroundItem.Click new EventHandler(foregroundItem_Click);//ApplicationBarMenuItem accentItem new ApplicationBarMenuItem(use accent color);ApplicationBarMenuItem accentItem new ApplicationBarMenuItem(AppResources.MenuItemText);accentItem.Click new EventHandler(accentItem_Click);ApplicationBar.MenuItems.Add(foregroundItem);ApplicationBar.MenuItems.Add(accentItem);UpdateText();}#endregion#region User Iterface/// summary/// Click handler for accent color menu item./// Changes the colored UI elements to the built-in PhoneAccentColor/// /summary/// param namesenderThe control that raised the click event./param/// param nameeAn EventArgs object containing event data./paramvoid accentItem_Click(object sender, EventArgs e){UpdateColor((Color)Resources[PhoneAccentColor]);}/// summary/// Click handler for accent color menu item./// Changes the colored UI elements to the built-in PhoneForegroundColor/// /summary/// param namesenderThe control that raised the click event./param/// param nameeAn EventArgs object containing event data./paramvoid foregroundItem_Click(object sender, EventArgs e){UpdateColor((Color)Resources[PhoneForegroundColor]);}/// summary/// Click handler for opacity icon button./// Sets the opacity value of the ApplicationBar to 0, 1, or .5/// /summary/// param namesenderThe control that raised the click event./param/// param nameeAn EventArgs object containing event data./paramvoid opacity_Click(object sender, EventArgs e){if (ApplicationBar.Opacity .01){ApplicationBar.Opacity 1;}else if (ApplicationBar.Opacity .49 ApplicationBar.Opacity .51){ApplicationBar.Opacity 0;}else{ApplicationBar.Opacity .5;}UpdateText();}/// summary/// Click handler for hide icon button./// Changes the Visible property of the ApplicationBar to false/// And makes the Show Application Bar button visible/// /summary/// param namesenderThe control that raised the click event./param/// param nameeAn EventArgs object containing event data./paramvoid hide_Click(object sender, EventArgs e){ApplicationBar.IsVisible false;showButton.Visibility Visibility.Visible;UpdateText();}/// summary/// Click handler for menu enable icon button./// Changes the IsMenuEnabled property of the ApplicationBar/// When IsMenuEnabled is false, the menu will not pop up/// /summary/// param namesenderThe control that raised the click event./param/// param nameeAn EventArgs object containing event data./paramvoid enabled_Click(object sender, EventArgs e){ApplicationBar.IsMenuEnabled !ApplicationBar.IsMenuEnabled;UpdateText();}/// summary/// Click handler for show button./// Sets the Visible property of the Application Bar to true/// /summary/// param namesenderThe control that raised the click event./param/// param nameeAn EventArgs object containing event data./paramprivate void showButton_Click(object sender, RoutedEventArgs e){ApplicationBar.IsVisible true;showButton.Visibility Visibility.Collapsed;UpdateText();}/// summary/// Updates the TextBlock objects to reflect the current state/// of the ApplicationBar/// /summaryvoid UpdateText(){VisibleLabel.Text Application Bar Visible ;VisibleTextBlock.Text ApplicationBar.IsVisible ? Yes : No;OpacityLabel.Text Application Bar Opacity ;OpacityTextBlock.Text ApplicationBar.Opacity.ToString(0.0);MenuEnabledLabel.Text MenuEnabled ;MenuEnabledTextBlock.Text ApplicationBar.IsMenuEnabled ? Yes : No;}/// summary/// Helper method for changing the color of the UI/// /summary/// param namecThe new color for the UI elements/paramvoid UpdateColor(Color c){SolidColorBrush brush new SolidColorBrush(c);VisibleTextBlock.Foreground brush;OpacityTextBlock.Foreground brush;MenuEnabledTextBlock.Foreground brush;((LinearGradientBrush)Resources[Gradient]).GradientStops[1].Color c;}private void LocList_SelectedIndexChanged(object sender, SelectionChangedEventArgs e){// Set the current culture according to the selected locale and display information such as// date, time, currency, etc in the appropriate format.string nl;string cul;nl locList.SelectedIndex.ToString();switch (nl){case 0:cul es-ES;break;case 1:cul de-DE;break;case 2:cul en-US;break;default:cul en-US;break;}// set this threads current culture to the culture associated with the selected localeCultureInfo newCulture new CultureInfo(cul);Thread.CurrentThread.CurrentCulture newCulture;CultureInfo cc, cuic;cc Thread.CurrentThread.CurrentCulture;cuic Thread.CurrentThread.CurrentUICulture;VisibleLabel.Text cc.NativeName;VisibleTextBlock.Text ;//OpacityLabel.Text cuic.DisplayName;OpacityLabel.Text ;OpacityTextBlock.Text ;MenuEnabledLabel.Text ;MenuEnabledTextBlock.Text ;//localize icon button text if (this.ApplicationBar.Buttons ! null){foreach (ApplicationBarIconButton btn in this.ApplicationBar.Buttons){btn.Text cc.NativeName.Substring(0, cc.NativeName.ToString().Length/2);}}//localize menu buttons textif (this.ApplicationBar.MenuItems ! null){foreach (ApplicationBarMenuItem itm in this.ApplicationBar.MenuItems){itm.Text cc.NativeName;}}}#endregion} }       XAML代码 phone:PhoneApplicationPage x:ClassPhoneApp6.MainPagexmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:phoneclr-namespace:Microsoft.Phone.Controls;assemblyMicrosoft.Phonexmlns:shellclr-namespace:Microsoft.Phone.Shell;assemblyMicrosoft.Phonexmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006mc:Ignorabled d:DesignWidth480 d:DesignHeight768FontFamily{StaticResource PhoneFontFamilyNormal}FontSize{StaticResource PhoneFontSizeNormal}Foreground{StaticResource PhoneForegroundBrush}SupportedOrientationsPortrait OrientationPortraitshell:SystemTray.IsVisibleTrue!--LayoutRoot 是包含所有页面内容的根网格--Grid x:NameLayoutRoot BackgroundTransparentGrid.RowDefinitionsRowDefinition HeightAuto/RowDefinition Height*//Grid.RowDefinitions!--TitlePanel 包含应用程序的名称和页标题--StackPanel x:NameTitlePanel Grid.Row0 Margin12,17,0,28TextBlock x:NameApplicationTitle Text我的应用程序 Style{StaticResource PhoneTextNormalStyle}/TextBlock x:NamePageTitle Text页面名称 Margin9,-7,0,0 Style{StaticResource PhoneTextTitle1Style}//StackPanel!--ContentPanel - 在此处放置其他内容--Grid x:NameContentPanel Grid.Row1 Margin12,0,12,0/Grid/Grid!--演示 ApplicationBar 用法的示例代码--phone:PhoneApplicationPage.ApplicationBarshell:ApplicationBar IsVisibleTrue IsMenuEnabledTrueshell:ApplicationBarIconButton IconUri/Images/appbar_button1.png Text按钮 1/shell:ApplicationBarIconButton IconUri/Images/appbar_button2.png Text按钮 2/shell:ApplicationBar.MenuItemsshell:ApplicationBarMenuItem Text菜单项 1/shell:ApplicationBarMenuItem Text菜单项 2//shell:ApplicationBar.MenuItems/shell:ApplicationBar/phone:PhoneApplicationPage.ApplicationBar/phone:PhoneApplicationPage     转载于:https://www.cnblogs.com/eagle1986/archive/2012/04/26/2472751.html
http://www.yutouwan.com/news/371008/

相关文章:

  • asp网站开发环境搭建钟星建设集团网站
  • 网站建设推广方案书云南哪有网站建设推广
  • 做博客网站需要工具吗销售渠道都有哪些
  • 百度竞价托管代运营郑州做优化的公司有哪些
  • 小熊代刷推广网站品牌营销策划英文
  • 互动科技网站建设关键词挖掘排名
  • 北京网站优化公司官网设计公司有哪些
  • 谁有做那事的网站加盟网络营销推广公司
  • 自学考试 网页制作与网站建设06627安阳空气
  • 网站开发询价表模板下载企业管理咨询公司宗旨
  • 手机网站建设注册塔山双喜wordpress分类目录多级菜单
  • 网站域名不备案要证书有啥用安徽建设工程信息网技术服务电话
  • 界面好看的网站珠海专业制作网站
  • 海外建站流程seo关键词教程
  • 移动网站有哪些软件设计师是干什么的
  • 电商网站运营怎么做小程序开发平台的设计是实现
  • 网站 自助建站品牌营销策划案例ppt
  • 网站页面布局用什么做荆州网站建设推荐
  • 网站建设管理后台导航栏建设网站需要哪些东西
  • 判断网站做的好坏宁波网站搭建公司定制
  • 广告视频网站市场营销策略包括哪些策略
  • 网站开发 平台建设宁乡市建设局网站
  • p2p网站的建设山东省职业能力建设处网站
  • 旅行用品东莞网站建设微信网站开发语言
  • 合肥手机网站制作建设呼和浩特公司做网站
  • iis做网站广东手机网站制作价格
  • 做网站练手餐饮行业网站建设风格
  • wordpress多站点可视化广州乐地网站建设
  • 凡科免费网站建设网站项目怎么做计划
  • 苏州制作网站的有几家网站建设上线