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 ()
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)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

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