mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-11-04 01:00:23 +00:00 
			
		
		
		
	Style variable en fonction du header
This commit is contained in:
		
							parent
							
								
									955ec2eaba
								
							
						
					
					
						commit
						55f522cb55
					
				
					 2 changed files with 21 additions and 1 deletions
				
			
		| 
						 | 
					@ -33,4 +33,23 @@ namespace AideDeJeu.Tools
 | 
				
			||||||
            return null;
 | 
					            return null;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public class HeaderLevelToStyleConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var level = value as int?;
 | 
				
			||||||
 | 
					            if(level.HasValue)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return Application.Current.Resources[$"heading{level.Value+1}"];
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return Application.Current.Resources["paragraph"];
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return null;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,6 +12,7 @@
 | 
				
			||||||
        <ResourceDictionary>
 | 
					        <ResourceDictionary>
 | 
				
			||||||
            <tools:MonsterMarkdownTheme x:Key="MonsterMarkdownTheme" />
 | 
					            <tools:MonsterMarkdownTheme x:Key="MonsterMarkdownTheme" />
 | 
				
			||||||
            <tools:NullToFalseConverter x:Key="NullToFalseConverter" />
 | 
					            <tools:NullToFalseConverter x:Key="NullToFalseConverter" />
 | 
				
			||||||
 | 
					            <tools:HeaderLevelToStyleConverter x:Key="HeaderLevelToStyleConverter" />
 | 
				
			||||||
        </ResourceDictionary>
 | 
					        </ResourceDictionary>
 | 
				
			||||||
    </ContentPage.Resources>
 | 
					    </ContentPage.Resources>
 | 
				
			||||||
    <ContentPage.ToolbarItems>
 | 
					    <ContentPage.ToolbarItems>
 | 
				
			||||||
| 
						 | 
					@ -29,7 +30,7 @@
 | 
				
			||||||
            <DataTemplate>
 | 
					            <DataTemplate>
 | 
				
			||||||
                <ViewCell AutomationProperties.IsInAccessibleTree="True" AutomationId="machin" AutomationProperties.Name="hop">
 | 
					                <ViewCell AutomationProperties.IsInAccessibleTree="True" AutomationId="machin" AutomationProperties.Name="hop">
 | 
				
			||||||
                    <StackLayout Padding="10" Orientation="Vertical">
 | 
					                    <StackLayout Padding="10" Orientation="Vertical">
 | 
				
			||||||
                        <Label Text="{Binding DisplayName}" LineBreakMode="NoWrap" Style="{DynamicResource subsubsection}" FontSize="16" />
 | 
					                        <Label Text="{Binding DisplayName}" LineBreakMode="NoWrap" Style="{Binding NameLevel,Converter={StaticResource HeaderLevelToStyleConverter}}" />
 | 
				
			||||||
                        <Label Text="{Binding AltNameText}" LineBreakMode="NoWrap" Style="{DynamicResource subsubsection}" FontSize="12" />
 | 
					                        <Label Text="{Binding AltNameText}" LineBreakMode="NoWrap" Style="{DynamicResource subsubsection}" FontSize="12" />
 | 
				
			||||||
                    </StackLayout>
 | 
					                    </StackLayout>
 | 
				
			||||||
                </ViewCell>
 | 
					                </ViewCell>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue