How to separate style sheets using Xamarin Forms

0
Hello, I'm coming from WPF where it is possible to create my style files in separate files and from them use in my% s of% s the same style settings. I did some (many) searches and found some references like this:

link

But unfortunately I could not figure out how to separate my stylesheets in a "coherent" way as I'm used to in WPF or the web.

Today the common framework I use in my WPF projects looks like this:

App
|- App.xaml.cs
|- Assets
   |- Fonts
   |- Styles
      |- Colors.xaml
      |- Fonts.xaml
      ...
   |- Images

And in my root file (App.xaml) I import the style dictionaries, like this:

<Application 
    x:Class="Teste.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Teste"
    StartupUri="Views/Dialogs/SplashDialog.xaml">
    <Application.Resources>
      <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
          <ResourceDictionary Source="./Assets/Styles/Colors.xaml"/>
          <ResourceDictionary Source="./Assets/Styles/Fonts.xaml"/>
          <ResourceDictionary Source="./Assets/Styles/Badges.xaml"/>
          <ResourceDictionary Source="./Assets/Styles/Buttons.xaml"/>
          <ResourceDictionary Source="./Assets/Styles/Tabs.xaml"/>
          <ResourceDictionary Source="./Assets/Styles/Aligns.xaml"/>
          <ResourceDictionary Source="./Assets/Styles/Forms.xaml"/>
        </ResourceDictionary.MergedDictionaries>
      </ResourceDictionary>
    </Application.Resources>
</Application>

How do I apply the same structural "logic" to a Xamarin.Forms application?

    
asked by anonymous 09.10.2018 / 16:10

0 answers