zaagan
11/29/2018 - 5:45 AM

Xamarin

Xamarin.Forms snippets


/* <Frame x:Name="frameCreatePassword" ...>
      <Frame.HorizontalOptions>
        <OnPlatform x:TypeArguments="LayoutOptions">
          <On Platform="UWP" Value="CenterAndExpand" />
          <On Platform="iOS,Android" Value="FillAndExpand" />
        </OnPlatform>
      </Frame.HorizontalOptions>
    </Frame>
*/

<!--Implementation on ResourceDictionary for reusability -->

<ContentView>
  
  <ContentView.Resources>
        <ResourceDictionary>
            <Style TargetType="CustomControls:ExtendedLabel" x:Key="lblHeaderValue">
                <Setter Property="FontSize" Value="20" />
                <Setter Property="FontAttributes" Value="Bold" />
            </Style>
        </ResourceDictionary>
    </ContentView.Resources>

    <ContentView.Content>
      <CustomControls:ExtendedLabel Style="{StaticResource lblHeaderValue}" Text="{Binding Data}" />
    </ContentView.Content>
      
</ContentView>