1
Vote

StringFormat bug

description

Hello!
I use Beauty xaml 2.0.0 in VS2012 Ultimate Update2. My correct code part
<ControlTemplate x:Key="ChanPacksTemplate">
        <Grid>
            <Rectangle x:Name="Rect"
                       Margin="0,2"
                       Fill="#FFAEFFAE"
                       RadiusX="1"
                       RadiusY="1">
                <Rectangle.RenderTransform>
                    <ScaleTransform CenterX="0" ScaleX="{Binding RowData.Row.Packs.Percent}" />
                </Rectangle.RenderTransform>
            </Rectangle>
            <TextBlock x:Name="PercentText"
                       Margin="2,0,2,0"
                       VerticalAlignment="Center"
                       FontSize="8"
                       Text="{Binding RowData.Row.Packs.Percent,
                                      StringFormat=P0}" />
            <TextBlock Margin="2,0"
                       HorizontalAlignment="Right"
                       VerticalAlignment="Center"
                       Text="{Binding Value, StringFormat={}{0:#,#}, ConverterCulture={x:Static Globalization:CultureInfo.CurrentCulture}}" />
        </Grid>
        <ControlTemplate.Triggers>

            <DataTrigger Binding="{Binding RowData.Row.Packs.Percent}" Value="0">
                <Setter TargetName="PercentText" Property="Visibility" Value="Hidden" />
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
Beauty Xaml replace TextBlock Text attribute value Text="{Binding Value, StringFormat={}{0:#,#}, ConverterCulture={x:Static Globalization:CultureInfo.CurrentCulture}}" to incorrect:
<ControlTemplate x:Key="ChanPacksTemplate">
        <Grid>
            <Rectangle x:Name="Rect"
                       Margin="0,2"
                       Fill="#FFAEFFAE"
                       RadiusX="1"
                       RadiusY="1">
                <Rectangle.RenderTransform>
                    <ScaleTransform CenterX="0" ScaleX="{Binding RowData.Row.Packs.Percent}" />
                </Rectangle.RenderTransform>
            </Rectangle>
            <TextBlock x:Name="PercentText"
                       Margin="2,0,2,0"
                       VerticalAlignment="Center"
                       FontSize="8"
                       Text="{Binding RowData.Row.Packs.Percent,
                                      StringFormat=P0}" />
            <TextBlock Margin="2,0"
                       HorizontalAlignment="Right"
                       VerticalAlignment="Center"
                       Text="{Binding Value,
                                      #,
                                      StringFormat={}{0:#}" />
        </Grid>
        <ControlTemplate.Triggers>

            <DataTrigger Binding="{Binding RowData.Row.Packs.Percent}" Value="0">
                <Setter TargetName="PercentText" Property="Visibility" Value="Hidden" />
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
Build with error "Unknown build error, 'Input string was not in a correct format. Line ... Position ...'"

comments