这是XAML代码。抛出属性{StaticResource LabelStyle}
值超出范围。 [Line: 177 Position: 44]
说XAML解析异常发生。
<controls:ChildWindow xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input" x:Class="BP.SDC.MyDataCentre.UI.Request.RecalculationStatus"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Local="clr-namespace:BP.SDC.MyDataCentre.UI.Request"
xmlns:common="clr-namespace:BP.SDC.MyDataCentre.SL.Utility;assembly=BP.SDC.MyDataCentre.SL.Utility"
xmlns:TelerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
Width="Auto" MaxHeight="1500" Height="auto"
Title="Recalculate">
<controls:ChildWindow.Resources>
<Local:StatusValueConverter x:Key="StatusValueConverter" />
</controls:ChildWindow.Resources>
<Border BorderBrush="Black" BorderThickness="0">
<controlsToolkit:BusyIndicator
x:Name="busyIndicator"
IsBusy="{Binding}" Style="{StaticResource BusyIndicatorStyle}">
<Grid x:Name="LayoutRoot" Background="White" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="50"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="50"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal"
Width="250" Margin="0,0,0,0" HorizontalAlignment="Left" >
<TextBlock Name="SummaryLabel" Foreground="Red" Grid.Row="1" Grid.Column="0"
HorizontalAlignment="Left"
VerticalAlignment="Bottom" Margin="15,5,10,5" />
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="RecalButton" Style="{StaticResource ButtonStyle}" Grid.Row="1" Grid.Column="1"
Content="Recalculate" Click="RecalButton_Click"
Width="100" Height="23" />
<TextBlock Text=" "></TextBlock>
<Button x:Name="btnHelpRecalc" ToolTipService.ToolTip="Help" Tag="Help-106"
Style="{StaticResource ButtonStyle}" Width="23" Cursor="Hand" Margin="0,0,13,0">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="Images/HelpIcon.PNG"></Image>
</StackPanel>
</Button.Content>
</Button>
</StackPanel>
<telerikGridView:RadGridView x:Name="radGridRecalc"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Grid.Row="2"
Grid.ColumnSpan="2"
RowIndicatorVisibility="Collapsed"
AutoGenerateColumns="False"
DataLoadMode="Asynchronous"
ShowInsertRow="False"
IsReadOnly="True"
ShowGroupPanel="False"
Height="auto"
Width="auto"
MaxHeight="200"
Margin="10,0,10,0"
ScrollViewer.HorizontalScrollBarVisibility ="Auto"
SelectionChanged="StatusSelectionChanged" >
<telerikGridView:RadGridView.Columns>
<telerikGridView:GridViewDataColumn Header="#"
HeaderTextAlignment="Center"
HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}"
IsReorderable="False"
IsResizable="False"
IsFilterable="False"
UniqueName="HostRowNumber"
x:Name="HostNumber"
DataMemberBinding="{Binding RowNumber}"
Width="40"
TextAlignment="Center"
IsReadOnly="True" />
<telerikGridView:GridViewDataColumn Header="HostName"
HeaderTextAlignment="Center"
HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}"
IsReorderable="False"
IsResizable="True"
UniqueName="HostName"
IsSortable="True"
x:Name="HostName"
TextWrapping="Wrap"
DataMemberBinding="{Binding HostName}"
Width="340"
TextAlignment="Center"
IsReadOnly="True" />
<telerikGridView:GridViewDataColumn Header="Status"
HeaderTextAlignment="Center"
HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}"
IsReorderable="False"
IsResizable="True"
UniqueName="Status"
x:Name="Status"
DataMemberBinding="{Binding CalcStatus}"
TextAlignment="Center"
Width="100"
IsReadOnly="True" >
<telerikGridView:GridViewDataColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<Image Source="{Binding CalcStatus, Converter={StaticResource StatusValueConverter}}"
Name="statusImage"
Height="20"
Width="25" />
</StackPanel>
</DataTemplate>
</telerikGridView:GridViewDataColumn.CellTemplate>
</telerikGridView:GridViewDataColumn>
<telerikGridView:GridViewDataColumn
Header="Reasons"
HeaderTextAlignment="Center"
HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}"
IsReorderable="False"
IsResizable="True"
UniqueName="Reasons"
IsSortable="True"
TextWrapping="Wrap"
DataMemberBinding="{Binding Reasons}"
Width="150"
TextAlignment="Center"
IsReadOnly="True"
IsVisible="False"/>
<telerikGridView:GridViewDataColumn Header="RecalcDate"
HeaderTextAlignment="Center"
HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}"
IsReorderable="False"
IsResizable="True"
UniqueName="RecalDate"
IsSortable="True"
TextWrapping="Wrap"
DataMemberBinding="{Binding RecalDate}"
Width="150"
TextAlignment="Center"
IsReadOnly="True"
IsVisible="False"
></telerikGridView:GridViewDataColumn>
</telerikGridView:RadGridView.Columns>
</telerikGridView:RadGridView>
<StackPanel Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="2" Margin="15,10,0,0"
HorizontalAlignment="Right">
<Button x:Name="ExportButton" Style="{StaticResource ButtonStyle}"
Click="ExportButton_Click" Width="110" Height="23"
HorizontalAlignment="Right" >
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="Images/pdf.jpg"></Image>
<TextBlock Text="Purchase Order"
HorizontalAlignment="Left" VerticalAlignment="Center"/>
</StackPanel>
</Button.Content>
</Button>
<Button x:Name="SubmitButton" Style="{StaticResource ButtonStyle}"
Content="Submit to Rocela" Click="SubmitButton_Click"
Width="105" Height="23" HorizontalAlignment="Right"
Margin="10,0,0,0"/>
<Button x:Name="CloseButton" Style="{StaticResource ButtonStyle}"
Content="Close" Click="CloseButton_Click" Width="50" Height="23"
HorizontalAlignment="Right" Margin="10,0,11,0" />
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Row="4" Grid.ColumnSpan="2" Margin="0,20,0,10">
<TextBlock Style="{StaticResource LabelStyle}" Margin="10,0,0,5"
Grid.Row="5" Name="tbReason"
TextWrapping="Wrap" HorizontalAlignment="Left"/>
<Border x:Name="borderStatus" BorderBrush="Black" BorderThickness="0" Width="500"
Margin="10,0,10,0" HorizontalAlignment="Left">
<ScrollViewer VerticalScrollBarVisibility="Auto" Height="100" >
<TextBox Style="{StaticResource LabelStyle}"
Name="tbErrors" HorizontalAlignment="Left"
TextWrapping="Wrap" Grid.Row="6" IsReadOnly="True" />
</ScrollViewer>
</Border>
<TextBlock Style="{StaticResource LabelStyle}" Name="tbDate"
HorizontalAlignment="Left" TextWrapping="Wrap"
Margin="10,15,0,0" Grid.Row="7"/>
<!--<TextBlock Style="{StaticResource LabelStyle}" Name="ElapsedTimeCheck" HorizontalAlignment="Left" Margin="15,5,0,0" TextWrapping="Wrap" Grid.Row="8" />-->
<TextBlock Name="NoteLabel"
Grid.Row="8"
HorizontalAlignment="Left" TextWrapping="Wrap"
Text="***Please Edit and Verify 'Buy/Rent' options and Save the failed server(s)."
Style="{StaticResource LabelStyle}" Foreground="Black" FontStyle="Italic"
Margin="10,15,0,10"></TextBlock>
<TextBlock x:Name="lblMessage" Grid.Row="9"
Margin="0,10,10,15" VerticalAlignment="Top"
Height="Auto" Width="Auto" Style="{StaticResource LabelStyle}"
Visibility="Collapsed" TextWrapping="Wrap" HorizontalAlignment="Left">
</TextBlock>
</StackPanel>
</Grid>
</controlsToolkit:BusyIndicator>
</Border>
</controls:ChildWindow>
答案 0 :(得分:0)
根据此处提供的命名约定,您似乎尝试使用TargetType
Label
TextBlock
样式的样式LabelStyle
。目标类型不匹配会引发这种异常。
检查{{1}}的目标类型。
如果这没有帮助,内部异常可能在这里有更多的帮助 - 有一个吗?它是什么?