Forum Xamarin.Forms

Can't we directly use add ControlTemplate in element style?

huangjinshehuangjinshe USMember ✭✭✭
edited June 2016 in Xamarin.Forms

Like this:

<Label>
    <Label.Style>
               <Setter Property="ControlTemplate">
                       <ControlTemplate >
                                  <Label Text="{Binding No}" HorizontalOptions="Fill"/>
                                  <Label Text="." HorizontalOptions="Fill"/>
                       </ControlTemplate>
               </Setter>
     </Label.Style>
</Label>

It will throw :An item with the same key has already been added. Key: Xamarin.Forms.Xaml.XmlName

Sign In or Register to comment.