デフォルトの MainWindow.xaml を使用して、新しい wpf アプリケーションを作成しました。
ボタンを含む新しいページ Page1.xaml を作成しました。
ページをウィンドウに埋め込みたいので、試しました:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:WpfApplication1="clr-namespace:WpfApplication1" Title="MainWindow" Height="350" Width="525">
<Grid>
<WpfApplication1:Page1></WpfApplication1:Page1>
</Grid>
</Window>
それから私は例外を得ました。
私はここで検索し、別の解決策を得ました。
だから私はこれを試しました:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:WpfApplication1="clr-namespace:WpfApplication1" Title="MainWindow" Height="350" Width="525">
<Grid>
<Frame Source="Page1.xaml"/>
</Grid>
</Window>
出来た。
しかし
Page1.xaml が現在のプロジェクトではなく dll ファイルにある場合はどうなりますか?