1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-30 06:56:10 +00:00
This commit is contained in:
Yan Maniez 2018-08-04 23:13:57 +02:00
parent e2b65754b2
commit c65849a772
4 changed files with 15 additions and 5 deletions

View file

@ -33,6 +33,7 @@ namespace AideDeJeuLib
if (this.Name == null)
{
this.Name = headingBlock.Inline.ToMarkdownString();
this.NameLevel = headingBlock.Level - 1;
}
this.Text += block.ToMarkdownString();
}

View file

@ -7,6 +7,14 @@ namespace AideDeJeuLib
public abstract class Item
{
public string Name { get; set; }
public int NameLevel { get; set; }
public string DisplayName
{
get
{
return new string(' ', NameLevel * 4) + Name;
}
}
public string AltName { get; set; }
public string AltNameText
{

View file

@ -29,11 +29,12 @@ namespace AideDeJeuLib
{
get
{
//return "\n\n# test\n\n";
return _Markdown;
}
}
public string Header { get; set; }
public IEnumerator<Item> GetEnumerator()
{
@ -61,12 +62,12 @@ namespace AideDeJeuLib
}
else
{
_Markdown += headingBlock.ToMarkdownString();
Header += headingBlock.ToMarkdownString();
}
}
else
{
_Markdown += block.ToMarkdownString();
Header += block.ToMarkdownString();
}
enumerator.MoveNext();
}

View file

@ -19,13 +19,13 @@
</ContentPage.ToolbarItems>
<ListView BackgroundColor="{StaticResource bgtan}" x:Name="ItemsListView" ItemsSource="{Binding Items}" VerticalOptions="FillAndExpand" HasUnevenRows="true" CachingStrategy="RecycleElement" SelectedItem="{Binding SelectedItem}" ItemTapped="ItemsListView_ItemTapped">
<ListView.Header>
<mdview:MarkdownView x:Name="mdMarkdown" Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding BindingContext.Items.Markdown, Source={x:Reference This}}" BackgroundColor="Red"/>
<mdview:MarkdownView x:Name="mdMarkdown" Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding BindingContext.Items.Header, Source={x:Reference This}}" />
</ListView.Header>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell AutomationProperties.IsInAccessibleTree="True" AutomationId="machin" AutomationProperties.Name="hop">
<StackLayout Padding="10" Orientation="Vertical">
<Label Text="{Binding Name}" LineBreakMode="NoWrap" Style="{DynamicResource subsubsection}" FontSize="16" />
<Label Text="{Binding DisplayName}" LineBreakMode="NoWrap" Style="{DynamicResource subsubsection}" FontSize="16" />
<Label Text="{Binding AltNameText}" LineBreakMode="NoWrap" Style="{DynamicResource subsubsection}" FontSize="12" />
</StackLayout>
</ViewCell>