Files
Nuvolar/Nuvolar.Module.Win.CSharp/Controllers/NavigationItemVCC.cs
2017-03-08 11:21:27 +01:00

49 lines
1.8 KiB
C#

using System;
using System.Linq;
using System.Collections.Generic;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.SystemModule;
using DevExpress.ExpressApp.Xpo;
namespace Nuvolar.Module
{
// For more typical usage scenarios, be sure to check out http://documentation.devexpress.com/#Xaf/clsDevExpressExpressAppWindowControllertopic.
public partial class NavigationItemVCC : Nuvolar.Module.Win.SISShowNavigationItemController
{
public NavigationItemVCC()
{
InitializeComponent();
RegisterActions(components);
// Target required Windows (via the TargetXXX properties) and create their Actions.
}
protected override void OnActivated()
{
base.OnActivated();
// Perform various tasks depending on the target Window.
}
protected override void OnDeactivated()
{
// Unsubscribe from previously subscribed events and release other references and resources.
base.OnDeactivated();
}
protected override void ShowNavigationItem(SingleChoiceActionExecuteEventArgs args)
{
if (args.SelectedChoiceActionItem != null && args.SelectedChoiceActionItem.Enabled)
{
if (args.SelectedChoiceActionItem.Id == "NAVInvoiceReport_ListView")
{
XPObjectSpace _onew = (XPObjectSpace)Application.CreateObjectSpace();
NAVInvoiceReport _NAVInvoiceReport = _onew.CreateObject<NAVInvoiceReport>();
args.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "NAVInvoiceReport_DetailView", true, _NAVInvoiceReport);
}
else
{
base.ShowNavigationItem(args);
}
}
}
}
}