We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

LeadingViewPosition in ResourceDictionary throws System.Reflection.TargetInvocationException

When I try to set the LeadingViewPosition of SfTextInputLayout in a ResourceDictionary it throws exception.

Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. occurred

It works when set in XAML:

<input:SfTextInputLayout LeadingViewPosition="Inside">
    <Entry />

In a ResourceDictionary it does not work:

<Style TargetType="input:SfTextInputLayout">
   <Setter Property="LeadingViewPosition" Value="Inside" />
   <Setter Property="ContainerBackgroundColor" Value="White" />
   <Setter Property="ContainerType" Value="Filled" />
   <Setter Property="Margin" Value="20, 10" />
   <Setter Property="FocusedColor" Value="{StaticResource GreenColor}" />

1 Reply

BK Bharathiraja K Syncfusion Team May 30, 2019 09:53 AM UTC

Hi Cesar, 
Thank you for your interest in Syncfusion products. 
We can reproduce the reported problem while setting the style in the application's App page. You can create the style in content or any other page instead of the app page to overcome the reported exception in your application.  
We have already logged report for this, and it will be included in our upcoming volume 2 release, which is scheduled to be rolled out in mid-June 2019. We appreciate your patience, until then. 
You can now track your request status, review the proposed timeline for resolution, and contact us through this link for further inquiries. 

Live Chat Icon For mobile
Up arrow icon