Wrong font stretch (condensed) when changing font family in TextBox - xaml

When I change the font in a TextBox control (Arial in my case) it always uses the narrow version of the font with no ability to override (although the FontStretch property is set to Normal).
This is the case for all fonts with multiple stretch versions. It always picks the condensed font. Changing the font weight works as expected.
I have also tried to create a minimum template for the TextBox, but that doesn't help either.
Reproduced this in a new project with only a few lines of XAML:
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="Arial" FontFamily="Arial" FontSize="32" />
<TextBox Text="Arial" FontFamily="Arial" FontSize="32" FontStretch="Normal" Margin="0 20 0 0" Width="300" />
</StackPanel>
Tried with SDK 17763, 17134, 16299 and 15063.

Related

Inmobi ads Displayed issue on Windows Phone 8

I want to set the Inmobi ads on the bottom of the screen.
In XAML i set the Horizontal and Vertical alignment in bottom. when i saw the design i saw the AdView in bottom of screen but when i deploy it By default it appear in Middle.
I'm confused am i did mistake anywhere either it always appear on that place.
<StackPanel x:Name="ControlPanel" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,55" Grid.Row="3" Width="480" >
<Ad:IMAdView
x:Name="AdView1"
RefreshInterval="30"
AdSize="15"
AppId="fcc4c048-4686-42bc-a40c-b7fe8da70b40"
Height="110" Width="480"
AnimationType="SLIDE_IN_LEFT" HorizontalAlignment="Right" VerticalAlignment="Bottom"
Margin="0,0,0,30" >
<Ad:IMAdView.IMAdRequest>
<Ad:IMAdRequest
LocationInquiryAllowed="False"/>
</Ad:IMAdView.IMAdRequest>
</Ad:IMAdView>
</StackPanel>
Changing your stackpanel's HorizontalAlignment property from "Center" to "Right" will work for you...

Textbox has to be clicked on the first line to activate cursor in XAML

I have a TextBlock and TextBox wrapped within a grid. It's purpose is to allow users to add notes to a task that they are assigned to.
When adding a note to a task, unless the first line of the notes field is clicked in. The notes field does not appear to become active and appears to be read only. The operator should be able to click anywhere in the notes boundary and the field become active.
I thought it might have been something to do with "rowspan" or the binding I have but they seem to be fine.
Any ideas?
<!--Notes-->
<TextBlock
Grid.RowSpan="2"
Text="Notes"
FontWeight="Bold"
Margin="0 5 0 0" />
<TextBox
x:Name="UxNotesField"
Grid.Row="5"
Text="{Binding TaskAction.Notes, Mode=TwoWay, Converter={StaticResource EmptyStringToNullConverter}}"
AcceptsReturn="True"
MaxHeight="200"
TextWrapping="Wrap"
TextChanged="TextBox_TextChanged"
Margin="0 0 5 5"
sec:PermissionsAssistant.PermissionKeysProperty="EditNotesField" />

Empty collection bound to LongListSelector cause incorrect view of page

I have Windows Phone 8 page which has a number of controls on it, some of them are LongListSelector controls. If all collections have content everything is displayed correctly.
But if any of the collections bound to the lists are empty all controls below them on the page disappear, i.e. the page looks to be truncated as lots of things are missing.
If I add code to make sure to add at least on item to each collection the page display correctly.
The databinding is done using C#, as shown below.
XAML
<phone:LongListSelector Grid.Row="3" x:Name="PicturesGrid">
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Image Source="{Binding Filename}" />
</StackPanel>
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
C#
PicturesGrid.ItemsSource = App.ViewModel.SelectedBird.Pictures;
Update: I have noticed that there is a scrollbar present, but however much I scroll I never get down to the bottom.

Windows phone 8 viewport control

I try to understand how windows phone viewport control Bounds work.
So i can give
viewport.Bunds = new Rect(x,y,width, height);
but what that bound stand for is it a scrollable area in the viewport.
Can anyone give me a working simple example of it cause whenever i try to use this parameter i can't scroll in viewport whatsover
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,0,0,0">
<ViewportControl Name="tuzik" Bounds="0,0,300,400" Margin="66,117,20,41" >
<Canvas Name="canvas">
<Image Name="TestImage" Source="Assets\testimage.jpg"
HorizontalAlignment="Left" VerticalAlignment="Top"
Canvas.Left="-379" Canvas.Top="-769" Stretch="Fill" />
</Canvas>
</ViewportControl>
<Rectangle x:Name="rect" Width="300" Height="400" Margin="60,111,63,0" Stroke="Aqua" />
</Grid>
I believe your problem is the Canvas within the ViewportControl. Canvas does not expand to fill the ViewportControl and will not expand to contain the contents, either. You have to set a Width and Height on the Canvas.
(At least, that's how I have mine setup.)

Windows8 ListView LineHeight

I have added a ListView to a Metro Style Blank App. Added to the ListView are 3 Strings. I want to change the LineHeight , but cannot find a property. Below is my xaml code.
<Grid Background="{StaticResource ApplicationPageBackgroundBrush}">
<ListView HorizontalAlignment="Left" Height="277.167" Margin="235.51,161,0,0" VerticalAlignment="Top" Width="100" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto">
<ListView.RenderTransform>
<CompositeTransform SkewX="-0.338" TranslateX="-0.327"/>
</ListView.RenderTransform>
<x:String>test 1</x:String>
<x:String>Test2</x:String>
<x:String>Test3</x:String>
</ListView>
</Grid>
How do I decrease, increase the line height of the strings in the ListView box? I want to decrease the space between the lines.
Thanks
Try editing a ItemContainerTemplate and then play with the properties available like margin and padding.
See my answer here :
WPF ComboBox customization in windows8
let me know in case you need any help.