[SOLVED] TryParse is not a function

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
thatrickguy
Posts: 4
Joined: Mon Nov 27, 2017 8:10 am

[SOLVED] TryParse is not a function

Postby thatrickguy » Wed Dec 27, 2017 1:21 pm

Using the updated beta 13 release 2.

CSharpXamlForHtml5.js?201712271432:14728 Uncaught TypeError: $T06(...).TryParse is not a function
at Object.TypeFromStringConverters_ConvertByteFromString (CSharpXamlForHtml5.js?201712271432:14728)
at Delegate_Invoke (JSIL.Core.js?201712271432:9346)
at Object.TypeFromStringConverters_ConvertFromInvariantString (CSharpXamlForHtml5.js?201712271432:14755)
at Calculator1_MainPage.MainPage_InitializeComponent (Calculator1.js?201712271432:661)
at Calculator1_MainPage.MainPage__ctor (Calculator1.js?201712271432:380)
at Calculator1_MainPage (Calculator1.MainPage:17)
at Calculator1_App.App__ctor (Calculator1.js?201712271432:135)
at Calculator1_App (Calculator1.App:17)
at runMain (index.html:32)
at browserFinishedLoadingCallback (JSIL.Browser.js?201712271432:1138)

thrown by:
function TypeFromStringConverters_ConvertByteFromString (str) {
var b = new JSIL.BoxedVariable(0);
if (!$T06()['TryParse'](str, /* ref */ b)) {
throw $S01().Construct(("Xaml exception: cannot convert \"" + str + "\" to byte. To fix the issue, please locate the error by looking for the first XAML file in the Stack Trace."));
}
return b.get();
};


Occurs when I have a rectangle with a set width, no height specified, in a stack panel that is stretched vertically, only if I specify the fill brush as a child element. For example, this code throws the above error. But if I comment out all of the Rectangle.Fill children and put Fill="red" as an attribute of the Rectangle definition, it works fine. The .Fill child works fine on rectangles that are not in the stack panel, so it's a bit of an oddity.

Code: Select all

       <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Stretch">
                <Rectangle Width="5" Margin="15 0 0 0">
                    <Rectangle.Fill>
                        <SolidColorBrush>
                            <SolidColorBrush.Color>
                                <Color R="140" G="80" B="80" A="255"></Color>
                            </SolidColorBrush.Color>
                        </SolidColorBrush>
                    </Rectangle.Fill>
                </Rectangle>
                <Rectangle Width="95">
                   <!--<Rectangle.Fill>
                        <SolidColorBrush>
                            <SolidColorBrush.Color>
                                <Color R="80" G="0" B="0" A="255"></Color>
                            </SolidColorBrush.Color>
                        </SolidColorBrush>
                    </Rectangle.Fill>-->
                </Rectangle>
                <Rectangle Width="5" Margin="0 0 15 0">
                    <!--<Rectangle.Fill>
                        <SolidColorBrush>
                            <SolidColorBrush.Color>
                                <Color R="140" G="80" B="80" A="255"></Color>
                            </SolidColorBrush.Color>
                        </SolidColorBrush>
                    </Rectangle.Fill>-->
                </Rectangle>
            </StackPanel>


Thanks,
-Rick

thatrickguy
Posts: 4
Joined: Mon Nov 27, 2017 8:10 am

Re: TryParse is not a function

Postby thatrickguy » Wed Dec 27, 2017 2:20 pm

I was able to get around this by defining the color as a hex value inline rather than as a child.

Thanks,
-Rick

JS-Support @Userware
Site Admin
Posts: 885
Joined: Tue Apr 08, 2014 3:42 pm

Re: TryParse is not a function

Postby JS-Support @Userware » Thu Dec 28, 2017 1:48 am

Thanks Rick. We are going to fix this issue asap.

Regards
JS-Support

JS-Support @Userware
Site Admin
Posts: 885
Joined: Tue Apr 08, 2014 3:42 pm

Re: TryParse is not a function

Postby JS-Support @Userware » Fri Jan 12, 2018 10:34 am

Hi,

This issue has been fixed in v1.0 Beta 13.2, which you can download from:

http://forums.cshtml5.com/viewforum.php?f=6

Thanks.
Regards,
JS-Support


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 1 guest

 

 

cron