Crash with InlineUIContainer inside a style
Posted: 04 Dec 2019, 11:22
Hi,
We have encountered a crash within Noesis while using InlineUIContainers inside of a style. We tested this in our engine and using the xaml player that comes with Noesis. We are running on 2.2.5.
Below is a snippet that crashes (Note: This is a watered down version of our xaml), look for the comments in the xaml for more information on where it crashes.
Is this a known issue?
We have encountered a crash within Noesis while using InlineUIContainers inside of a style. We tested this in our engine and using the xaml player that comes with Noesis. We are running on 2.2.5.
Below is a snippet that crashes (Note: This is a watered down version of our xaml), look for the comments in the xaml for more information on where it crashes.
Code: Select all
<Window x:Class="Buttons.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:local="clr-namespace:Buttons"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions"
Title="NoesisGUI - Buttons"
d:DesignWidth="1468" d:DesignHeight="1015.5">
<Window.Resources>
<Style x:Key="MovementButton" TargetType="{x:Type ToggleButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="#Another" FontSize="21" Foreground="#FFFFFF">
<Run Text="Hello"/><Run Text="/"/><Run Text="World"/>
<InlineUIContainer>
<InlineUIContainer.Child>
<Rectangle Fill="#FF00FFFF" Width="12" Height="12"/>
</InlineUIContainer.Child>
</InlineUIContainer>
</TextBlock>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80*"/>
<RowDefinition Height="800*"/>
<RowDefinition Height="120*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="900*"/>
<ColumnDefinition Width="60*"/>
</Grid.ColumnDefinitions>
<!-- This inline container works -->
<TextBlock Grid.Column="1" Foreground="#EEEEEE" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="#Another" FontSize="21">
<Run Text="Hello"/><Run Text="/"/><Run Text="World"/>
<InlineUIContainer>
<InlineUIContainer.Child>
<Rectangle Fill="#FFFF00FF" Width="12" Height="12"/>
</InlineUIContainer.Child>
</InlineUIContainer>
</TextBlock>
<!-- This inline container DOESNT work -->
<ToggleButton Grid.Column="1" Grid.Row="1" Style="{StaticResource MovementButton}" IsEnabled="False"/>
</Grid>
</Window>