Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
WPF アプリケーションごとにいくつの ViewModel を用意する必要がありますか? View は 1 つの xaml ファイルまたは「1 つの表示領域」を表しますか? MainWindow.xaml に左パネルとドキュメント パネルがあると仮定すると、それを LeftPanelViewModel と DocumentPanelViewModel に分割する必要がありますか? 左パネルとドキュメント パネルは別のビューですか?
コードを簡単に維持するために、LeftPanelViewModel と DocumentPanelViewModel の 2 つの ViewModel を用意することをお勧めします。ビューには多くのコード行を含めることができるため (バインドされたプロパティ、コマンド、関数など...)
1 ビュー => 1 ビューモデル