本文介绍了kinect应用程序 - .xaml文件出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi! i have to do a program with kinect for my senior project and i'm new in doing programs with visual studio.. i follow the instructions of the "Kinect for Windows SDK Programming Guide" but the explanation of the .xaml file in one of the example applications of the book is insufficient and i made errors like these :
"the resource "BasicContentStyle" could not be resolved" and "the resource "BasicTextStyle" could not be resolved". to be more specific that's the whole explanation of .xaml file of this application:
"Designing the Info Box UI
This application displays information using the System.Windows.Controls.TextBlock class inside a System.Windows.Controls.Grid class. That is, each cell on the grid contains a Textblock component. The following excerpt from the MainWindow.xaml file shows how this is accomplished in XAML:
<TextBlock Text="Connection ID" Grid.Row="1" Grid.Column="0"
Style="{StaticResource BasicTextStyle}" />
<TextBlock Text="{Binding ConnectionID}" Grid.Row="1" Grid.Column="1"
Style="{StaticResource BasicContentStyle}" />
As we are going to display the information in text format, we will be splitting the window into a number of columns and rows, where each of the individual rows is responsible for showing information for one single sensor. As you can see in the preceding code, we have two TextBlock controls. One of them shows the label and another is bound to a property that shows the actual data.
Similar to this, we have several TextBlock controls that display the data for different information types. Apart from the text controls, we have button controls to start and
stop the sensor."
I included this library "System.Windows.Controls" on the .c file and i 've already searched the web but all the similar issues were more complicated than my application(It's just an info box which show some informations about the kinect device). Could anyone help me out with this?
thanks in advance
<Window x:Class="KinectInfoBox.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TextBlock Text="Connection ID" Grid.Row="1" Grid.Column="0"
Style="{StaticResource BasicTextStyle}" />
<TextBlock Text="{Binding ConnectionID}" Grid.Row="1" Grid.Column="1"
Style="{StaticResource BasicContentStyle}" />
</Grid>
</Window>
推荐答案
这篇关于kinect应用程序 - .xaml文件出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!