查看了网上的示例
- C# code
ApplicationBar = new ApplicationBar();ApplicationBar.Mode = ApplicationBarMode.Default;
但是我的VS 提示 没有Mode这个属性,跟踪定义看到如下,的确没有Mode属性,为什么呢?
- C# code
#region 程序集 Microsoft.Phone.dll, v2.0.50727// C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\Microsoft.Phone.dll#endregionusing Microsoft.Phone.Shell.Interop;using System;using System.Collections;using System.Windows.Markup;using System.Windows.Media;namespace Microsoft.Phone.Shell{ // 摘要: // Allows developers to create and display an application bar with between 1 // and 4 buttons and a set of text menu items in Windows Phone applications. [ContentProperty("Buttons")] public sealed class ApplicationBar : IApplicationBar { public ApplicationBar(); public Color BackgroundColor { get; set; } public IList Buttons { get; } public Color ForegroundColor { get; set; } public bool IsMenuEnabled { get; set; } public bool IsVisible { get; set; } public IList MenuItems { get; } public double Opacity { get; set; } public event EventHandler<ApplicationBarStateChangedEventArgs> StateChanged; }}
------解决方案--------------------
<phone:PhoneApplicationPage.ApplicationBar >
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Mode="Default">
<shell:ApplicationBarIconButton x:Name="appbar_Reply" IconUri="/icons/appbar.edit.rest.png" IsEnabled="True" Text="回复" Click="appbar_Reply_Click"/>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
------解决方案--------------------
7.0的时候,App Bar只能是默认状态。
7.1才可以使用最小化的外观。