downloadable code for this WPF videoにあるWPFスライドショーアプリケーション構造を再構築しています。PagesまたはUserControlをXAMLフレーム要素に読み込む方法の違いは何ですか?
次の/前のボタンをクリックすると変更され、Frame要素に動的に表示されるINotifyPropertyChangedプロパティ "CurrentSlide"を持つPresentationクラスがあります。
このフレームにダウンロードされたコードロードページが、私は実際に私はすべての違いを見つけることができない、同じようにうまく動作するように見える負荷のUserControlで実験。
PagesやUserControlsをXAMLフレーム要素に読み込む際の違いを知っている人はいますか?
<Window x:Class="TestFull8229.Views.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:c="clr-namespace:TestFull8229.Commands"
xmlns:viewModels="clr-namespace:TestFull8229.ViewModels"
Title="Main Window" Height="400" Width="800">
<Window.Resources>
<viewModels:Presentation x:Key="presentation"/>
</Window.Resources>
<DockPanel>
<StackPanel>
<Viewbox Stretch="Uniform">
<Frame Width="800" Height="600"
Source="{Binding Path=CurrentSlide,
Source={StaticResource presentation}}"/>
</Viewbox>
</StackPanel>
</DockPanel>
</Window>
はい、主な.xamlファイルが、UserControlにはない読み込まれたページのTitleプロパティを読み取るので、これは少なくともこの例ではPagesを使用する理由の1つです –