Font family has no effect in Windows Phone 8.1 - windows-runtime

This is definitely not the case in WP8.
However in the new Blend come with VS2013, the font family doesn't have any effect either in Blend Designer or runtime.
<TextBlock Text="test"
FontSize="{StaticResource HubHeaderFontSize}"
FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
<TextBlock Text="test"
FontSize="{StaticResource HubHeaderFontSize}"
FontFamily="{StaticResource PhoneFontFamilyLight}"/>
Are they still Segoe WP or Segoe UI?
What I have noticed is, if I change the font weight, it shows the correct font. But I really want to be able to use the built-in font family resources. Is there a way?

From generic.xaml:
<!-- Global font family -->
<FontFamily x:Key="PhoneFontFamilyNormal">Segoe WP</FontFamily>
<FontFamily x:Key="PhoneFontFamilyLight">Segoe WP Light</FontFamily>
<FontFamily x:Key="PhoneFontFamilySemiLight">Segoe WP SemiLight</FontFamily>
<FontFamily x:Key="PhoneFontFamilySemiBold">Segoe WP Semibold</FontFamily>
<FontFamily x:Key="ContentControlThemeFontFamily">Segoe WP</FontFamily>
It appears that those fonts aren't embedded...

Related

WinRT Universal App: Bottom bar icons blurred.

I have used 76*76 png file for bottom bar icon in my windows universal app.
Below is my xaml for mobile bottom bar
<Page.BottomAppBar>
<CommandBar RequestedTheme="Dark" Background="#FFF3A716">
<AppBarButton x:Uid="AppBarHome" Click="AppBarButton_Click">
<AppBarButton.Icon>
<BitmapIcon HorizontalAlignment="Center" VerticalAlignment="Center" UriSource="/Assets/Images/home-icon.png">
</BitmapIcon>
</AppBarButton.Icon>
</AppBarButton>
</CommandBar>
</Page.BottomAppBar>
And this is my bottom bar for tablet app:
<Page.BottomAppBar>
<CommandBar Name="BtmBar" Closed="CommandBar_Closed" RequestedTheme="Dark" Background="#FFF3A716" IsOpen="True" IsSticky="True">
<AppBarButton x:Uid="AppBarHome" Click="AppBarButton_Click">
<AppBarButton.Icon>
<BitmapIcon HorizontalAlignment="Center" VerticalAlignment="Center" UriSource="/Assets/Images/home-icon2.png">
</BitmapIcon>
</AppBarButton.Icon>
</AppBarButton>
</CommandBar>
</Page.BottomAppBar>
home-icon is 76*76 and home-icon2 is 96*96.
I have tried 76*76 icon for both also but in phone it seems ok and in tablet it is blurred.
How can I get rid of this blurry issue?
You have to make more than one scale and let Windows -auto- choose the perfect one .. This image may help you : http://i.stack.imgur.com/x2yGW.jpg .
Ref: AppBar button icon not fitting inside elipse
Scaling Ref : How to create multi scaled image assets for a WP 8.1 Store app

What's wrong with Windows Phone 8.1 Pivot? (WinRT - not Silverlight)

So I've decided to migrate from Windows Phone 8.0 to Windows Phone 8.1 API - not the silverlight one.
The reason was that I wanted to use Win2D drawing library which is not supported for Silverlight 8.1 or WP 8.0
The weird things are happening.
Simple Pivot view is incredibly laggy and also it is not displaying views properly.
I am using latest Visual Studio 2015. On the video I linked you can see the result of following Page XAML code (just for testing):
<Page
x:Class="Apptest2.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Apptest2"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Column="0">
<Button Content="Go"
/>
</StackPanel>
<Pivot Grid.Row="1"
x:Name="PivotView"
Margin="10,0,10,15"
CacheMode="BitmapCache"
VerticalContentAlignment="Stretch">
<PivotItem Header="item1">
<Grid Background="BlueViolet" />
</PivotItem>
<PivotItem Header="item2">
<Grid Background="BlueViolet" />
</PivotItem>
<PivotItem Header="item3">
<Grid Background="BlueViolet" />
</PivotItem>
<PivotItem Header="item4">
<Grid Background="BlueViolet" />
</PivotItem>
<PivotItem Header="item5">
<Grid Background="BlueViolet" />
</PivotItem>
<PivotItem Header="item6">
<Grid Background="BlueViolet" />
</PivotItem>
</Pivot>
</Grid>
</Page>
Is anyone able to tell what is going on here? Should I use some pivot analogs from 3rd parties or maybe just forget about using it in new os?
Pulling my hair out.
Any solution would be hugely appreciated!
Link to video
The problem is you are using CacheMode="BitmapCache" on your Pivot. Remove this line and the performance should be good after.
First of all the caching is applied to the element and all of it’s child elements and BitmapCaching should be used in scenarios where you are blending, transforming (translating, stretching, rotating). If you need BitmapCaching then try not to use it on root controls, use it on the children that really need BitmapCaching.
Misuse of the CacheMode feature can hurt performance, so you need to really think through what you are doing. If your visual tree is interleaving cached and un-cached elements, you are effectively causing multiple rendering surfaces to get created behind the scenes. The un-cached surfaces are rendered in software and the cached surfaces are rendered in hardware. Your performance will be best if you can minimize the total number of rendering surfaces and get the hardware to do work where it can.
Reference from another StackOverflow answer. I hope it helps.

Pivot Header Text Color in WP8.1

I am working on a windows phone 8.1 app, where I am not able to change the Pivot Text Header Color.
I have use below code in my pivot section, but here I can't use multi color in text blocks.
<Pivot.HeaderTemplate>
<DataTemplate>
<Grid Height="40">
<TextBlock Text="{Binding}"
Foreground="Black"
FontSize="28"
VerticalAlignment="Bottom"/>
</Grid>
</DataTemplate>
</Pivot.HeaderTemplate>
Note : I need a solution for windows phone 8.1 and also I want to change the text color not the background color.
If you want different colours in every textbox have a look at this, you'll have to use a converter
How to highlight dates in a TextBlock MVVM Light

How to change background color of AppBar Windows Phone 8.1

This is my code XAML, i just want to change background color of the labels and buttons inside
<Page.BottomAppBar>
<CommandBar Background="#FF3965FF">
<AppBarButton Label="estação" Icon="Map" Click="Bar_Localizar" Foreground="White" BorderBrush="White" Background="White"/>
<CommandBar.SecondaryCommands>
<AppBarButton Label="traçar rotas" Icon="Add" Click="bar_tracar_rotas" Foreground="White"/>
<AppBarToggleButton Label="tráfego" Checked="ToggleButton_OnChecked" Unchecked="ToggleButton_OnUnchecked"/>
<AppBarToggleButton Label="mapa aéreo" Checked="mapa_checked" Unchecked="mapa_unchecked"/>
<AppBarButton Label="voltar" Icon="Add" Click="bar_voltar"/>
<AppBarButton Label="Sair" Icon="Add" Click="bar_sair"/>
</CommandBar.SecondaryCommands>
</CommandBar>
</Page.BottomAppBar>
I try to use Foreground="White" but doesn't works!
The AppBar is system UI and you are not allowed to change colors of individual buttons. If you want you can change the backgrounf color of whole application bar (use Background property) and color of all buttons (use Foreground property). This should work:
<Page.BottomAppBar>
<CommandBar Background="#FF3965FF" Foreground="White">
<AppBarButton Label="estação" Icon="Map" Click="Bar_Localizar"/>
</CommandBar>
</Page.BottomAppBar>
Remember also to perform suitable changes for all themes (Light/Dark/Contrast) allowed by your app.
If you need something more customizable, then probably you will have to build own control that will mimic the AppBar.

How to Change heigth and font size of TextBox in Windows Phone 8.1 RT?

How to Change heigth and font size of TextBox in Windows Phone 8.1 RT?
this is my code:
<TextBox Name="textNumber" Grid.Row="1" PlaceholderText="placeholder text" FontSize="48" Height="80" MinHeight="38"/>
The problem is that the Font size is only for the input of the user, but not for the placeholder text, so placeholder text looks very small.
The PlaceholderText always pulls its font from the ContentControlFontSize resource. If you want to change this globally you can override that resource. If you want to override it just for a specific control you'll need to retemplate the TextBox. Select it in the designer, right click, and choose Edit Template... The placeholder is defined in the following Xaml, and you can update it as you'd like:
<ContentControl x:Name="PlaceholderTextContentPresenter" Content="{TemplateBinding PlaceholderText}" Foreground="{ThemeResource TextBoxPlaceholderTextThemeBrush}" FontSize="{ThemeResource ContentControlFontSize}" IsTabStop="False" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.Row="1"/>
If you want the Placeholder's font size to match the FontSize set on the TextBox then change the ContentControl's FontSize to "{TemplateBinding FontSize}"
<ContentControl x:Name="PlaceholderTextContentPresenter" Content="{TemplateBinding PlaceholderText}" Foreground="{ThemeResource TextBoxPlaceholderTextThemeBrush}" FontSize="{TemplateBinding FontSize}" IsTabStop="False" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.Row="1"/>