首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Windows Mobile >

wp7的Text="{StaticResource AppName}" 有关问题

2012-04-12 
wp7的Text{StaticResource AppName} 问题!StackPanel x:NameTitlePanel Grid.Row0 Margin12,17

wp7的Text="{StaticResource AppName}" 问题!
StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">

  <TextBlock x:Name="ApplicationTitle" 

  Text="{StaticResource AppName}" 

  Style="{StaticResource PhoneTextNormalStyle}"/>

  <TextBlock x:Name="ageTitle" 

  Text="Save Info" 

  Margin="9,-7,0,0" 

  Style="{StaticResource PhoneTextTitle1Style}"/>

  </StackPanel>
复制代码error提示:“The resource "AppName" could not be resolved, ”
我已经在APP里定义了
StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">

  <TextBlock x:Name="ApplicationTitle" 

  Text="{StaticResource AppName}" 

  Style="{StaticResource PhoneTextNormalStyle}"/>

  <TextBlock x:Name="ageTitle" 

  Text="Save Info" 

  Margin="9,-7,0,0" 

  Style="{StaticResource PhoneTextTitle1Style}"/>

  </StackPanel>
复制代码error提示:“The resource "AppName" could not be resolved, ”
然后我就在App.xaml里定义了:
xmlns:system="clr-namespace:System;assembly=mscorlib
<Application.Resources>
  <system:String x:Key="AppName">CONTROLS &amp; NAVIGATION</system:String>
</Application.Resources>
但是为什么在XMAL那边还是有蓝色的波纹下划线呢?
这是怎么回事?
高手指点!



[解决办法]
根据我亲自实验

XML code
xmlns:system="clr-namespace:System;assembly=mscorlib<Application.Resources>  <system:String x:Key="AppName">CONTROLS &amp; NAVIGATION</system:String></Application.Resources> 

热点排行