Bug 41919 - SearchBar crash because set FontFamily in UWP global FontFamily style
Summary: SearchBar crash because set FontFamily in UWP global FontFamily style
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows (show other bugs)
Version: 2.2.0
Hardware: PC Windows
: --- normal
Target Milestone: UWP
Assignee: Bugzilla
Depends on:
Reported: 2016-06-17 04:50 UTC by Mike
Modified: 2017-07-12 09:43 UTC (History)
5 users (show)

See Also:
Tags: Windows ac
Is this bug a regression?: ---
Last known good build:

Sample (102.54 KB, application/x-rar)
2016-06-17 04:50 UTC, Mike
Search Logs (1.43 KB, application/x-zip-compressed)
2017-07-12 09:43 UTC, Jacky Waswani

Description Mike 2016-06-17 04:50:56 UTC
Created attachment 16374 [details]

I add a style in my UWP application global resources:


            <Style TargetType="AutoSuggestBox">
                <Setter Property="FontFamily" Value="/Assets/fontName.ttf#fontName"/>

But that will let the Xamarin.Form crash when use <SearchBar   /> in xaml of Xamarin.

I upload a sample file.
Comment 1 E.Z. Hart [MSFT] 2016-07-11 21:41:41 UTC
Still happens in
Comment 2 Mike 2016-07-12 03:21:53 UTC
I found it will also crash if I input some arabic character in it.(Right to left)
Comment 3 Paul DiPietro [MSFT] 2017-02-16 22:53:30 UTC
Normally what you would want to do here in order to apply the style is something like this:

<Style TargetType="AutoSuggestBox">
    <Setter Property="TextBoxStyle" Value="{StaticResource CustomTextBoxStyle}"/>
<Style TargetType="TextBox" x:Key="CustomTextBoxStyle">
    <Setter Property="FontFamily" Value="Comic Sans MS"></Setter>

However, using your original style in a regular UWP app doesn't cause a crash, and appears to be due to a naming conflict on the TextBox style used for AutoSuggestBox in Forms, so it's probably worth adjusting to prevent possible crashes.
Comment 4 Rui Marinho 2017-03-07 10:04:16 UTC
Should be fixed in 2.3.5-pre1
Comment 5 Jacky Waswani 2017-07-12 09:43:17 UTC
Have verified the bug with latest forms build version

Bug is seems to be fixed.

Attaching the screencast & logs for more detail.

Screencast : https://www.screencast.com/t/8g1jhlyd

Build Info:https://gist.github.com/GLjackyvaswani/600433ce6f3b92544b42d0392001d326
Comment 6 Jacky Waswani 2017-07-12 09:43:37 UTC
Created attachment 23489 [details]
Search Logs

Note You need to log in before you can comment on or make changes to this bug.