Hard Crash with lisbox on ipad only !
Posted: 15 Apr 2014, 14:30
Hi i have a hard crash with a listbox populated by a usercontrols list as itemsource.
The bug only accure on my ipad not in the editor, not on osx build, not windows, not test to android.
crash xcode
https://drive.google.com/file/d/0B7tPUW ... sp=sharing
in my editor
https://drive.google.com/file/d/0B7tPUW ... sp=sharing
The error happen when i select an element in my listbox, i populated it with a usercontrol and making a resources form the listboxitem in my panel.
this is my xaml
I'm going to try some thing and i will continue this topic thanks
The bug only accure on my ipad not in the editor, not on osx build, not windows, not test to android.
crash xcode
https://drive.google.com/file/d/0B7tPUW ... sp=sharing
in my editor
https://drive.google.com/file/d/0B7tPUW ... sp=sharing
The error happen when i select an element in my listbox, i populated it with a usercontrol and making a resources form the listboxitem in my panel.
this is my xaml
Code: Select all
<UserControl
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"
x:Class="ItemListControl"
x:Name="MyListControl"
d:DesignWidth="640" d:DesignHeight="480" Width="Auto" Height="760" HorizontalAlignment="Left" VerticalAlignment="Center">
<UserControl.Resources>
<Style x:Key="ButtonFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" SnapsToDevicePixels="true" StrokeThickness="1" StrokeDashArray="1 2"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#F3F3F3" Offset="0"/>
<GradientStop Color="#EBEBEB" Offset="0.5"/>
<GradientStop Color="#DDDDDD" Offset="0.5"/>
<GradientStop Color="#CDCDCD" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
<Style x:Key="ButtonInfo" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid HorizontalAlignment="Stretch" Height="Auto" VerticalAlignment="Stretch" Width="Auto" Margin="0">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver"/>
<VisualState x:Name="Pressed">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="rectangle">
<EasingColorKeyFrame KeyTime="0" Value="#FF0D8D00"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="rectangle1">
<EasingColorKeyFrame KeyTime="0" Value="#FF3BB13C"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="rectangle" HorizontalAlignment="Stretch" Height="Auto" Stroke="#FF00B922" VerticalAlignment="Stretch" Width="Auto" RadiusX="5" RadiusY="5">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
<GradientStop Color="#FF65F230" Offset="1"/>
<GradientStop Color="#FF7DE694"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle x:Name="rectangle1" HorizontalAlignment="Stretch" Height="20" Stroke="{x:Null}" VerticalAlignment="Top" Width="Auto" RadiusX="5" RadiusY="5" Margin="2.667,2,2.667,0" Opacity="0.5">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
<GradientStop Color="#FF2FE258" Offset="1"/>
<GradientStop Color="#FFE9FFEE"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Ellipse HorizontalAlignment="Stretch" Height="10" Margin="39.563,0,39.563,8.994" Stroke="{x:Null}" VerticalAlignment="Bottom" Width="10" Panel.ZIndex="2" Fill="White"/>
<Rectangle Height="Auto" Margin="39.563,10,39.563,23.875" RadiusY="5" RadiusX="5" Stroke="{x:Null}" VerticalAlignment="Stretch" Width="10" Panel.ZIndex="2" Fill="White"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="true"/>
<Trigger Property="ToggleButton.IsChecked" Value="true"/>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="#ADADAD"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--template pour les items-->
<DataTemplate x:Key="ListItem">
<Grid x:Name="item">
<Rectangle Fill="#FFEEEEEE" Stroke="#FF00B418" Width="300" StrokeThickness="0.5"/>
<TextBlock x:Name="ItemBlock" HorizontalAlignment="Left" Height="90" Margin="10,5,0,0" TextWrapping="Wrap" Text="{Binding Label}" VerticalAlignment="Top" Width="191" FontSize="16" FontWeight="Bold"/>
</Grid>
</DataTemplate>
<!--template pour les items selectionnés-->
<DataTemplate x:Key="SelectedItem">
<Grid x:Name="itemclicked">
<Rectangle Stroke="#FF00B418" Width="300" StrokeThickness="0.5">
<Rectangle.Fill>
<RadialGradientBrush GradientOrigin="0.515,1.075" Center="0.515,1.033" RadiusY="0.8" RadiusX="0.8">
<GradientStop Color="#FF68E684" Offset="0.064"/>
<GradientStop Color="White" Offset="1"/>
</RadialGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Button Content="Detail" Margin="206,5,4.874,5.795" Command="{Binding ShowCommentCommand}" Style="{DynamicResource ButtonInfo}" RenderTransformOrigin="0.5,0.5">
</Button>
<TextBlock x:Name="ItemBlock" HorizontalAlignment="Left" Height="90" Margin="10,5,0,0" TextWrapping="Wrap" Text="{Binding Label}" VerticalAlignment="Top" Width="191" FontSize="16" FontWeight="Bold"/>
</Grid>
</DataTemplate>
<Style TargetType="{x:Type ListBoxItem}" x:Key="ContainerStyle">
<Setter Property="ContentTemplate" Value="{StaticResource ListItem}" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="ContentTemplate" Value="{StaticResource SelectedItem}" />
</Trigger>
</Style.Triggers>
</Style>
<Storyboard x:Key="AppearPanelStoryboard">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutRoot">
<EasingDoubleKeyFrame KeyTime="0" Value="-1039"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0">
<EasingDoubleKeyFrame.EasingFunction>
<BackEase EasingMode="EaseOut" Amplitude="-12"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<SolidColorBrush x:Key="ListBorder" Color="#828790"/>
</UserControl.Resources>
<UserControl.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource AppearPanelStoryboard}"/>
</EventTrigger>
</UserControl.Triggers>
<Grid x:Name="LayoutRoot" RenderTransformOrigin="0.5,0.5" Height="700">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Grid.RenderTransform>
<Grid x:Name="ItemListGrid" Margin="0,23.333,49.333,0" VerticalAlignment="Top" Height="650">
<Rectangle x:Name="panneau_Copy" StrokeThickness="0" Margin="0,0,0,1" Stroke="#FF303030" Panel.ZIndex="-3" VerticalAlignment="Bottom" Height="21">
<Rectangle.Fill>
<RadialGradientBrush RadiusY="0.559">
<GradientStop Color="#75000000" Offset="0.62"/>
<GradientStop Offset="1"/>
</RadialGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle Fill="#FFF4F4F5" Stroke="Black" RadiusY="5" RadiusX="5" StrokeThickness="0" Margin="0,0,0,10"/>
<ListBox x:Name="Collection" Margin="10,10,10,20" PanningMode="VerticalOnly" ItemsSource="{Binding ItemCollection, ElementName=MyListControl}" ItemContainerStyle="{DynamicResource ContainerStyle }">
</ListBox>
<Button x:Name="quitterbtn" Height="50" Style="{DynamicResource GrappeBtnRounded}" VerticalAlignment="Top" Width="50" HorizontalAlignment="Right" Margin="0,-18.331,-20.998,0" Panel.ZIndex="15">
<Path HorizontalAlignment="Left" Stroke="#FF303030" StrokeThickness="0" VerticalAlignment="Top" Width="18.647" Fill="Black" Data="M12.546,0 L18.121,0 18.121,12.546 30.667,12.546 30.667,18.120999 18.121,18.120999 18.121,30.667 12.546,30.667 12.546,18.120999 0,18.120999 0,12.546 12.546,12.546 z" Height="18.647" RenderTransformOrigin="0.500000002985382,0.499999987560905" Stretch="Fill">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform Angle="-45"/>
<TranslateTransform/>
</TransformGroup>
</Path.RenderTransform>
</Path>
</Button>
<Button x:Name="ValiderBtn" Content="Valider" HorizontalAlignment="Right" Height="80" Style="{DynamicResource GrappeBtnRounded}" VerticalAlignment="Bottom" Width="80" FontWeight="Bold" FontSize="16" Margin="0,0,-40,-30" Foreground="Black" RenderTransformOrigin="0.5,0.5"/>
</Grid>
</Grid>
</UserControl>