Reputation: 539
I would like information on how to load a Frame through a viewmodel. I know how to load through the code-behind, but now want to move everything to the ViewModel linking frame.content or other property of binding to a Frame.
Do you have tips or suggestions?
Upvotes: 0
Views: 1773
Reputation: 2001
My answer is a bit off subject, cause I'm taking a leap here on what you are really trying to accomplish.
If you are looking for navigation implementation, you might consider other approaches.
HTH Ariel
Upvotes: 3
Reputation: 737
Bind the contents of the frame to a Page object
<Page>
<Viewbox Stretch="Fill" Margin="15">
<Frame Height="800" Width="1280" Content="{Binding SlideFrame}"/>
</Viewbox>
</Page>
using System.Windows.Controls;
private Page _slideFrame;
// Property
public Page SlideFrame
{
get { return _slideFrame; }
set
{
_slideFrame = value;
NotifyPropertyChanged("SlideFrame");
}
}
Upvotes: 1