1

VS2010 を介してシンプルな Silverlight 5 アプリを作成し、組織のビジネス アプリケーションで Silverlight 4 から Silverlight 5 への変換の問題を追跡しました。

アプリのクライアント側の部分は次のとおりです。

<UserControl x:Class="SilverlightApplication1.MainPage" 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             mc:Ignorable="d" 
             d:DesignHeight="300"  
             d:DesignWidth="400"> 

    <StackPanel> 

        <TextBlock 
                Text="{Binding Path=Rate}" 
                Grid.Column="1" 
                Grid.Row="1" 
                x:Name="xTest" 
                FontSize="12" 
                Margin="166,0,0,44" 
                HorizontalAlignment="Left" 
                Foreground="Black" 
                VerticalAlignment="Bottom"> 
        </TextBlock> 

    </StackPanel> 
</UserControl> 

コードビハインド:

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Net; 
using System.Windows; 
using System.Windows.Controls; 
using System.Windows.Documents; 
using System.Windows.Input; 
using System.Windows.Media; 
using System.Windows.Media.Animation; 
using System.Windows.Shapes; 

namespace SilverlightApplication1 
{ 
    public partial class MainPage : UserControl 
    { 
        public MainPage() 
        { 
            InitializeComponent(); 
            Rate = 25; 
        } 

        public int Rate { get; set; } 
    } 
}

アプリを実行した結果:

エラー 12 タグ 'Binding' が XML 名前空間 'http://schemas.microsoft.com/winfx/2006/xaml/presentation' に存在しません。C:\source\sl5_test_app\SilverlightApplication1\SilverlightApplication1\MainPage.xaml 13 24 SilverlightApplication1

その他の情報:

私が変われば…

Text="{Binding Path=Rate}"

に...

Text="25"

...アプリケーションが実行され、画面に「25」が表示されます。


私はこの原因をネット上で検索しましたが、投資収益率はありません。この一般的な Silverlight の例外により、'xxx' または '[Some_Control]' が 'binding' に置き換えられている同様のクエリがたくさんありますが、これまでのところ、この問題は解決されていません。

ここに何が欠けていますか?

ありがとう、アーロン

4

1 に答える 1

0

OS を吹き飛ばしてしまい、Windows Server 2008 R2、Visual Studio 2010、およびすべての関連する Silverlight の新しいバージョンをインストールしました。

既存または新規の Silverlight プロジェクトでバインディング エラーが発生しなくなりました。

-アーロン

于 2012-10-08T18:20:13.270 に答える