mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-11-01 07:56:04 +00:00
Markdown styles
This commit is contained in:
parent
c721858bc6
commit
c802c030b0
2 changed files with 49 additions and 3 deletions
45
AideDeJeu/AideDeJeu/Tools/MarkdownThemes.cs
Normal file
45
AideDeJeu/AideDeJeu/Tools/MarkdownThemes.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace AideDeJeu.Tools
|
||||||
|
{
|
||||||
|
public class MonsterMarkdownTheme : Xam.Forms.Markdown.MarkdownTheme
|
||||||
|
{
|
||||||
|
public MonsterMarkdownTheme()
|
||||||
|
{
|
||||||
|
//this.Paragraph.FontFamily = "LinLibertine_aS.ttf#Linux Libertine Capitals";
|
||||||
|
this.BackgroundColor = DefaultBackgroundColor;
|
||||||
|
this.Paragraph.ForegroundColor = DefaultTextColor;
|
||||||
|
this.Heading1.ForegroundColor = DefaultTextColor;
|
||||||
|
this.Heading1.BorderColor = DefaultSeparatorColor;
|
||||||
|
this.Heading2.ForegroundColor = DefaultTextColor;
|
||||||
|
this.Heading2.BorderColor = DefaultSeparatorColor;
|
||||||
|
this.Heading3.ForegroundColor = DefaultTextColor;
|
||||||
|
this.Heading4.ForegroundColor = DefaultTextColor;
|
||||||
|
this.Heading5.ForegroundColor = DefaultTextColor;
|
||||||
|
this.Heading6.ForegroundColor = DefaultTextColor;
|
||||||
|
this.Link.ForegroundColor = DefaultAccentColor;
|
||||||
|
this.Code.ForegroundColor = DefaultTextColor;
|
||||||
|
this.Code.BackgroundColor = DefaultCodeBackground;
|
||||||
|
this.Quote.ForegroundColor = DefaultQuoteTextColor;
|
||||||
|
this.Quote.BorderColor = DefaultQuoteBorderColor;
|
||||||
|
this.Separator.BorderColor = DefaultSeparatorColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly Color DefaultBackgroundColor = Color.FromHex("#F7F2E5");
|
||||||
|
|
||||||
|
public static readonly Color DefaultAccentColor = Color.FromHex("#0366d6");
|
||||||
|
|
||||||
|
public static readonly Color DefaultTextColor = Color.FromHex("#24292e");
|
||||||
|
|
||||||
|
public static readonly Color DefaultCodeBackground = Color.FromHex("#f6f8fa");
|
||||||
|
|
||||||
|
public static readonly Color DefaultSeparatorColor = Color.FromHex("#eaecef");
|
||||||
|
|
||||||
|
public static readonly Color DefaultQuoteTextColor = Color.FromHex("#6a737d");
|
||||||
|
|
||||||
|
public static readonly Color DefaultQuoteBorderColor = Color.FromHex("#dfe2e5");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
Title="{Binding Title}">
|
Title="{Binding Title}">
|
||||||
<ContentPage.Resources>
|
<ContentPage.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
<tools:MonsterMarkdownTheme x:Key="MonsterMarkdownTheme" />
|
||||||
<tools:NullToFalseConverter x:Key="NullToFalseConverter" />
|
<tools:NullToFalseConverter x:Key="NullToFalseConverter" />
|
||||||
<tools:HtmlNodeToFormattedStringConverter x:Key="HtmlNodeToFormattedStringConverter" />
|
<tools:HtmlNodeToFormattedStringConverter x:Key="HtmlNodeToFormattedStringConverter" />
|
||||||
<tools:HtmlNodesToFormattedStringConverter x:Key="HtmlNodesToFormattedStringConverter" />
|
<tools:HtmlNodesToFormattedStringConverter x:Key="HtmlNodesToFormattedStringConverter" />
|
||||||
|
|
@ -80,15 +81,15 @@
|
||||||
|
|
||||||
<Label Text="Capacités" Style="{StaticResource Key=subsubsection}" IsVisible="{Binding Item.SpecialFeatures, Converter={StaticResource NullToFalseConverter}}" />
|
<Label Text="Capacités" Style="{StaticResource Key=subsubsection}" IsVisible="{Binding Item.SpecialFeatures, Converter={StaticResource NullToFalseConverter}}" />
|
||||||
<!--<Label FormattedText="{Binding Item.SpecialFeatures, Converter={StaticResource HtmlNodesToFormattedStringConverter}}" IsVisible="{Binding Item.SpecialFeatures, Converter={StaticResource NullToFalseConverter}}" />-->
|
<!--<Label FormattedText="{Binding Item.SpecialFeatures, Converter={StaticResource HtmlNodesToFormattedStringConverter}}" IsVisible="{Binding Item.SpecialFeatures, Converter={StaticResource NullToFalseConverter}}" />-->
|
||||||
<mdview:MarkdownView Padding="0" CascadeInputTransparent="True" Margin="0" BackgroundColor="Aqua" InputTransparent="True" HorizontalOptions="FillAndExpand" Markdown="{Binding Item.SpecialFeatures, Converter={StaticResource HtmlNodesToFormattedStringConverter}}" IsVisible="{Binding Item.SpecialFeatures, Converter={StaticResource NullToFalseConverter}}" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding Item.SpecialFeatures, Converter={StaticResource HtmlNodesToFormattedStringConverter}}" IsVisible="{Binding Item.SpecialFeatures, Converter={StaticResource NullToFalseConverter}}" />
|
||||||
|
|
||||||
<Label Text="Actions" Style="{StaticResource Key=subsubsection}" IsVisible="{Binding Item.Actions, Converter={StaticResource NullToFalseConverter}}" />
|
<Label Text="Actions" Style="{StaticResource Key=subsubsection}" IsVisible="{Binding Item.Actions, Converter={StaticResource NullToFalseConverter}}" />
|
||||||
<!--<Label FormattedText="{Binding Item.Actions, Converter={StaticResource HtmlNodesToFormattedStringConverter}}" IsVisible="{Binding Item.Actions, Converter={StaticResource NullToFalseConverter}}" />-->
|
<!--<Label FormattedText="{Binding Item.Actions, Converter={StaticResource HtmlNodesToFormattedStringConverter}}" IsVisible="{Binding Item.Actions, Converter={StaticResource NullToFalseConverter}}" />-->
|
||||||
<mdview:MarkdownView HorizontalOptions="FillAndExpand" Markdown="{Binding Item.Actions, Converter={StaticResource HtmlNodesToFormattedStringConverter}}" IsVisible="{Binding Item.Actions, Converter={StaticResource NullToFalseConverter}}" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding Item.Actions, Converter={StaticResource HtmlNodesToFormattedStringConverter}}" IsVisible="{Binding Item.Actions, Converter={StaticResource NullToFalseConverter}}" />
|
||||||
|
|
||||||
<Label Text="Actions légendaires" Style="{StaticResource Key=subsubsection}" IsVisible="{Binding Item.LegendaryActions, Converter={StaticResource NullToFalseConverter}}" />
|
<Label Text="Actions légendaires" Style="{StaticResource Key=subsubsection}" IsVisible="{Binding Item.LegendaryActions, Converter={StaticResource NullToFalseConverter}}" />
|
||||||
<!--<Label FormattedText="{Binding Item.LegendaryActions, Converter={StaticResource HtmlNodesToFormattedStringConverter}}" IsVisible="{Binding Item.LegendaryActions, Converter={StaticResource NullToFalseConverter}}" />-->
|
<!--<Label FormattedText="{Binding Item.LegendaryActions, Converter={StaticResource HtmlNodesToFormattedStringConverter}}" IsVisible="{Binding Item.LegendaryActions, Converter={StaticResource NullToFalseConverter}}" />-->
|
||||||
<mdview:MarkdownView HorizontalOptions="FillAndExpand" Markdown="{Binding Item.LegendaryActions, Converter={StaticResource HtmlNodesToFormattedStringConverter}}" IsVisible="{Binding Item.LegendaryActions, Converter={StaticResource NullToFalseConverter}}" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding Item.LegendaryActions, Converter={StaticResource HtmlNodesToFormattedStringConverter}}" IsVisible="{Binding Item.LegendaryActions, Converter={StaticResource NullToFalseConverter}}" />
|
||||||
|
|
||||||
<!--<ListView ItemsSource="{Binding Item.SpecialFeaturesNodes}">
|
<!--<ListView ItemsSource="{Binding Item.SpecialFeaturesNodes}">
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue