1 //------------------------------------------------------------------------------
2 // <copyright file="ViewService.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //------------------------------------------------------------------------------
7 namespace System.Activities.Presentation.Services {
11 using System.Activities.Presentation.Model;
14 /// This service allows you to move between the model and the view.
16 public abstract class ViewService {
19 /// Constructs a new ViewService.
21 protected ViewService() {
25 /// Returns the model corresponding to the view, or null if
26 /// there is no model matching the view.
28 /// <param name="view">
29 /// The view object you wish to find the model for.
32 /// The corresponding model, or null if there is no model for the
33 /// given view object.
35 /// <exception cref="ArgumentNullException">if view is null.</exception>
36 public abstract ModelItem GetModel(DependencyObject view);
39 /// Returns the view corresponding to the given model. This
40 /// can return null if there is no view for the model.
42 /// <param name="model">
43 /// The model to return the view object for.
46 /// The view for this model, or null if there is no view.
48 /// <exception cref="ArgumentNullException">if model is null.</exception>
49 /// <exception cref="ArgumentException">if model does not represent a valid model for this service.</exception>
50 public abstract DependencyObject GetView(ModelItem model);