[Unity][Bug?] Negative Padding crashes complete UI on load
Posted: 13 May 2018, 20:56
Hello,
I have a XAML Style where I want to produce an overflow text on a button.
Works obviously great in MS Blend. But crash the UI complete in Noesis.
I've tested it so far that I can say that as soon as there's only a single minus sign in Padding, it crashes.
I hope it's a bug, how else should I create a text that overlays the button? Although there is still a way, but Padding in Noesis should be able to do that in my opinion.
If it's a bug, it's also possible to open an entry in the bug tracker, but I'm not sure.
Btw...
Removing all minus works great like this:
Here the complete XAML if you need it.
I have a XAML Style where I want to produce an overflow text on a button.
Code: Select all
<Setter Property="Padding" Value="-1,-10,-1,-2"/>I've tested it so far that I can say that as soon as there's only a single minus sign in Padding, it crashes.
I hope it's a bug, how else should I create a text that overlays the button? Although there is still a way, but Padding in Noesis should be able to do that in my opinion.
If it's a bug, it's also possible to open an entry in the bug tracker, but I'm not sure.
Code: Select all
NoesisException: '-1,-10,-1,-2' (.?AV?$Boxed@UThickness@Noesis@@@Noesis@@) is not a valid value for property 'Border.Padding'
Rethrow as NoesisException
Noesis.Error.Check () (at Assets/NoesisGUI/Plugins/API/Core/NoesisError.cs:17)
Noesis.View.Noesis_View_Create_ (HandleRef content) (at Assets/NoesisGUI/Plugins/API/Core/NoesisView.cs:402)
Noesis.View..ctor (Noesis.FrameworkElement content) (at Assets/NoesisGUI/Plugins/API/Core/NoesisView.cs:386)
NoesisView.CreateView (Noesis.FrameworkElement content) (at Assets/NoesisGUI/Plugins/NoesisView.cs:1036)
NoesisView.LoadXaml (Boolean force) (at Assets/NoesisGUI/Plugins/NoesisView.cs:340)
NoesisView.OnEnable () (at Assets/NoesisGUI/Plugins/NoesisView.cs:398)
Removing all minus works great like this:
Code: Select all
<Setter Property="Padding" Value="1,10,1,2"/>Code: Select all
<UserControl x:Class="CaveDigger.UI.Views.Controls.ChunkEditView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:CaveDigger.UI.Views.Controls"
xmlns:hkConverters="clr-namespace:HeiKyu.Framework.XAML.Converter;assembly=HeiKyu.Framework.XAML"
xmlns:world="clr-namespace:CaveDigger.Scripts.World"
mc:Ignorable="d" >
<Grid Background="{DynamicResource Brush.Background.Sidebar}" VerticalAlignment="Top" Margin="0">
<StackPanel>
<Label Content="Press CTRL to avoid confirmation" Style="{DynamicResource LabelNormal}" />
<Grid>
<Grid.Resources>
<Style x:Key="ButtonPlusMinus" TargetType="{x:Type Button}">
<Setter Property="Width" Value="20"/>
<Setter Property="Height" Value="20"/>
<Setter Property="FontSize" Value="25"/>
<Setter Property="Padding" Value="-1,-10,-1,-2"/>
</Style>
<Style x:Key="ButtonPlus" TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonPlusMinus}">
<Setter Property="Content" Value="+"/>
<Setter Property="Background" Value="{DynamicResource Brush.Background.LightBlue}"/>
<Setter Property="Command" Value="{Binding DataContext.ChunkAddCommand, ElementName=MainEditor}"/>
</Style>
<Style x:Key="ButtonMinus" TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonPlusMinus}">
<Setter Property="Content" Value="-"/>
<Setter Property="Background" Value="{DynamicResource Brush.Background.LightRed}"/>
<Setter Property="Command" Value="{Binding DataContext.ChunkRemoveCommand, ElementName=MainEditor}"/>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Content="{Binding DataContext.ChunkRemainingLabelZP, ElementName=MainEditor}" Grid.Column="2" Grid.Row="1" Style="{DynamicResource LabelNormal}"/>
<Label Content="{Binding DataContext.ChunkRemainingLabelXP, ElementName=MainEditor}" Grid.Column="3" Grid.Row="2" Style="{DynamicResource LabelNormal}"/>
<Label Content="{Binding DataContext.ChunkRemainingLabelZM, ElementName=MainEditor}" Grid.Column="2" Grid.Row="3" Style="{DynamicResource LabelNormal}"/>
<Label Content="{Binding DataContext.ChunkRemainingLabelXM, ElementName=MainEditor}" Grid.Column="1" Grid.Row="2" Style="{DynamicResource LabelNormal}"/>
<StackPanel Orientation="Vertical" Grid.Column="2" Grid.Row="0">
<Button Style="{DynamicResource ButtonPlus}" CommandParameter="{x:Static world:Orientation.ZP}" IsEnabled="{Binding DataContext.ChunkCanAddZP, ElementName=MainEditor}"/>
<Button Style="{DynamicResource ButtonMinus}" CommandParameter="{x:Static world:Orientation.ZP}" IsEnabled="{Binding DataContext.ChunkCanRemoveZP, ElementName=MainEditor}"/>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Column="2" Grid.Row="5">
<Button Style="{DynamicResource ButtonMinus}" CommandParameter="{x:Static world:Orientation.ZM}" IsEnabled="{Binding DataContext.ChunkCanAddZM, ElementName=MainEditor}"/>
<Button Style="{DynamicResource ButtonPlus}" CommandParameter="{x:Static world:Orientation.ZM}" IsEnabled="{Binding DataContext.ChunkCanRemoveZM, ElementName=MainEditor}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="2">
<Button Style="{DynamicResource ButtonPlus}" CommandParameter="{x:Static world:Orientation.XM}" IsEnabled="{Binding DataContext.ChunkCanAddXM, ElementName=MainEditor}"/>
<Button Style="{DynamicResource ButtonMinus}" CommandParameter="{x:Static world:Orientation.XM}" IsEnabled="{Binding DataContext.ChunkCanRemoveXM, ElementName=MainEditor}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="5" Grid.Row="2">
<Button Style="{DynamicResource ButtonMinus}" CommandParameter="{x:Static world:Orientation.XP}" IsEnabled="{Binding DataContext.ChunkCanAddXP, ElementName=MainEditor}"/>
<Button Style="{DynamicResource ButtonPlus}" CommandParameter="{x:Static world:Orientation.XP}" IsEnabled="{Binding DataContext.ChunkCanRemoveXP, ElementName=MainEditor}"/>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
</UserControl>