mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-29 22:45:44 +00:00
Header
This commit is contained in:
parent
e2b65754b2
commit
c65849a772
4 changed files with 15 additions and 5 deletions
|
|
@ -33,6 +33,7 @@ namespace AideDeJeuLib
|
|||
if (this.Name == null)
|
||||
{
|
||||
this.Name = headingBlock.Inline.ToMarkdownString();
|
||||
this.NameLevel = headingBlock.Level - 1;
|
||||
}
|
||||
this.Text += block.ToMarkdownString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue