enhance: use custom JsonConverter instead of converting string to FontFamily in each control

This commit is contained in:
leo 2024-03-21 23:19:09 +08:00
parent 0fadab2ca2
commit 56f5f3b4a7
10 changed files with 49 additions and 49 deletions

View file

@ -17,7 +17,7 @@
BorderThickness="0"
Foreground="{DynamicResource Brush.FG1}"
SecondaryFG="{DynamicResource Brush.FG2}"
FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont, Converter={x:Static c:StringConverters.ToFontFamily}}"
FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont}"
FontSize="12"
DiffData="{Binding}"
SyncScrollOffset="{Binding $parent[v:DiffView].DataContext.(vm:DiffContext).SyncScrollOffset, Mode=TwoWay}"
@ -36,7 +36,7 @@
BorderThickness="0"
Foreground="{DynamicResource Brush.FG1}"
SecondaryFG="{DynamicResource Brush.FG2}"
FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont, Converter={x:Static c:StringConverters.ToFontFamily}}"
FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont}"
FontSize="12"
DiffData="{Binding}"/>
@ -52,7 +52,7 @@
BorderThickness="0"
Foreground="{DynamicResource Brush.FG1}"
SecondaryFG="{DynamicResource Brush.FG2}"
FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont, Converter={x:Static c:StringConverters.ToFontFamily}}"
FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont}"
FontSize="12"
DiffData="{Binding}"/>
</Grid>