[英]Font size and weight in Application Bar in Windows Phone
I am trying to duplicate a popup menu shown from a Application bar button (like Reply in the standard Mail app) and I need to know the font size and font weight of the Application bar menu items. 我正在尝试复制从应用程序栏按钮显示的弹出菜单(如标准Mail应用程序中的“答复”),我需要知道应用程序栏菜单项的字体大小和字体粗细。
I did som trial and error but I cannot match the size and weight exactly. 我做了反复试验,但无法完全匹配尺寸和重量。
Font size: PhoneFontSizeLarge 字体大小:PhoneFontSizeLarge
Font family: PhoneFontFamilySemiLight 字体家族:PhoneFontFamilySemiLight
Have you tried using a ContextMenu? 您是否尝试过使用ContextMenu?
Using the following XAML :- 使用以下XAML:
<Grid x:Name="ContentPanel"
Grid.Row="1"
Margin="12,0,12,0">
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu IsZoomEnabled="True"
x:Name="ContextMenu">
<toolkit:MenuItem x:Name="Item1"
Header="Item 1"/>
<toolkit:MenuItem x:Name="Item2"
Header="Item 2" />
<toolkit:MenuItem x:Name="Item3"
Header="Item 3" />
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</Grid>
And the following Application Bar XAML :- 以及以下Application Bar XAML:
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True"
IsMenuEnabled="True"
x:Name="MyAppBar">
<shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png"
Text="Button 1"
Click="ApplicationBarIconButton_Click"/>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
And the following XMLNS (You need to add the Windows Phone Toolkit via Nuget):- 以及以下XMLNS(您需要通过Nuget添加Windows Phone Toolkit):-
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
And then finally the following C# :- 最后是以下C#:
private void ApplicationBarIconButton_Click(object sender, EventArgs e)
{
this.ApplicationBar.IsVisible = false;
ContextMenu.IsOpen = true;
}
The ContextMenu pops up in a similar way to the Email reply pop up menu. 弹出菜单与电子邮件回复弹出菜单类似。
Probably: 大概:
FontSize="33"
FontWeight="Light"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.