Search This Blog

Showing posts with label customization. Show all posts
Showing posts with label customization. Show all posts

Friday, June 1, 2018

How to access and manipulate a custom ASP.NET user control from a Controller in a Module project


We have updated our How to: Show a Custom Data-Bound Control in an XAF View (ASP.NET) tutorial with more information on how to pass external data to custom Web user controls

Previously, our customers had the following difficulties with this task:

- In which project to create web user controls. By default, ASP.NET suggests doing this in the YourSolution.Web project. Adding an *.ASCX control into the YourSolutionName.Module.Web project led to errors.

- How to deal with circular references when attempting to reference the YourSolution.Web project from a Controller defined in the YourSolutionName.Module.Web project.
- How to pass an IObjectSpace, XafApplication or current View object to a custom user control.


A common way to resolve such a dependency (unrelated to XAF itself) is to define an interface within your class library (a XAF module project) and implement it by using your custom user control.


Wednesday, April 25, 2018

UPDATE on Customization Forms - XAF WinForms v18.1.3+

With v18.1.3 (RTM or Beta2), a tooltip will be shown for complex property paths to avoid confusion from fields with the same name. Refer to the attached video:



Note that since multiple customization forms can be opened at the same time, now the form's header also includes the View's caption. We hope your end-users will appreciate these minor usability improvements. Refer to the original Support Center ticket for more details.

See Also:
Customization Forms and Model Editor Improvements - XAF v17.2.6

Monday, April 16, 2018

Capturing a user's signature in an XAF mobile application - UPDATE for v17.2.8+

Starting with v17.2.8, MobilePropertyEditor supports the Edit ViewEditMode. We updated our How to use a Signature Pad in XAF Mobile example and enabled SignatureAction in the Edit mode accordingly. This improvement saves end-users time not only for this particular scenario (they no longer require to switch views), but also when working with regular image properties.

FreeImages.com/Carl Dwyer

To see the difference in action, refer to the GIF file below and compare it with the one from my previous post:


Your feedback is needed!
For early testing, we published a daily build. You can download it using the following link: DevExpressNETComponents-17.2.7.18099.exe. We look forward to hearing from you.

Wednesday, February 14, 2018

Learning through reading the source code

I will start this post with the new Visual Studio 2017 function, which I hope will be helpful for XAF developers too. I have both RTM and Preview versions installed, but I am mostly using the latter one for testing. The new function I spotted in their change logs is called "View decompiled source definitions instead of metadata (C#)".

As you can guess from its name, it changes the very often used "Go To Definition" command (F12) so that it displays the actual code of a C# type or member who's source code is unavailable - very useful and convenient, IMHO. It is decompiled using ILSpy, the tool I have already been using for years as default program association for opening *.dll files -  partially the reason of why this news got my attention. This experimental feature is new in Visual Studio 2017 version 15.6 preview 2+ and it must be turned on explicitly using the Tools > Options  >  Text Editor > C# > Advanced > Enable navigation to decompiled sources menu item. 


Customization Forms and Model Editor Improvements - XAF v17.2.6

Customizing Views layout, e.g., making certain fields visible, changing their locations is something that XAF developers usually learn and appreciate from day one. That is because you can drastically change the UI of your app by just moving the mouse and without any coding and recompilation, also at runtime. 

The next maintenance release (v17.2.6) should come with a few minor improvements to the customization forms in DetailView, ListView and the Model Editor, which we hope will be welcomed by both developers and end-users as well.


Thursday, February 8, 2018

Minor improvements to the ConditionalAppearance and ViewVariants modules - XAF v17.2.6


I also wanted to inform you of some "home work" done by us in v17.2.6 to improve your XAF development experience with these modules:

GridListEditor - An appearance rule has no effect in the new item row until a value is entered into any cell
View Variants Module - ListView variant always takes the DataAccessMode value from the root node instead of own model differences, which may cause an exception due to an incompatible ListEditor type

FreeImages.com/linusb4



While the first scenario is quite specific (we heard about it from our largest XAF customer and a few others), the second one was likely encountered if you use the ViewVariants module. For instance, when having one variant as a grid operating in server mode while having another variant as tree, pivot, scheduler or whatever ListView editor that does not support server mode. In the past, this unsupported configuration could cause an exception at runtime. Starting with v17.2.6, it all works as the majority our users expect - at least we believe so based on the feedback we received. The online documentation on the ViewVariants module will be updated accordingly by release time, of course. Finally, many thanks to Dave Hesketh, Martin Praxmarer, our MVPs, as well as other customers for bringing this to our attention.

If you cannot wait for the next maintenance update (v17.2.6) to test both things, install this night buildDevExpressNETComponents-17.2.exe


As always, my team and I are looking forward to hearing what you think, even on such small things and maybe others that could make your life a bit easier.

Friday, December 29, 2017

How to drag & drop file attachments from Outlook messages into ListView or DetailView with FileData objects

I would like to promote a KB article, which may be interesting for users of our File Attachments module and Microsoft Outlook, because we introduced a few changes to XAF codebase (v17.2.5+) to make their integration simpler for the following customer's scenario (attaching files directly from Outlook messages):

>>I am using the FileAttachmentBase to add files to a class in my project. Drag/Drop works great if I want to add a file from Windows Explorer. I want to be able to drag an attachment from Outlook and drop it into my application in the same way.



Wednesday, December 6, 2017

How to use the ASPxSpreadsheet control as a property editor in an XAF ASP.NET WebForms application


If you want to display a business object that has a byte array property as an Excel document allowing users to modify the content and save it to the database, ASPxSpreadsheet is an appropriate component for this task. Our new example shows how to implement an XAF Web Property Editor based on this control:


If this is something you have already implemented or planned, we would greatly appreciate it if you describe your use-case scenarios or exactly how and for what your end-users are supposed to use spreadsheet control in your app. If possible, attach screenshots, test samples and database to clarify expected results and user steps within the application UI as well as already implemented solutions for this task. With that, we will be able to better understand your requirements and provide more specific solutions or consider improvements to our products for the future. Thanks in advance.

FreeImages.com/Jason Young

Friday, December 1, 2017

Capturing a user's signature in an XAF mobile application - YOUR FEEDBACK IS NEEDED!


FreeImages.com/Carl DwyerWe are in the process of creating learning materials for this task, but polishing and publishing them online for everyone will require additional time. If you are ready to test our solution for your own app, I can provide you with draft instructions and test sample in return. 
It will show how to show a custom control where a user can draw his signature and save the result into an image property within your business class. 

Here is what it looks like in action:


For testing you will need XAF v17.2.3+, because there we supported mobile custom modules: Task-Based Help > How to: Add an XAF Mobile Custom Module

If you are interested in this testing, email me at dennis@devexpress.com.

Monday, November 27, 2017

Welcome the DataStoreCreated event in the ConnectionDataStoreProvider and ConnectionStringDataStoreProvider classes

This is rather a minor improvement, but I bet it will save code lines for some advanced XAFers who touch the internals of the XPO data layer created by XAF for various low-level database-specific customization like setting connection timeouts, changing default schemas, enabling and customizing caching, service end-points, etc. Check out this updated article for some example code showing the new approach in action.
The DataStoreCreated  event is available in XAF v17.2+. Its event arguments (DataStoreCreatedEventArgs) expose the DataStore and Destination parameters that provide access to the current data store and its type (SchemaChecking,  Updating or Working).

Frankly speaking, this is quite low-level and rarely needed stuff, so we have not yet have it covered in the online docs, only in KBs. So, please refer to my 
How to customize the underlying database provider options and data access behavior in XAF article to learn more about it. Should you have any questions or additional usability suggestions, please let me know.

FreeImages/Chett Cole

How to show Color Swatches for the Bezier skin and persist the user choice in XAF WinForms apps

If you are a fan of the new SVG Bezier skin, our WinForms components received in v17.2, do not miss the XAF integration on the subject:

https://www.devexpress.com/kb=T579152

Both theWinForms and XAF teams are looking forward to hearing from you on this new feature. Learn more about this major release from our What's New documents.


Tuesday, November 21, 2017

Security - How to add OAuth2 authentication to a WinForms app

UPDATE:
XAF WinForms UI v23.2+ natively supports OAuth2 providers such as Microsoft Entra ID, Google, etc. - Documentation. The custom solution below is no longer required.

----
This is another example of how flexible the security module and our framework are. My colleague Michael has recently published an example on how to use the Microsoft, Google, Facebook or any compatible authentication provider within an XAF WinForms app:
https://www.devexpress.com/kb=T567978


This implementation is based on public community resources like StackOverFlow, so research the links in code comments for more details.

If you are looking for an ASP.NET example, do not miss the article we published earlier:
How to: Use Google, Facebook and Microsoft accounts in ASP.NET XAF applications (OAuth2 authentication demo)

Your feedback is needed!
Originally, we were not going to make a WinForms counterpart, because there were only a couple of requests for it + the whole scenario looked rare for desktop apps.
What is your own experience with it? Have you ever had such integration requests from your end-users? What providers do they need to cover most? Please let us know.

Thursday, October 19, 2017

How to group validation rules by a business type in Model Editor

If you want the same UI as in the screenshot below:


implement a few code lines in YourSolutionName.Module/Module.cs file, as follows:

using DevExpress.ExpressApp.ModelEditor;
using DevExpress.ExpressApp.Validation;
using DevExpress.ExpressApp.Model;

namespace MainDemo.Module {
    public sealed partial class MainDemoModule : ModuleBase {
        public MainDemoModule() {
            InitializeComponent();
            ModelEditorGroupingHelper.Instance.RegisterNodeGroupPathDelegate(
            typeof(IModelValidationRules), node => DefaultGroupPathCalculator("TargetType.Name", node));
        }
        public string[] DefaultGroupPathCalculator(string propertyName, IModelNode modelNode) {
            string groupName = "";
            object propertyValue = ModelEditorGroupingHelper.Instance.GetPropertyValue(propertyName, modelNode);
            if(propertyValue != null) {
                groupName = propertyValue.ToString();
            }
            return ModelEditorGroupingHelper.Instance.SplitGroupPath(groupName, modelNode);
        }
        //...
    }
}

This is just one example of the Model Editor nodes grouping customizations that you can achieve with the ModelEditorGroupingHelper  API.

I remember our loyal customer Mario Blataric doing magic using this helper for his specific project needs (multi-level grouping of Actions by Controllers and their namespaces/functional blocks). If you have similar needs in your project, feel free to contact our support team so we can help you make your life easier.

Thursday, July 27, 2017

Survey (~1min): Default location of the Reset View Settings Action - YOUR FEEDBACK IS NEEDED!!!

This command is provided by the standard ResetViewSettingsController and resets all the user customizations of the View's model. It may be helpful when your client customized a lot and was stuck getting things to normal. Due to this scenario the command is available in the main menu toolbar or ribbon by default (+additionally duplicated in context menu in WinForms).



However, we wanted to hear the XAF community thoughts on this default design after receiving several user requests in this regard (examples: onetwo, three). As of now, we have no easy capability to know real usages and customizations of XAF Actions in end client apps, so we would greatly appreciate it if you participate in this and coming surveys. Thanks for your help in advance.

https://dxsurvey.com/published?id=45965fae-dfc7-48ac-af26-aee17d2c3ec4

In fact, we already asked our user preferences when this feature was in development, but did not receive much feedback back then to hide this command from the main menu by default.

Friday, July 21, 2017

Tracing - How to exclude loaded assemblies from the eXpressAppFramework.log file

Just a small tip for XAF developers who have never needed or liked this large "Loaded assemblies" section written into the eXpressAppFramework.log file at startup or every time an exception is thrown:



Monday, June 26, 2017

AuditTrail - How to show the change history for the current object in a separate form instead of a nested ListView

I wanted to draw your attention to the scenario and solution in our Support Center, which were found helpful by at least 4 other XAF customers using XPO for data access. As you know, by default, we offer our users a solution based on the nested ListView, which is automatically generated when you declare a collection property like this one:

    public XPCollection<AuditDataItemPersistent> AuditTrail {
        get {
            if(auditTrail == null) {
               auditTrail = AuditedObjectWeakReference.GetAuditTrail(Session, this);
            }
            return auditTrail;
        }
    }


The solution I am promoting allows you to keep the layout less complex and invoke this rarely used or quite advanced feature from a small PopupWindowShowAction showing a ListView:


It will be interesting to hear about your preferences in this regard. Please let me know in comments. Thanks!


Tuesday, June 20, 2017

Performance tuning of the saving/validation process using the PersistenceValidationController events

Regardless of how good and sophisticated your development tools are, real production use often imposes research and solving speed issues. In this tip, I will talk about tuning the Validation Module to do its best when saving a master object exposing  large collections of aggregated data. 

By default, aggregated objects are considered to be an integral part of a master object, and thus, they should be validated together with the master object, which may take significant time if you have hundreds or thousands of complex detail records. The entire detail collection will be loaded and validated in this instance.

The good news is that XAF is very flexible and has a customizable framework that provides many ways to intercept this validation process. 

Addition to the VisibleInXXX attributes family for controlling available types and fields in the application UI

With v16.2.6 and v17.1.3DevExpress.Persistent.Base > VisibleInReportsAttribute  can be applied to a business class property as well. When the VisibleInReports attribute is applied to a business class property, it specifies whether or not the target property is visible in the Report Designer field list.




BTW, with the introduction of the Dashboards ModuleVisibleInDashboardsAttribute was added as well. I hope you did not miss it as well.

Tuesday, May 23, 2017

Web - How to preserve the FullTextSearch Action filter after opening details for a record and returning back to ListView

I want to repost an interesting ASP.NET WebForms scenario and a solution for it I provided to a customer yesterday. Watch this video to see how this works:



If you are interested in having something like this, check out this Support Center thread for a relatively simple Controller.

Friday, May 19, 2017

Questions on managing the Application Model settings in the database - YOUR FEEDBACK IS NEEDED!

We are reviewing usability of the mechanism responsible for storing and managing Application Model differences in the database (aka ModelDifferenceDbStore), and hence wanted to ask you to tell us about your practical experience with it.

In order to do this, please consider these questions:
1. Differences for which levels are you currently storing in the database and how well does this work for you (shared, user, or both)?

2. Have you required customizing differences stored in the database for already deployed production apps? If so, clarify the following points:
2.1. Was this customization done for shared or user levels?

2.2. List the exact use-case scenarios that needed such customizations (e.g., a client screwed up a View layout and could not reset it back to normal)?
2.3. Which solutions and how often did you use for this customization (e.g., direct database updates, editing raw XML after enabling the Administrative UI inside the app, etc.)?
2.4. How well did your current solutions for different customizations work for you so far and what could be improved in them and why?


3. Have you considered the opportunity to customize shared or user differences using the Standalone Model Editor, which visualizes the actual differences in XML content as a nodes tree? If so, clarify the following points to help us better understand the behavior you expect from such a feature:
3.1. Do you need to customize differences for shared, user or both levels?
3.2. Taking the severeness and effect of this operation over all application users, do you think that a logon form should be shown before someone can perform this customization for security reasons? Or, how do you plan to prevent a power user from obtaining the Standalone Model Editor tool binaries and running it locally for this or even harmful purposes?


We would greatly appreciate your answering these questions or providing any other information that would help us see how the current feature works for you and what can be improved further. 

Please provide answers here in comments or rather in the Support Center to track them easier: https://www.devexpress.com/support/center/question/create
Thanks in advance.


FreeImages.com/Ronit Geller