|
using System;
using System.Windows;
using System.Windows.Controls;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
namespace Selen.WorkflowSaveModule
{
public class TypeBasedSaveModule : IModule
{
private readonly IRegionManager _regionManager;
private readonly object _dataContext;
public TypeBasedSaveModule(IRegionManager regionManager, [Dependency("WorkflowSaveViewModel")]object dataContext)
{
this._regionManager = regionManager;
this._dataContext = dataContext;
}
public void Initialize()
{
var viewdict = new ResourceDictionary
{
Source =
new Uri("/Selen.WorkflowSaveModule;component/MenuItems.xaml",
UriKind.RelativeOrAbsolute)
};
var item = (MenuItem)viewdict["saveItem"];
item.DataContext = this._dataContext;
this._regionManager.RegisterViewWithRegion("StorageRegion", () => item);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.