我用表格控制了一张表格,在一只新闻图表显示有这种错误时,有第二幅插图:
Cannot convert the value in attribute Property to object of type System.Windows.DependencyProperty . Failed to create a DependencyProperty from the text Background .
i 没有任何制片控制活动,这就是我的数据分析:
<TabControl Name="tabControl1">
<TabItem Name="tabItem1" Header="Logs">
<Grid>
<Grid Background="#FFABABAB">
<Border Name="border1" BorderBrush="Silver" BorderThickness="1" Height="92" VerticalAlignment="Top" Background="AliceBlue" Margin="0,0,1,0">
<Grid>
<Button Name="btnGridToExcel" Content="Export To Excel" Height="23" HorizontalAlignment="Left" Margin="639,58,0,0" VerticalAlignment="Top" Width="92" Click="btnGridToExcel_Click" />
<Button Name="btnReset" Content="Reset/Refresh" Height="23" HorizontalAlignment="Left" Margin="639,24,0,0" VerticalAlignment="Top" Width="92" Click="btnReset_Click" />
</Grid>
</Border>
<DataGrid Name="dataGrid1" AutoGenerateColumns="false" Margin="0,91,1,32" SelectedValuePath="ID" SelectionMode="Extended"
SelectionUnit="CellOrRowHeader" CanUserReorderColumns="false" CanUserAddRows="false" CanUserDeleteRows="false"
IsReadOnly="true" AlternatingRowBackground="#FFF2F4F4" RowBackground="#FFE0E4E3" ItemsSource="{Binding ActionCollection}"
SelectedCellsChanged="dataGrid1_SelectedCellsChanged" >
<DataGrid.ContextMenu>
<ContextMenu>
<MenuItem Name="MenuItemEdit" Header="Edit" Click="MenuItemEdit_Click">
<MenuItem.Icon>
<Image Source="/H-Pro;component/Images/1314285611_edit.png"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Name="MenuItemDelete" Header="Delete" Click="MenuItemDelete_Click">
<MenuItem.Icon>
<Image Source="/H-Pro;component/Images/1314285495_dialog-close.png"/>
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem Name="MenuItemPayment" Header="Pay selected" Click="MenuItemPayment_Click">
<MenuItem.Icon>
<Image Source="/H-Pro;component/Images/1314875051_money_dollar.png"/>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</DataGrid.ContextMenu>
<DataGrid.Columns>
<DataGridTextColumn Header="ID" Binding="{Binding Path=ID, Mode=OneWay}" />
<DataGridTextColumn Header="RoomType" Binding="{Binding Path=RoomType, Mode=OneWay}" />
<DataGridTextColumn Header="Room" Binding="{Binding Path=RoomNumber, Mode=OneWay}" />
<DataGridTextColumn Header="Guest" Binding="{Binding Path=GuestName, Mode=OneWay}" />
<DataGridTextColumn Header="Persons" Binding="{Binding Path=Person, Mode=OneWay}" />
<DataGridTextColumn Header="Check In" Binding="{Binding Path=CheckInDate, Mode=OneWay}" />
<DataGridTextColumn Header="Check Out" Binding="{Binding Path=CheckOutDate, Mode=OneWay}" />
<DataGridTextColumn Header="Room Price" Binding="{Binding Path=RoomPriceWithCurrency, Mode=OneWay}" />
<DataGridCheckBoxColumn Header="Inc. First Day" Binding="{Binding Path=IncFirstDay, Mode=OneWay}" />
<DataGridTextColumn Header="Discount %" Binding="{Binding Path=Discount, Mode=OneWay}" />
<DataGridTextColumn Header="Discounted Price" Binding="{Binding Path=DiscountedPriceWithCurrency, Mode=OneWay}" />
<DataGridTextColumn Header="Rate" Binding="{Binding Path=Rate, Mode=OneWay}" />
<DataGridTextColumn Header="Total Days" Binding="{Binding Path=TotalDays, Mode=OneWay}" />
<DataGridHyperlinkColumn Header="Services" Binding="{Binding Path=TotalServiceCount, Mode=OneWay}" >
<DataGridHyperlinkColumn.ElementStyle>
<Style TargetType="TextBlock">
<EventSetter Event="Hyperlink.Click" Handler="DG_Hyperlink_Click" />
</Style>
</DataGridHyperlinkColumn.ElementStyle>
</DataGridHyperlinkColumn>
<DataGridTextColumn Header="Total Price" Binding="{Binding Path=TotalPrice, Mode=OneWay}" />
<DataGridTextColumn Header="Total Price in Gel" Binding="{Binding Path=TotalPriceInGel, Mode=OneWay}" />
<DataGridTextColumn Header="Paid" Binding="{Binding Path=PaidMoney, Mode=OneWay}" />
<DataGridTextColumn Header="Debt" Binding="{Binding Path=Debt, Mode=OneWay}" />
<DataGridTextColumn Header="Invoice #" Binding="{Binding Path=InvoiceNumber, Mode=OneWay}" />
</DataGrid.Columns>
<DataGrid.GroupStyle>
<GroupStyle ContainerStyle="{StaticResource GroupHeaderStyle}">
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter />
</ItemsPanelTemplate>
</GroupStyle.Panel>
</GroupStyle>
</DataGrid.GroupStyle>
</DataGrid>
</Grid>
</Grid>
</TabItem>
</TabControl>
and Chart:
<TabItem Header="Statistic">
<ScrollViewer>
<Grid Background="White">
<Button Name="button1" Content="Button" Height="23" HorizontalAlignment="Left" Margin="348,6,0,0" VerticalAlignment="Top" Width="75" />
<charting:Chart Name="ChartGuests66" Margin="6,48,87,262" Width="862" Height="451">
<charting:AreaSeries DependentValuePath="Value" IndependentValuePath="Key" Background="Red">
<charting:DataPointSeries.ItemsSource>
<Binding BindsDirectlyToSource="True"/>
</charting:DataPointSeries.ItemsSource>
</charting:AreaSeries>
</charting:Chart>
</Grid>
</ScrollViewer>
</TabItem>