Good morning everyone!
I'm absolutely thrilled about the upcoming new version. But to come back to the initial question: Is there any way to do it in the
current version of Noesis?
In my case: I'm on Unity 2021.1.13f1 using the Noesis 3.0.12 unity package and building for Android. Here's a snipped from the code I wrote so far:
<Grid Grid.Row="3" VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*" />
<ColumnDefinition Width="90*" />
<ColumnDefinition Width="5*" />
</Grid.ColumnDefinitions>
<Viewbox Grid.Column="1">
<ListBox ItemsSource="{Binding LogEntries}">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="10*" />
<RowDefinition Height="5*" />
<RowDefinition Height="85*" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
FontWeight="Bold"
FontSize="10"
TextWrapping="Wrap">
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} | Age {1}">
<Binding Path="Month" Converter="{StaticResource MonthConverter}" />
<Binding Path="Age" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<TextBlock Grid.Row="2"
TextWrapping="Wrap"
FontSize="10"
Text="{Binding Message}" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Viewbox>
</Grid>
And this is how it looks like:
The content of the message can vary a lot between a few words and multiple sentences. So the overall FontSize within this Grid ia primarily based on the content of the message.
That's not the desired behavior, the font size should stay the same independent from what the content is and especially on which device it runs.
Is there any way in the current version of Noesis to keep the same FontSize independent from the contents and from the DPI of the device?
Thank you in advance :)