I am still forcing myself to go to sleep after watching an unreal football drama in Barcelona, so I am writing this short blog post at night.
Besides Visual Studio 2017 official support, XAF v16.2.5 delivers a small gem, which I cannot hide from you too long. Remember that this is an early preview of the functionality we hope to officially release by v17.1 and which is have polished in the coming 2-3 months. So, your feedback is welcome, as always!
Let's modify the platform-agnostic Controller from our demo (C:\Users\Public\Documents\DevExpress Demos 16.2\Components\eXpressApp Framework\SimpleProjectManager\CS\SimpleProjectManager.Module\Controllers\ProjectTaskController.cs) by adding the Application.ShowViewStrategy.ShowMessage call at the end of the Execute event handler:
...
markCompletedAction.Execute += (s, e) => {
IObjectSpace viewDataContext = View.ObjectSpace;
foreach(ProjectTask task in e.SelectedObjects) {
task.EndDate = DateTime.Now;
task.Status = ProjectTaskStatus.Completed;
viewDataContext.SetModified(task); // Mark the changed object as 'dirty' (only required if data properties do not provide change notifications).
}
viewDataContext.CommitChanges();
//viewDataContext.Refresh(); // Optionally update the UI in accordance with the latest data changes.
Application.ShowViewStrategy.ShowMessage(string.Format("{0} task(s) have been completed!", e.SelectedObjects.Count), InformationType.Success, 4000, InformationPosition.Top);
};
...
Now, let's start the Windows and Web apps, select a few uncompleted tasks in the ProjectTask ListView and execute the Done! command from the menu.
Besides Visual Studio 2017 official support, XAF v16.2.5 delivers a small gem, which I cannot hide from you too long. Remember that this is an early preview of the functionality we hope to officially release by v17.1 and which is have polished in the coming 2-3 months. So, your feedback is welcome, as always!
Typical usage
Let's modify the platform-agnostic Controller from our demo (C:\Users\Public\Documents\DevExpress Demos 16.2\Components\eXpressApp Framework\SimpleProjectManager\CS\SimpleProjectManager.Module\Controllers\ProjectTaskController.cs) by adding the Application.ShowViewStrategy.ShowMessage call at the end of the Execute event handler:
...
markCompletedAction.Execute += (s, e) => {
IObjectSpace viewDataContext = View.ObjectSpace;
foreach(ProjectTask task in e.SelectedObjects) {
task.EndDate = DateTime.Now;
task.Status = ProjectTaskStatus.Completed;
viewDataContext.SetModified(task); // Mark the changed object as 'dirty' (only required if data properties do not provide change notifications).
}
viewDataContext.CommitChanges();
//viewDataContext.Refresh(); // Optionally update the UI in accordance with the latest data changes.
Application.ShowViewStrategy.ShowMessage(string.Format("{0} task(s) have been completed!", e.SelectedObjects.Count), InformationType.Success, 4000, InformationPosition.Top);
};
...
Now, let's start the Windows and Web apps, select a few uncompleted tasks in the ProjectTask ListView and execute the Done! command from the menu.
Result in the UI for various platforms
Web
A nice notification window is managed using the dxToast widget (invoked via the DevExpress.ui.notify method) from our DevExtreme HTML5/JavaScript library: