English 中文(简体)
不能将财产归为同类物的价值。 系统:Windows. 养老金
原标题:Cannot convert the value in attribute Property to object of type System.Windows.DependencyProperty

我用表格控制了一张表格,在一只新闻图表显示有这种错误时,有第二幅插图:

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>
最佳回答

我认为,你的问题是在带背景的“Red”区内造成的。 数据点分类实际上具有背景。

Remove that temporarily and if it solves your problem then I think you want to access the DataPointStyle of your area series to set the background.

Check this out: wpf Area Chart with Different Colors?

Edit: Removed my xaml example, as a direct setting in place of styles does work.

问题回答

This could be a bug in the Microsoft Toolkit itself. http://wpf.codeplex.com/workitem/12865

我确实存在同样的问题,现在我会试图去除这一工具箱子和使之变形。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签