|
Update:
In between I did the following:
Added a new ViewModel called EditMessageIIViewModel.
Added a new Silverlight Page.
Navigation worls, View is displayed,
OnNavigationCompleted not called, parameters not in NavigationContext.
public class EditMessageIIViewModel : ViewModelBase {
/// <summary>
/// Initializes a new instance of the <see cref="EditMessageIIViewModel"/> class.
/// </summary>
public EditMessageIIViewModel() {
}
protected override void OnNavigationCompleted() {
int id = (int)NavigationContext["MessageId"];
}
/// <summary>
/// Gets the title of the view model.
/// </summary>
/// <value>The title.</value>
public override string Title { get { return "View model title"; } }
// TODO: Register models with the vmpropmodel codesnippet
// TODO: Register view model properties with the vmprop or vmpropviewmodeltomodel codesnippets
// TODO: Register commands with the vmcommand or vmcommandwithcanexecute codesnippets
}
The Page:
<Views:EditMessageIIIntermediate x:Class="RomanticaWeb.Views.EditMessageII"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:catel="http://catel.codeplex.com"
xmlns:Views="clr-namespace:RomanticaWeb.Views">
<!-- Resources Note that in the template it's called Page:Resources - that didn't work -->
<Views:EditMessageIIIntermediate.Resources>
</Views:EditMessageIIIntermediate.Resources>
<!-- Content -->
<Grid>
<TextBlock Text="Here goes your real content" />
</Grid>
</Views:EditMessageIIIntermediate>
public partial class EditMessageII : EditMessageIIIntermediate {
/// <summary>
/// Initializes a new instance of the <see cref="EditMessageII"/> class.
/// </summary>
public EditMessageII() {
InitializeComponent();
}
}
/// <summary>
/// Intermediate class for EditMessageII since Silverlight doesn't support generic base classes.
/// </summary>
public class EditMessageIIIntermediate : Page<EditMessageIIViewModel> {
/// <summary>
/// Initializes a new instance of the <see cref="EditMessageIIIntermediate"/> class.
/// </summary>
/// <remarks>
/// This constructor can only be used for design-time support. An exception will be thrown when it is used
/// outside a designer.
/// </remarks>
public EditMessageIIIntermediate() { }
}
I will Stop for Today. <!-- Resources --> <!-- Content -->
Greets - Helmut
|