Note that there are some explanatory texts on larger screens.

plurals
  1. POLocbaml error when using VisualStateManager in Framework 3.5
    primarykey
    data
    text
    <p>When I translated the Tester.WPF.resources.dll, I get an error. It's like the baml file have modified VisualStateGroup to an collection. I don't understand. The poject starts up without any problem in the default language, but if I change the culture, it crashes. I Rebuild it, still that error, even when a start from scratch. With this small test project and still get the same error:</p> <pre><code>Object of type 'System.Windows.VisualStateGroup' cannot be converted to type 'System.Collections.ObjectModel.Collection`1[System.Windows.VisualStateGroup]'. </code></pre> <p>StackTrace</p> <pre><code> at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType) at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.SetClrComplexProperty(Object parentObject, MemberInfo memberInfo, Object o) at System.Windows.Markup.BamlRecordReader.SetPropertyValueToParent(Boolean fromStartTag, Boolean&amp; isMarkupExtension) at System.Windows.Markup.BamlRecordReader.ReadElementEndRecord(Boolean fromNestedBamlRecordReader) at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord) at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment() at System.Windows.Markup.TreeBuilder.Parse() at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) at Tester.WPF.Window1.InitializeComponent() </code></pre> <p>TestWindow</p> <pre><code>&lt;Window x:Class="Arofex.Translator.Tester.WPF.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" xmlns:Controlsw="clr-namespace:System.Windows;assembly=WPFToolkit" &gt; &lt;Grid&gt; &lt;Border x:Name="LayoutRoot" BorderThickness="1" BorderBrush="Red" RenderTransformOrigin="0.5,0.5" Width="500" CornerRadius="5" Margin="0,0,0,30"&gt; &lt;Border.RenderTransform&gt; &lt;TransformGroup&gt; &lt;ScaleTransform/&gt; &lt;SkewTransform/&gt; &lt;RotateTransform/&gt; &lt;TranslateTransform/&gt; &lt;/TransformGroup&gt; &lt;/Border.RenderTransform&gt; &lt;Controlsw:VisualStateManager.VisualStateGroups&gt; &lt;Controlsw:VisualStateGroup x:Name="VSGVisiblbe"&gt; &lt;Controlsw:VisualStateGroup.Transitions&gt; &lt;VisualTransition GeneratedDuration="00:00:00.2000000"/&gt; &lt;/Controlsw:VisualStateGroup.Transitions&gt; &lt;Controlsw:VisualState x:Name="StateNormal"/&gt; &lt;Controlsw:VisualState x:Name="StateStart"&gt; &lt;Storyboard&gt; &lt;DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"&gt; &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.034"/&gt; &lt;/DoubleAnimationUsingKeyFrames&gt; &lt;DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"&gt; &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="-57"/&gt; &lt;/DoubleAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;/Controlsw:VisualState&gt; &lt;/Controlsw:VisualStateGroup&gt; &lt;/Controlsw:VisualStateManager.VisualStateGroups&gt; &lt;StackPanel Orientation="Vertical" Background="LightGray"&gt; &lt;TextBlock Text="My text to test translation" /&gt; &lt;/StackPanel&gt; &lt;/Border&gt; </code></pre> <p> </p> <p>App code</p> <pre><code> private void Application_Startup(object sender, StartupEventArgs e) { Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-BE"); Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-BE"); var dictionaryList = new List&lt;Uri&gt;(); foreach (ResourceDictionary dictionary in Application.Current.Resources.MergedDictionaries) dictionaryList.Add(dictionary.Source); Application.Current.Resources.MergedDictionaries.Clear(); foreach (Uri uri in dictionaryList) Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = uri }); } } </code></pre> <p>Thanks for any suggestion.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload