2

TextBox の 1 つを変更すると、タイトルのウィンドウが開きます。MVVM Light を使用しています。

(テスト) セットアップ:

意見

<Window ... DataContext="{Binding Source={StaticResource Locator}, Path=Main}">
    <Grid>
        <TextBox Text="{Binding Foo.Bar, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="100" Height="100" Margin="10,10,407,209" />
        <TextBox Text="{Binding Foo.Bar, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="100" Height="100" Margin="115,10,302,209" />
    </Grid>
</Window>

ビューモデル

public class MainViewModel : ViewModelBase
{
    private Foo _foo;

    public Foo Foo
    {
        get
        {
            return _foo;
        }

        set
        {
            Set(() => Foo, ref _foo, value);
        }
    }

    public MainViewModel()
    {
        _foo = new Foo();
    }
}

モデル

public class Foo : ObservableObject
{
    private string _bar;

    public string Bar
    {
        get { return _bar; }
        set { Set(() => Bar, ref _bar, value); }
    }
}

エラー メッセージの StackTrace には、次のように表示されます。

「d:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs」のソースを検索しています。チェックサム: MD5 {8e 31 66 ae cd 3b be 8f be e7 3b 2c 73 91 a0 76} ファイル 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs'存在しません。「d:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs」のスクリプト ドキュメントを調べています...「d:\GalaSoft\mydotnet\MvvmLight\」のプロジェクトを調べていますSource\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs'. プロジェクト内にファイルが見つかりませんでした。ディレクトリ 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src\' を探しています... ディレクトリ 'C: を探しています: \Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src\vccorlib\'... ディレクトリ 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\mfc\ を探しています'... ディレクトリ 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\atl\' を探しています... ディレクトリ 'C:\Program Files (x86)\Microsoft Visual Studio を探しています11.0\VC\atlmfc\include'... アクティブなソリューションのデバッグ ソース ファイルの設定は、デバッガーがユーザーにファイルの検索を要求しないことを示しています: d:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft .MvvmLight (NET35)\ObservableObject.cs. デバッガーは、ソース ファイル 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs' を見つけることができませんでした。ディレクトリ 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\mfc\' を探しています... ディレクトリ 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\ を探していますatlmfc\src\atl\'... ディレクトリ 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include' を探しています... アクティブなソリューションのデバッグ ソース ファイルの設定は、デバッガーがd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs. デバッガーは、ソース ファイル 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs' を見つけることができませんでした。ディレクトリ 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\mfc\' を探しています... ディレクトリ 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\ を探していますatlmfc\src\atl\'... ディレクトリ 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include' を探しています... アクティブなソリューションのデバッグ ソース ファイルの設定は、デバッガーがd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs. デバッガーは、ソース ファイル 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs' を見つけることができませんでした。\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\atl\'... ディレクトリ 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include' を探しています..アクティブなソリューションのデバッグ ソース ファイルの設定は、デバッガーがユーザーにファイルの検索を要求しないことを示しています: d:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs。デバッガーは、ソース ファイル 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs' を見つけることができませんでした。\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\atl\'... ディレクトリ 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include' を探しています..アクティブなソリューションのデバッグ ソース ファイルの設定は、デバッガーがユーザーにファイルの検索を要求しないことを示しています: d:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs。デバッガーは、ソース ファイル 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs' を見つけることができませんでした。アクティブなソリューションのデバッグ ソース ファイルの設定は、デバッガーがユーザーにファイルの検索を要求しないことを示しています: d:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs。デバッガーは、ソース ファイル 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs' を見つけることができませんでした。アクティブなソリューションのデバッグ ソース ファイルの設定は、デバッガーがユーザーにファイルの検索を要求しないことを示しています: d:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs。デバッガーは、ソース ファイル 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\ObservableObject.cs' を見つけることができませんでした。

編集

ソリューションのコンテキストと関係があります。プロジェクトを単独で開くと、すべてが機能します。さらにアイデアはありますか?

4

0 に答える 0