Quantcast
Channel: Developer Express Inc.
Viewing all 2399 articles
Browse latest View live

Heatmap Control — A New Data Visualization for Desktop (WinForms, WPF)

$
0
0
In our most recent major release (v21.2), we added a new interactive and high-performance Heatmap Control for both WinForms and WPF.
As you know, a heatmap is a chart, where individual values are displayed in a grid using different color shades. You can quickly spot the highest and lowest values based on cell background color.
Heatmaps can address a variety of data visualization requirements. For instance, the following employee sales data visualization can help fine-tune an organization’s sales strategy for each team member.

DevExpress Heatmap with Empty Cells

Heatmap Capabilities

The DevExpress Heatmap for WinForms and WPF ships with the following built-in features/capabilities:
  • Data Binding support
  • Unbound Mode
  • Coloring Algorithms
  • Zoom and Scroll support
  • Hit-testing
  • Highlighting, Tooltips, and Labels for Cells
  • Legend
  • Customizable axes
  • Axis titles
  • Support for Skins and Themes
  • Print and Export options
A crucial feature for any data visualization UI control is the ability to efficiently manage memory consumption and handle real-time updates. These are especially important when your app processes millions of input values. Our current implementation allows you to refresh the Heatmap’s layout at ~15 FPS when visualizing up to 1M points on a 4K display - while still keeping memory usage as low as possible (~80MB).

DevExpress Heatmap that displays large data

If you are ready to incorporate the DevExpress Heatmap in your next WinForms or WPF project, please review the following help topics:
If you already installed the latest version of DevExpress WinForms/WPF components, you can explore the capabilities of our Heatmap Control within the Demo Center:

Future Enhancements

We continue to collect user feedback and will prioritize future Heatmap Control enhancements based on community input. Here are a few things we’re currently considering:
  • Gradient Legend
  • Save & Restore Layout
  • Selection
If you have specific needs/requirements as it relates to our WinForms/WPF Heatmap Control, leave a comment below or create a new support ticket in the DevExpress Support Center.

Heatmap Item for BI Dashboard

We extended our Custom Item Extensions example to illustrate Heatmap integration within the DevExpress BI Dashboard. For more information, refer to: Dashboard for WinForms - Custom Item Extensions - Heatmap Custom Item.

DevExpress BI Dashboard with a custom heatmap item

Note: DevExpress Dashboard ships as part of our Universal Subscription.

Heatmaps in the Map Control

A quick note for those planning to integrate cartographic maps in their apps.
Our Map Control for WinForms and WPF can visualize geographical point data via a heatmap layer and supports common appearance customization options such as color gradient, opacity, and data point radius.
Please review the following help topics to learn more: HeatmapProvider (WinForms) and HeatmapProvider (WPF).

DevExpress Map Control that displays a heatmap

Your Feedback

As always, we welcome your feedback. If you’re considering the Heatmap Control for an upcoming project or if you have technical questions, please post a comment below. We’ll be happy to follow-up.

Announcing DevExpress Mobile UI for .NET MAUI Preview 11

$
0
0

We are pleased to announce the newest preview release of our mobile controls for .NET Multi-platform App UI (.NET MAUI). In this post, I’ll summarize what’s inside this release and describe the enhancements we’ve introduced to our .NET MAUI component line. 

We released NuGet packages compatible with .NET MAUI Preview 11 on December 28th for upgrade via the command line, because the latest IDE preview was not yet released by Microsoft at that time. Yesterday, Microsoft released Visual Studio 2022 17.1 Preview 2 and officially announced .NET MAUI Preview 11 - please take special note of the following from the announcement:

Before installing Visual Studio 2022 Preview, we highly recommend starting from a clean slate by uninstalling all .NET 6 previews and Visual Studio 2022 previews. Now, install Visual Studio 2022 Preview (17.1 Preview 2) and confirm .NET MAUI (preview) is checked under the “Mobile Development with .NET workload”. If you already have 17.1 installed, then you can just perform an update from the Visual Studio installer.

Simplified .NET MAUI Handler Registration

The .NET MAUI platform requires the registration of handlers for each control used in an application. In some projects, you may be forced to configure dozens of handlers.

To help address this limitation, we've simplified the techniques used to set up handlers for our controls. With this update, you only need to call a single method — UseDevExpress. Once called, UseDevExpress will configure all DevExpress MAUI controls simultaneously.

Simplified handler registration
This technique will also be used in our .NET MAUI Project Templates for Visual Studio 2022 within a week or so. Please stay tuned.

.NET MAUI Chips

Chips were recently introduced in our Xamarin Forms product suite and are now available for .NET MAUI. These small but highly functional visuals allow users to make selections, filter content, input tokens, or trigger actions. The following chip types are supported:

  • Action Chips are like compact buttons and allow users to invoke an action related to primary content. For example, action chips may be used to display documents attached to emails.
  • Filter Chips allow users to select multiple options from a set. You can use filter chips to replace toggle buttons/checkboxes or use filter chips to display filters applied to content.
  • Choice Chips allow users to select a single option from a set. These chips are best used when only one choice is possible. Choice chips can be a good alternative to radio buttons and combo boxes.
  • Input Chips display user input as a single piece of information (may be validated, deleted, or modified). Input chips can be used to enter entities like places, activities, roles, tags, or email addresses.

To see Chips in action, please explore the following .NET MAUI demo app:  Chips (this app uses chips to change the size and color of a T-shirt for a UI superhero).

SuperHero demo app for iOSSuperHero demo app for Android

.NET MAUI Data Form

This preview release also includes our new MAUI Data Form — a control that allows you to display and edit business objects (from registration forms and employee profiles to shipping address information and everything in between). The DevExpress MAUI Data Form control automatically generates editors for each field within the business object and displays fields one below the other on screen.

Our Data Form demo app on GitHub creates a simple Data From based on a sample business object.

Data Form demo app for iOSData Form demo app for Android

Edit Form within our .NET MAUI Data Grid

One of the first controls we released for .NET MAUI was the DevExpress Data Grid. From its first release, our Data Grid allowed users to edit data values within individual grid cells. While this is a highly popular option, it is inefficient for tables with a large number of columns. If your MAUI app displays a table with many columns, or if you prefer not to allow in-cell data editing, you can now modify record values within our MAUI Edit Form. As you can see in the following image, our MAUI Edit Form displays all fields for a given record on a separate screen.

Data Grid demo app for iOSData Grid demo app for Android

.NET MAUI Navigation Controls – Now Available in iOS

Good news – our collection of .NET MAUI navigation controls —  TabView, TabPage, DrawerView, and DrawerPage — are now available for both iOS and Android. We have updated our Tab ViewTab PageDrawer Page, and Drawer View demo applications on GitHub. Feel free to run these apps on your favorite iOS device. 

Navigation demo app for iOSNavigation demo app for Android

Your Feedback Matters

As always, we welcome your thoughts. To share feedback, tell us about your long-term .NET MAUI development plans, or discuss your .NET MAUI-related needs, please email support@devexpress.com or submit a support ticket via the DevExpress Support Center.

ASP.NET Web Forms and MVC - Internet Explorer support questions

$
0
0

Our ASP.NET Web Forms and MVC components still support Internet Explorer 9+. Last versions of Internet Explorer have security risks and a lack of modern CSS approaches and JavaScript features. Development both for advanced and feature-poor browsers requires additional resources to find effective solutions for complex fixes and implement new functionality.

The public browser traffic analysis shows that Internet Explorer continues to lose popularity when compared to modern browsers. For instance, the graphic below illustrates that Edge has displaced Internet Explorer over recent years. 

Of course, we understand (and appreciate) that many of our customers are still working on projects started in the first decade of this century - when Internet Explorer was a major player in the browser space. Our main goal is to help you address your business needs in the most efficient manner possible and to that end, we need your feedback on a few key questions. Please take a minute to share Internet Explorer related feedback with us.

Reporting — Troubleshoot Report Printing Issues within the DevExpress Web Document Viewer

$
0
0
I try to print a document but nothing happens!

Ever heard this complaint from a customer?

Last year we encountered an issue with Google's Chrome browser when Chromium chose to discontinue support for scripts within PDF files. We used PDF scripting to print reports, and as such, this change affected our products immediately. Our customers complained that nothing happened when they tried to print reports...

Needless to say we changed our printing logic to address the issue and took steps to protect against unanticipated changes.

  • The following Document Viewer Print dialog appears when you click Print.

  • When a document is printed, an additional dialog appears automatically, with a link to the PDF file that was sent to the printer.

As you can see, this additional dialog includes a link to a copy of the PDF file. Should a print operation fail due to an unanticipated change within the browser, your users will be able to download this PDF file and use it within another application (for instance, Adobe Acrobat Reader) for printing purposes.

Said differently, the purpose of this dialog is to mediate issues should anything go wrong when the browser sends a document to the printer.

Once we released this feature, we received a number of requests to hide this dialog. With our most recent major update (v21.2), you can disable this property at runtime and prevent the appearance of the dialog:

Even if you choose to hide this additional print dialog, please incorporate an option to restore it should the need arise. This will help reduce overall risk and allow you to troubleshoot issues should browser-related changes affect print operations in the future.

Finally – our additional dialog only appears if you print and export reports from the same browser tab as the Document Viewer. The following property should be enabled in your application:

Applications that open a new tab to print or export a report do not display this dialog.

Feedback

As always, we welcome your thoughts/feedback. Post a comment below and let us know if there’s anything else we can do to help you with your report printing needs.

WinUI 3 – UWP’s Successor

$
0
0

As you already know, WinUI is Microsoft’s follow-up to UWP. As the successor to the UWP platform, Microsoft has invested heavily in the WinUI platform. According to Microsoft’s Windows UI Library roadmap, Microsoft will not introduce major changes to UWP – and to state the obvious – Microsoft will shift focus away from UWP in favor of WinUI 3. Here is a specific quote regarding .NET 5/6 support from Microsoft (GitHub discussion):

If you need to use .NET 5/6 in your UWP project type, we recommend you migrate your project to a WinUI 3 desktop project, since .NET 5/6 will not be coming to UWP project types.

Accordingly, we have decided to fully invest our energies on WinUI 3 and abandon any additional work (albeit minor work) on UWP.

What this means for active DevExpress UWP users.

  • We will replace UWP with WinUI components in our v22.1 release. UWP controls and demos will be removed from all distributions/installations.
  • We will continue to provide support and minor updates to our UWP controls until December 2022. Of course, we will make exceptions if critical/security issues arise.
  • We will announce licensing/pricing plans as we near our v22.1 release date (expected May 2022). We will also offer our UWP customers an upgrade path to our new WinUI Subscription.
  • DevExpress WinUI components are available free of charge until our official v22.1 release. If you are considering WinUI for a future project, be sure to download your free copy today. This free WinUI offer will expire on May 1, 2022.

Should you have questions about our decision to terminate UWP related development or to discuss the impact of this decision on a current project, please submit a ticket via the DevExpress Support Center. We will be happy to follow up.

Blazor Components - 2022 Survey

$
0
0

We hope you had a happy and healthy holiday season.

We’ve nearly completed our 2022 Blazor Roadmap. Here’s a brief overview for our upcoming development plans (a blog post will be published shortly):

  • Release our new Blazor Grid (with essential features)
  • Deliver upgraded Blazor Editors
  • Develop new Blazor Layout components
  • Add more features to existing Blazor controls

In short, we’re focusing on highly requested features. However, there are two recent issues that may consume our resources and delay our product deliverables. To help us finalize and publish our Blazor roadmap, we need your feedback on the following:

1. AoT Compilation & Trimming

As you may already know, Microsoft released Visual Studio 2022 and .NET 6 on November 8th, 2021.

DevExpress Blazor components support these products with our latest minor release (v21.2.4).

Limitations

Currently, our Blazor components do not support the following .NET 6 enhancements for Blazor Web Assembly applications:

We recently discovered that AOT-compiled applications raise runtime exceptions. However, if AOT is disabled, the Web Assembly apps work without issues. If you encounter this issue, I recommend disabling AOT by removing the RunAOTCompilation option or setting it to false in your .csproj file:

<PropertyGroup>
  ...
  <RunAOTCompilation>false</RunAOTCompilation>
</PropertyGroup>

We are actively working on this complex issue both internally and with the Microsoft Blazor team. The main challenge is that the new AOT compiler lacks an effective way to debug the compiled assembly or map it to its source code.

We will continue to look for a solution, however, this unexpected task may delay our Blazor plans. Please fill out the survey below and tell us how important these recent features are for your Blazor projects.

2. Bootstrap Native Render

Our Blazor components render their HTML using Bootstrap which offers several advantages:

  • Out-of-the box integration with Bootstrap themes supplied by Bootsrap contributors and third-party developers
  • Application-level adaptivity
  • Consistent look-and-feel across browsers and devices

The inherent advantage of using Bootstrap for constructing web user interfaces is that it allows for developing responsive layouts and provides your web application production-quality visual design from the start.

Limitations

However, we've found several component-specific issues: Bootstrap UI/UX is missing several key UI elements and features (e.g. hover state, bottom or side tabs, popup footers), the focus on data editor only highlights the text field instead of the entire component, read-only state is not supported, and Bootstrap themes have large/wide paddings that is great for mobile/touch screen devices but waste space on desktop layouts.

Rest assured, we've implemented custom (non-Bootstrap) code in our themes to overcome these annoyances and support the common features you've come to expect from our components. Therefore, our components may differ from classic Bootstrap – as our themes must support more component features.

We need your feedback to determine whether native Bootstrap rendering is important within your Blazor application.

Survey

Please help us prioritize our 2022 objectives by completing out this survey:

Office File API & Office-Inspired Desktop UI Controls - Use Custom Fonts without Installation on the System (v21.2)

$
0
0

In our most recent major release (v21.2), we added custom font support to our Spreadsheet and Word Processing product lines. This new feature applies to the following products/libraries:

You can now load and apply custom fonts to avoid font substitution effects when you display, print, or export (to PDF) documents (when/if a document includes fonts not installed on the target operating system, in Azure App Service, or a Docker container). With this new feature, you can be certain that your documents will look as intended no matter which fonts are available on a user’s computer.

Custom fonts are stored in FontRepository. The FontRepository.AddFont method overloads allow you to load necessary fonts from files, streams, and byte arrays. We recommend that you add fonts to FontRepository before you import a document using these fonts (otherwise, the document’s layout will be recalculated each time a new custom font is loaded).

Loaded fonts are available to all instances of the DevExpress Spreadsheet and Word Processing components within a project (WinForms-WPF-Office File API).

You can load fonts in the following formats:

  • TrueType fonts (.TTF)
  • OpenType fonts that use CFF (Compact Font Format) glyph outlines (.OTF)
  • OpenType Font Collections (.TTC, .OTC) that contain multiple fonts in a single file

To help you apply this new feature in your next project, we created a simple example that uses the Rye Google font (the document is exported to PDF):

This example uses our Word Processing Document API library to load a Word document, format document content, and export the result to PDF.

using DevExpress.Office;
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using System.Drawing;

// ...
// Load custom font.
FontRepository.Instance.AddFont(@"Fonts\Rye-Regular.ttf");

using (var wordProcessor = new RichEditDocumentServer()) {
Document document = wordProcessor.Document;
// Load document.
document.LoadDocument(@"Documents\HansInLuck.docx");

// Format first paragraph. 
var titleFormatting =
    document.BeginUpdateCharacters(document.Paragraphs[0].Range);
titleFormatting.FontSize = 30;
titleFormatting.FontName = "Rye";
titleFormatting.ForeColor = Color.FromArgb(0x94, 0x36, 0x34);
document.EndUpdateCharacters(titleFormatting);

// Save document as PDF.
wordProcessor.ExportToPdf(@"Documents\HansInLuck.pdf");
}

The FontRepository class ships with the GetFonts method. This method allows you to obtain information (such as font name and style) about all fonts in the repository. Call the Clear method to clear the font repository.

Limitations

Our custom font loading engine has the following limitations:

  • Loaded fonts are not embedded in your Word or Excel document. These fonts are used when you display the document in the Spreadsheet or Rich Text Editor’s UI, print, or save the document as PDF.
  • Loaded fonts are not displayed in the drop-down list of the Spreadsheet or Rich Text Editor’s font editor.

Your Feedback Matters

We’d love to know what you think of custom font support within our Office-inspired product line. Please share your thoughts in the comment section below or submit a support ticket via the DevExpress Support Center.

WPF Components on Windows ARM Devices

$
0
0

As you know, .NET 6 includes support for Windows ARM64, including native ARM64 execution.

If ARM64 is on your radar, here is what you need to remember when using DevExpress WPF components on ARM64 devices.

You will need Visual Studio 2022 (v17.0 and newer) to build your WPF apps for ARM64 environments. It includes the .NET 6 SDK, but we recommend that you update to the newest version. You can download the .NET 6 SDK for Windows ARM64 from this page: https://dotnet.microsoft.com/en-us/download/dotnet/6.0

Once your development environment is ready/updated, simply rebuild your DevExpress-powered .NET 6 WPF application. That’s it – that’s all you’ll need to do. Your application should run natively on ARM64 platforms, with performance comparable to that of apps running on desktop Windows.

Targeting ARM64?

Are you planning (or have you already tried) to build WPF apps for ARM64? If so, please comment below and let us know more about your long-term development plans in this regard.


WinUI 3 Performance Boost

$
0
0

Performance and UI rendering speed remains at the top of our WinUI priority list. In this blog post, we will describe performance challenges we’ve encountered with WinUI and what we’ve done to address these issues. We’ll also show you how we created the fastest Data Grid for Microsoft’s new WinUI platform.

WinUI Performance Bottlenecks

First a refresher as to how the WinUI platform was constructed and architectural differences from its predecessors (WPF and WinForms). In WPF and WinForms, components and their core logic are implemented within standard .NET libraries. For example, base WPF classes such as DependencyObject are fully implemented in .NET and you can always see what logic is executed when a dependency property changes. Unmanaged code is used only for UI rendering and user interaction (implemented using Windows API calls).

In WinUI, all internal logic is implemented with native WinRT components and Windows App SDK ships only .NET wrappers for these components. The DependencyObject class initializes a WinRT object mapped to the IDependencyObject interface and uses this object when a dependency property setter or getter is invoked:

[WindowsRuntimeType("Microsoft.UI")]
[Guid("9FB92D6F-2CC3-5892-ABB3-45F6461EA7E4")]
[ContractVersion(typeof(WinUIContract), 65536)]
internal interface IDependencyObject
{
    object GetValue(DependencyProperty dp);
    void SetValue(DependencyProperty dp, object value);
    //...
}
public class DependencyObject : ICustomQueryInterface, IWinRTObject, IDynamicInterfaceCastable, IEquatable<DependencyObject>
{
    public object GetValue(DependencyProperty dp) => this._default.GetValue(dp);
    public void SetValue(DependencyProperty dp, object value) => this._default.SetValue(dp, value);

    private IObjectReference _inner;
    private IDependencyObject _default => this._defaultLazy.Value;
    private readonly Lazy<IDependencyObject> _defaultLazy;

    protected DependencyObject()
    {
        bool flag = this.GetType() != typeof(DependencyObject);
        IntPtr innerInterface;
        IntPtr instance = DependencyObject._IDependencyObjectFactory.Instance.CreateInstance(flag ? (object)this : (object)(DependencyObject)null, out innerInterface);
        try
        {
            ComWrappersHelper.Init(flag, (object)this, instance, innerInterface, ref this._inner);
            this._defaultLazy = new Lazy<IDependencyObject>((Func<IDependencyObject>)(() => (IDependencyObject)new SingleInterfaceOptimizedObject(typeof(IDependencyObject), this._inner)));
            this._lazyInterfaces = new Dictionary<Type, object>();
        }
        finally
        {
            Marshal.Release(innerInterface);
        }
    }
    //...
}

This architecture allows WinUI components to offer faster rendering, animation support, and higher FPS. Unfortunately, each action within a component requires WinRT interop, which is slow. The following table demonstrates the dramatic (negative) effects of WinRT interop on dependency properties:

ActionWPF, nsWinUI, ns
Get192023
Set1354272
Set with property change handler13920431
Set to the same value 894150
Set TextBlock.Text253725
Set Border.Background 2482412

You can learn more about this issue in the following GitHub discussion: Dependency property is much slower in WinUI 3 than in WPF.

DevExpress Data Grid Performance Optimizations

Though WinUI’s architecture complicates our job as a component vendor, we have taken a series of steps to minimize WinUI’s negative impact on rendering performance. Typically, complex WinUI components consist of multiple visual elements. With v21.2, we minimized the number of internal elements and reduced the number of dependency properties.

These changes produced significant (and beneficial results). As you can see in the chart below, our WinUI Data Grid is now very fast (we think it’s the fasted WinUI Data Grid on the market today)

Startup Performance

Startup Performance

Scrolling Performance

Scrolling Performance

With v22.1 the control used to display cells (CellControl) is inherited from the standard Panel class and all parts are created internally. The layout is determined via Measure and Arrange methods. Additionally, the CellControl class doesn’t have custom dependency properties and you can’t customize it. The same optimization was made in the control used to represent rows (RowControl). We also enhanced our virtualization mechanism so that cell DataContexts are not modified during scroll operations.

These changes helped produce a breakthrough in terms of performance. Unfortunately, creating controls internally reduced customization options (to a certain degree). To compensate for this, we added APIs to improve cell/row customization (make it simple and flexible). For example, the RowStyleSettings allows you to customize static row appearance settings:

<dxg:GridControl.RowStyleSettings> 
      <dxg:RowStyleSettings Background="LightGray" 
                              SelectedBackground="PaleVioletRed"  
                              FocusedBackground="LightBlue"  
                              FocusedSelectedBackground="Orange"  
                              HoverBackground="LightGreen"  
                              FocusedBorderBrush="Red"  
                              FocusedBorderThickness="1"  
                              FocusedCornerRadius="5"/> 
</dxg:GridControl.RowStyleSettings>

To change row appearance (based on data), you can use Conditional Formatting. We are also working on creating properties to customize different row sections and offer you maximum development flexibility.

What's Next?

Performance: Our latest release already addresses major performance challenges, but we still see room for improvement. For example, if you add standard controls such as CheckBox or ProgressBar to cells, you may notice a slight decrease in responsiveness. This happens because controls change their state frequently during scrolling and cause WinRT interop. We expect to create optimized grid cells controls (such as CheckBoxes and ProgressBars) this year.
More Controls – Extended Features: We will release additional UI controls and address a broader range of usage scenarios in 2022. We expect to publish a roadmap later this month. Please stay tuned for more information in this regard.

Your Feedback Matters

Should you have any questions about our WinUI product line, or if you’d like to discuss your WinUI development needs with us, please comment below or create a new DevExpress Support Center ticket.

Reporting — Enhancements, Documentation Updates, Tips & Tricks (January 2022)

$
0
0

A Few Recent Enhancements

Visual Studio Report Designer - Improved Error Handling

Our Visual Studio Report Designer for .NET 6 / .NET 5 / .NET Core apps tracks the Microsoft.CodeAnalysis NuGet package and informs you if it is not referenced when your project includes scripts (error XRD105).

Entity Framework Core 6 in the Visual Studio Report Designer

Entity Framework 6 support is now included in our Visual Studio Report Designer for .NET 6 / .NET 5 / .NET Core apps. You can use this framework to bind your reports to MS SQL, MS SQL Compact Edition, PostgreSQL (Npgsql), and SQLite databases. Please leave a comment below if you'd like us to support other providers.

Improved Crystal Reports Conversion Engine

This round of updates to our report conversion tool includes support for subreport parameters.

Documentation Updates

New topics in the Reporting for Blazor help section:

Updates to the Use Report Scripts help section describe how to debug your application on .NET 6, .NET 5, and .NET Core.

Updates to the help topic on how to implement a custom parameter editor:

A new help topic on how to register scripts in your web applications:

New topics in the Create Reports in Code help section:

Interesting Support Tickets

Multiple Supported Platforms

Reporting for WinForms

Reporting for WPF

Reporting for Blazor

Reporting for ASP.NET Core

Reporting for ASP.NET MVC

Your Feedback Matters

As always, we welcome your thoughts/feedback. Please post a comment below and let us know how we can help.

DevExpress Localization in .NET Apps - Your Feedback Matters

$
0
0

As you may recall from my recent blog post, our Unified Component Installer will soon include an option to install localized resources for certain languages (DE, ES, JA, RU). We will not install these resources by default – you can install them at your discretion. NOTE: based on actual usage, we may completely remove these localization resources from the Unified Component Installer in favor of the DevExpress Localization Service.

If you localize your apps OR plan to create multilingual apps...

We hope to validate a few more hypotheses about our Localization Service, Unified Component Installer, overall localization quality, and ways to translate strings in general. To help us finalize our 2022 development strategy in this regard, please complete the survey below. Your feedback is crucial.

If you have only English-speaking clients OR English is sufficient for your international clients, please skip this survey.

Scaffolding Wizards (for WPF and WinForms) – The Past and the Future

$
0
0

In this blog post, we’ll quickly summarize the history behind our Scaffolding Wizard, and explain why we’ve chosen to cease additional development on the wizard itself.

The Past (circa 2013)

In 2013, we created our WPF Scaffolding Wizard to help generate a simple application from a data model. We developed the WPF Scaffolding Wizard rather quickly and added it to our WinForms suite a couple of years later. The wizards were well received, so we continued to add new features to the wizard – features that made the Scaffolding increasingly complex.

As complexity rose, so too did confusion. The Scaffolding Wizard could generate large projects with multiple folder levels, several classes and styles, and complex communications between different levels. Feedback through support tickets made us realize that users struggled to adapt Scaffolding projects to their needs. We could neither add new features, nor simplify Scaffolding without losing core functionality. In recent years, we have only modified the Scaffolding Wizard to address bugs/issues. Major Visual Studio updates caused new issues: WinForms Scaffolding hanged in certain scenarios in Visual Studio 2019 and we couldn’t find a way to fix this. When Visual Studio 2022 was released, we noticed that the Scaffolding Wizard no longer had a viable path forward (due in part to significant design-time changes in Visual Studio). We spent a long time trying to fix design-time issues, but ultimately realized that it’s almost impossible without reworking the entirety of the Scaffolding Wizard and its underlying structure.

The Present and Future

We’ve been forced to make a tough decision and one that may disappoint some of our loyal users. We have opted to end efforts to adapt the Scaffolding Wizard to Visual Studio 2022. While this is not good news, our experience with Visual Studio 2022 and its design time inspired us to create a new wizard that generates a simple and flexible code for CRUD operations based on a data source. The wizard won’t create a complex hierarchy, so you will be able to easily adapt the generated code to your needs.

How our decision affects current Scaffolding users

  • Scaffolding Wizard Items will be removed from Visual Studio 2022 in the next minor update (v21.2.6).
  • We will remove Scaffolding Wizard Items from all Visual Studio versions in our v22.1 release cycle.
  • You will still be able to work on projects generated with prior versions of DevExpress/Visual Studio products.
  • We will continue fixing issues discovered within the Scaffolding Wizard until December 2022.
  • We expect to release WPF Items Source Wizard in v22.1. The Item Source Wizard will allow you to generate simple code for CRUD operations based on your data source. We've prepared an example to demonstrate the user scenarios our new wizard will support: Implement CRUD Operations in the WPF Data Grid

Should you have questions about our decision to terminate Scaffolding Wizard-related development or the impact of this decision on a current project, please submit a support ticket via the DevExpress Support Center. We will be happy to follow up.

PDF Document API – How to Use Page Facade API to Update Bates Numbering (v21.2)

$
0
0

Though the digital realm has overtaken much of society, paper documents or “paper trails” remain crucial for certain market segments (for instance, the legal professionals often produce paper documents that span hundreds, if not thousands of pages).

To help better organize and identify these documents, you can use different indexing methods, including Bates numbering. In this blog post, we’ll show you how to use DevExpress PDF Document API to update sequential page numbering across PDF files, and also review a couple of content-related enhancements we introduced in our most recent major release (v21.2).

For this example, we’ll use the DevExpress.com Privacy Policy with customized Bates numbering - digital reference points used to uniquely identify and label each page. These reference points contain page information (page number and number of all pages).

When the document changes (another document is appended), page information also changes. We need to find initial identifiers, remove them, and add new identifiers with current information throughout the document.

Our PDF Document API (v21.2) includes Facade API enhancements - PdfPageFacade.ClearContent method overloads allow you to clear content from one/multiple page areas and specify which content type to retain.

Call the PdfDocumentProcessor.FindText method to find the numbering string and obtain its location. Pass the location for the PdfPageFacade.ClearContent method parameter to remove initial identifiers. Since identifiers have the same location on each page, we can use the retrieved location for the entire document.

using (var pdfDocumentProcessor = new PdfDocumentProcessor())
{
  // Load a document  
  pdfDocumentProcessor.LoadDocument("Documents//Document1.pdf");               

  // Remove numbering from the initial file
  RemoveNumbering(pdfDocumentProcessor);

  //…

private static void RemoveNumbering(PdfDocumentProcessor pdfDocumentProcessor)
{
  PdfRectangle textRectangle = null;

  int pageCount = pdfDocumentProcessor.Document.Pages.Count;
  string text =
      string.Format("Case 0001, 00001 Page 1 of {0}", pageCount);

  // Find the identifier string
  PdfTextSearchResults numeration = pdfDocumentProcessor.FindText(text);

  // If the string is found, obtain its rectangle
  if (numeration.Status == PdfTextSearchStatus.Found)
  {
    textRectangle = numeration.Rectangles[0].BoundingRectangle;
  }

  // The identifier is located at the same position on each page
  // Clear the obtained rectangle on each page
  foreach (PdfPageFacade pageFacade in pdfDocumentProcessor.DocumentFacade.Pages)
  {
    pageFacade.ClearContent(textRectangle);
  }
}

At this point, we can append another document and add new numbering to all pages. We will use PDF Graphics API to draw a new text string at the top right corner of each page:

  //…
  // Append another document
  pdfDocumentProcessor.AppendDocument("Documents//Document2.pdf");

  using (SolidBrush textBrush = new SolidBrush(Color.FromArgb(255, Color.SlateGray)))
  {
    // Create new numbering with current page information
    AddGraphics(pdfDocumentProcessor, textBrush);
  }

  // Save the result
  pdfDocumentProcessor.SaveDocument("Documents//DevExpress Privacy Policy.pdf");
}

static void AddGraphics(PdfDocumentProcessor processor, SolidBrush textBrush)
{
  float DrawingDpi = 72f;
  IList<PdfPage> pages = processor.Document.Pages;
  for (int i = 0; i < pages.Count; i++)
  {
    // Specify identifier format
    PdfPage page = pages[i];
    int pageCount = pages.Count;
    int number = page.GetPageIndex() + 1;
    string text =
        string.Format("Case 0001, {0:00000} Page {0} of {1}", number, pageCount);

    using (PdfGraphics graphics = processor.CreateGraphics())
    {
      // Obtain page size
      var cropBox = page.CropBox;
      SizeF pageSize = new SizeF((float)cropBox.Width, (float)cropBox.Height);
      
      using (Font font = new Font("Segoe UI", 14, FontStyle.Regular))
      {
        // Define identifier size
        SizeF textSize =
            graphics.MeasureString(text, font, PdfStringFormat.GenericDefault, DrawingDpi, DrawingDpi);

        // Calculate a point to insert numbering
        PointF topRight = new PointF(pageSize.Width - textSize.Width, textSize.Height);

        // Draw a numbering string
        graphics.DrawString(text, font, textBrush, topRight);

        // Add the resulting graphics to page foreground
        graphics.AddToPageForeground(page, DrawingDpi, DrawingDpi);
      }
    }
  }
}

As you can see below, each document page includes the following updated identifier:

The Facade API is also available in our WinForms PDF Viewer and WPF PDF Viewer controls. Call the PdfViewerExtensions.GetDocumentFacade method to retrieve the DocumentFacade object. Add the DevExpress.Docs.v21.2.dll assembly to your project to use extension methods.

IMPORTANT NOTE: Please remember that you must own an Office File API or Universal Subscription to use this assembly/capability in production code. If you currently own a WinForms Subscription/WPF Subscription and if you’d like to use this new capability in your WinForms/WPF app, please contact our Client Services team (clientservices@devexpress.com). We’ll be happy to help you upgrade your subscription.

Try It Now

To explore the PDF Clear Page Content feature in greater detail, be sure to check out our new Office File API demo module:

PDF Clear Page Content

This demo allows you to remove content from the selected page area. Use checkboxes in the Options section to specify the content to retain in the selected area.

Your Feedback Matters

We’d love to know what you think of our PDF Facade API within our Office-inspired/PDF product line. Please share your thoughts in the comment section below or submit a support ticket via the DevExpress Support Center at your convenience.

Reporting — Introducing the Document Viewer for WinUI (v21.2)

$
0
0

As you may already know, we recently released a production-ready WinUI Document Viewer for DevExpress Reports. Like other platform-specific Document Viewers, you can use this new addition to our reporting platform to display, print, and export report documents within your next WinUI-powered application.

If you are new to WinUI or considering it for a future project, please refer to the following blog post to learn more about our full-range of WinUI components: FREE WinUI Controls - Windows App SDK 1.0 Support, Data Grid Performance Enhancements, and the Future (v21.2).

WinUI Document Viewer - Key Features

The DevExpress Document Viewer for WinUI ships with the following built-in features:

  • Allows you to view, print, and export your reports.

  • Specify report parameters (both through the user interface and in code).

  • Open and save .PRNX documents generated from previewed reports.

  • Invoke Document Viewer commands from code and customize the toolbar. See the following help topic for information in this regard: API and Customization.

  • Like all DevExpress WinUI components, the Document Viewer complies with the latest design guidelines from Microsoft. New appearance and UI elements include support for dark/light themes, Segoe Fluent Icons font, and Windows 11 typography.

  • Last but not least, our WinUI Document Viewer is compatible with reports created via the DevExpress Visual Studio Report Designer.

How to Get Started

Ready to integrate DevExpress Reports and our Document Viewer in your next WinUI project? To get started, please review the following help topic: WinUI Document Viewer, and explore the following demo: WinUI Demos.

In v21.2, you can use DevExpress WinUI controls free of charge, but this free offer expires on May 1, 2022. Visit the following page to obtain your free WinUI package: WinUI Controls v21.2 – Free Offer from DevExpress.

Your Feedback Drives Future Development

WinUI is a rapidly evolving platform. We expect to evolve alongside the platform and will enhance our WinUI Document Viewer throughout this year (our goal is to offer feature parity with its WPF counterpart).

If you are targeting or considering the WinUI platform, be sure to comment below to give us better understanding of your plans and use-cases. Let us know if you would be interested in a Ribbon Toolbar for the Viewer, the ability to select and copy previewed content, and tell us your thoughts on interactive features like editing fields (or anything that comes to mind).

Blazor Navigation and Layout - Menu Data Binding, Context Menu Templates, and new Tabs Scroll Modes (v21.2)

$
0
0

As you may already know, our most recent release (v21.2) includes a series of enhancements for the following DevExpress Blazor layout components: Blazor Menu, Blazor Context Menu, and Blazor Tab control.

Menu Data Binding

Our Blazor Menu control can be bound to both hierarchical or flat data. To incorporate the DevExpress Blazor Menu control in your next Blazor app, assign your data source to the component's Data property, add a DxMenuDataMapping item to the DataMappings collection, and map item properties (text, icon, and so on) to data source fields.

Additional settings are driven by data type.

Binding to Hierarchical Data

To bind the Menu component to hierarchical data and obtain the child item collection from the corresponding data source field, specify the DxMenuDataMapping.Children property.

You can define item hierarchy levels by using different item collections types. To specify different mappings for different hierarchy levels, add multiple DxMenuDataMapping items and specify the Level property for each instance.

<DxMenu Data="@Data">
  <DataMappings>
    <DxMenuDataMapping Text="CategoryName" Children="Products"/>
    <DxMenuDataMapping Level="1" Text="ProductName"/>
  </DataMappings>
</DxMenu>

@code {
  public IEnumerable<ProductCategory> Data => new List<ProductCategory>() {
    new ProductCategory() { CategoryName = "Bikes", Products = {
        new Product { ProductName = "Mountain Bikes" },
        new Product { ProductName = "Road Bikes" }
      }
    },
    new ProductCategory() { CategoryName = "Clothing", Products = {
        new Product { ProductName = "Bib-Shorts" },
        new Product { ProductName = "Caps" },
        new Product { ProductName = "Gloves" }
      }
    } ,
  ...
  };
  public class ProductCategory {
    public string CategoryName { get; set; }
    public List<Product> Products { get; } = new List<Product>();
  }
  public class Product {
    public string ProductName { get; set; }
  }
}

Binding to Flat Data

To bind the Menu component to flat data (wherein parent-child relationships are defined by specific item properties), simply set the following property values:

<DxMenu Data="@Data">
  <DataMappings>
    <DxMenuDataMapping Key="ID"
      ParentKey="CategoryID"
      Text="Name" />
  </DataMappings>
</DxMenu>

@code {
  public IEnumerable<ProductDataItem> Data => new List<ProductDataItem>() {
    new ProductDataItem() { ID = 0, Name = "Bikes" },
    new ProductDataItem() { ID = 1, Name = "Mountain Bikes", CategoryID = 0 },
    new ProductDataItem() { ID = 2, Name = "Road Bikes", CategoryID = 0 },
    new ProductDataItem() { ID = 3, Name = " Clothing" },
    new ProductDataItem() { ID = 4, Name = "Bib-Shorts", CategoryID = 3 },
    new ProductDataItem() { ID = 5, Name = "Caps", CategoryID = 3 },
    new ProductDataItem() { ID = 6, Name = "Gloves", CategoryID = 3 },
    ...
  };

Our Blazor Menu includes a single class ProductDataItem - whose objects encapsulate category and product data. Note that this class includes an additional property (Category ID - used to map products to a corresponding category):

  public class ProductDataItem {
    public object ID { get; set; }
    public object CategoryID { get; set; }
    public string Name { get; set; }
  }
}

Binding to Observable Collection

The DevExpress Blazor Menu component automatically re-renders items if its data source uses a collection that implements the INotifyCollectionChanged interface. For example, when you add/remove an item, or clear the child item collection, a data change notification is sent to the menu component by the INotifyCollectionChanged interface.

Demo | Documentation

Context Menu Templates

Our Blazor Context Menu allows you to modify the layout and appearance of its items and submenus. You can use the following new properties to specify both common and individual item templates:

The following code demonstrates how to create copy/cut/paste UI menu items using the templates:

<DxContextMenu @ref="@ContextMenu" Data=@commands ItemClick="@OnItemClick">
  <DataMappings>
    <DxContextMenuDataMapping Text="Name" IconCssClass="IconCssClass" BeginGroup="BeginGroup" />
  </DataMappings>
  <ItemTemplate>
    <div class="d-flex px-2 py-1">
      <span class="mr-1 @context.IconCssClass"></span>
      @context.Text
      <span class="ml-auto">@(((MenuCommand)context.DataItem).Shortcut)</span>
    </div>
  </ItemTemplate>
</DxContextMenu>

The following code demonstrates how menu item data objects are created:

List<MenuCommand> commands = new List<MenuCommand> {
  new MenuCommand() { Name = "Copy", IconCssClass = "menu-icon-copy menu-icon", Shortcut = "Ctrl+C" },
  new MenuCommand() { Name = "Cut", IconCssClass = "menu-icon-cut menu-icon", Shortcut = "Ctrl+X" },
  new MenuCommand() { Name = "Paste", IconCssClass = "menu-icon-paste menu-icon", Shortcut = "Ctrl+V" },
  new MenuCommand() { Name = "Select All", IconCssClass = "menu-icon-selectall menu-icon", Shortcut = "Ctrl+A", BeginGroup = true }
};

blazor-context-menu-templates

Demo | Documentation

Tabs Scroll modes

In previous versions, tabs were moved to a new line when they extend beyond a container's width. With our most recent release (v21.2), our Tabs component for Blazor allows you to specify whether to display overflowing tabs and how the user can navigate to them via the new DxTabs.ScrollMode property:

  • Swipe - The container only displays tabs that fit the container's width. To navigate to other tabs, users can scroll the container via our scrolling mechanisms based on device type: hover the container, hold Shift and scroll the mouse wheel on desktop devices or swipe to the left or right within the container on mobile and tablet devices.
  • NavButtons - The container only displays tabs that fit the container's width. Users can click the left or right navigation button to scroll the container and navigate to other tabs. Navigation via the scrolling mechanisms mentioned above is also supported.
  • Auto - Scroll mode adapts to device type. Mobile and tablet devices use Swipe mode. Desktop devices use NavButtons mode.
  • NoScroll - Users cannot scroll tabs. Tabs are moved to a new line when they extend beyond a container's width.

For example, the code below sets scroll mode to Auto :

<DxTabs ScrollMode='TabsScrollMode.Auto'>...</DxTabs>

In this instance, tab navigation buttons appear on desktop devices when space prohibits the display of all tabs:

blazor-tabs-scroll

Swipe scrolling is also enabled for mobile and tablet devices:

blazor-tabs-scroll-mobile

Demo | Documentation


Join Us in Celebration as .NET Turns 20

$
0
0

Throughout the month of February, we will be celebrating .NET’s 20th birthday and its 20 years of innovation! You can join the celebration as well. Share your .NET stories and custom-made .NET bots, join Microsoft for a live broadcast, or answer .NET trivia questions and win prizes.

.NET Development Framework Turns 20

Share Your .NET Story

Let the world know how .NET helped you produce better software, faster. Share your @dotnet story and don't forget to use hashtag #dotNETLovesMe. And if DevExpress was of help, feel free to mention us.

Create Your .NET Bot

Time to get creative. Microsoft designers came up with a fun way to share your love for .NET. You can create and customize your own .NET bot and post it on social media. We will be working on a few of our own - you'll see them soon in our Twitter feed.

Create and Share Your .NET Bot

Join the .NET 20th Anniversary Broadcast

Microsoft is hosting a .NET 20th anniversary broadcast on February 14th - a live 30-minute event streaming on dotnet.microsoft.com, LearnTV, YouTube, Twitch, and Twitter. We will definitely join with our watch party.

Answer Trivia Questions and Win Prizes

Look out for .NET trivia questions that Microsoft will post via the @dotnet handle throughout the month of February. Answer and win prizes!

WPF Controls — Remote Desktop Performance Enhancements

$
0
0

The COVID-19 pandemic has forced businesses to regroup and reimagine the workplace (remote work is now a reality for many). Accordingly, the use of remote desktop has increased substantially and we’ve taken steps to ensure that our WPF products perform well when executed on remote devices.

Last year, we received feedback from some users about application slowdowns after multiple sign-out/sign-in operations. Addressing this issue was placed atop our priority list. In our v21.2 release cycle (and a subsequent v21.1.6 update) we updated our WPF theme cache engine to address this issue.

As you can see below, the change to our theme cache engine boosted performance quite substantially (we measured the difference in render time for our Outlook Inspired demo project):

Your Feedback Matters

Do your users/customers access a DevExpress-powered desktop app via remote desktop? If so, please comment below or create a support ticket on the DevExpress Support Center. We’d love to discuss your business requirements in greater detail (and see how we can further enhance our desktop product line for use in remote work environments).

Announcing DevExpress Mobile UI for .NET MAUI Preview 12

$
0
0

We are happy to announce the immediate availability of DevExpress Mobile UI for .NET MAUI Preview 12, AND our newest .NET MAUI offerings – the DevExpress .NET MAUI Scheduler and Popup control. With this release, our .NET MAUI component suite now offers the same component set as its free Xamarin Forms counterpart.

To learn more about our .NET MAUI product line, point your browser to our online help system.

.NET MAUI Scheduler

As you know, the DevExpress .NET MAUI Scheduler control offers an alternative to standard iOS and Android schedulers and allows you to incorporate a consistent look/feel/experience across both platforms. To get started with our .NET MAUI Scheduler, explore our demo app on GitHub and check out the following help topic:  .NET MAUI Scheduler.

Scheduler demo app for iOSScheduler demo app for Android

.NET MAUI Popup Dialog

Our .NET MAUI Popup allows you to request additional information from a user and/or display app notifications as requirements dictate. Documentation | Demo app on GitHub.

Popup Dialog demo app for iOSPopup Dialog demo app for Android

Your Feedback Matters

As always, we welcome comments/feedback. To share your thoughts or tell us about your long-term .NET MAUI development plans (or discuss your .NET MAUI-related needs), please email support@devexpress.com or submit a support ticket via the DevExpress Support Center.

Dependency Injection in a WPF MVVM Application

$
0
0

When a solution grows in size and scope, it becomes much harder to maintain overall app flexibility. Dependencies between objects grows and altering one class may require updating others. Dependency Injection (DI) can help address this challenge.

As you know, dependency injection is a form of “inversion of the control” (IoC) programming principle. This means that classes don’t create the objects they rely on. DI frameworks have containers responsible for revealing and resolving dependencies.

Which Issues can be Resolved by Dependency Injection?

Let’s say you have a view model that uses a data service to obtain data:

publicclassUserViewModel
    {
        MyDataService dataService;
        publicUserViewModel() {
            this.dataService = new MyDataService();
        }
    }

The view model depends on a service - which means that MyDataService is UserViewModel’s dependency. It’s very easy to create the service directly in the view model class, but there are several drawbacks to this approach:

  • Classes are closely connected. Each time you use UserViewModel, it implicitly creates an instance of MyDataService.
  • If you modify the manner in which MyDataService is initialized in the future, you will have to modify all view models wherein MyDataService is initialized.
  • You cannot create a unit test specifically for the UserViewModel class, because it depends on MyDataService. If a test fails, you may not be able to determine whether the error is in UserViewModel or MyDataService.

You can avoid these issues if you pass MyDataService to the UserViewModel’s constructor:

publicclassUserViewModel
    {
        MyDataService dataService;
        publicUserViewModel(MyDataService dataService) {
            this.dataService = dataService;
        }
    }

Unfortunately, this technique also has flaws:

  • Different view models are created in each class and all of them must know how to create MyDataService.
  • It can be difficult to share the same instance of MyDataService between multiple view models without creating a static property.

The main idea of dependency injection is to resolve all dependencies centrally. This means that you have a separate block in your program to initialize new class instances and pass parameters to them. Although you can implement your own logic for this, it’s much more convenient to use a DI framework to help avoid/eliminate boilerplate code.

The dependency injection pattern has the following advantages:

  • Classes are loosely coupled with one another. As a result, you can easily modify dependencies. For example, replace MyDataService with MyDataServiceEx.
  • It’s easy to create unit tests, because you can pass mock parameters to tested classes.
  • Your project is well structured, because you always know where all dependencies are managed.

Apply Dependency Injection to a WPF Application

The .NET community has many great frameworks to help you implement the Dependency Injection pattern in your application. All these frameworks have two main features:

  • You can register classes in containers.
  • You can create objects with initialized dependencies

Containers are central objects in DI frameworks and automatically detect and resolve class dependencies. Certain frameworks can inject parameters into class properties, but the most common way is to inject parameters into a constructor.

Let’s modify the MainViewModel constructor so that it accepts an interface instead of a class:

publicclassMainViewModel
    {
        IDataService dataService;
        publicMainViewModel(IDataService dataService) {
            this.dataService = dataService;
        }
    }

This will allow you to use different IDataService implementations in the future.

Once we make this change, we need to create a DI container to register MyDataService and instantiate MainViewModel:

protected override void OnStartup(StartupEventArgs e) {
    base.OnStartup(e);
    var builder = newContainerBuilder();
    //allow the Autofac container resolve unknown typesbuilder.RegisterSource(new AnyConcreteTypeNotAlreadyRegisteredSource());
    //register the MyDataService class as the IDataService interface in the DI containerbuilder.RegisterType<MyDataService>().As<IDataService>().SingleInstance();
    IContainercontainer = builder.Build();
    //get a MainViewModel instanceMainViewModelmainViewModel = container.Resolve<MainViewModel>();
}

In this example, we used the Autofac framework, but you can use any other DI framework, such as Unity or Ninject. The DI container creates MainViewModel and automatically injects MyDataService into the MainViewModel constructor. This allows you to avoid MyDataService initialization each time a class with the IDataService parameter type is created.

We then need to connect the MainViewModel to its view: MainView. The most obvious strategy is to set DataContext in the view constructor:

publicMainView(){
    InitializeComponent();
    this.DataContext = container.Resolve<MainViewModel>();
}

However, to access the DI container, you will have to either make it static or pass it to each view constructor. A more elegant solution is to create a markup extension that returns a view model instance based on its type:

publicclassDISource : MarkupExtension
{
    publicstatic Func<Type, object> Resolver { get; set; }
    public Type Type { get; set; }
    publicoverrideobjectProvideValue(IServiceProvider serviceProvider) => Resolver?.Invoke(Type);
}
<UserControlDataContext="{local:DISource Type=local:MainViewModel}">

Initially, the markup extension is not bound to any DI container. To allow the extension to use your container, specify the view model resolver in the following manner:

publicpartialclassApp : Application
{
    protectedoverridevoidOnStartup(StartupEventArgs e) {
        base.OnStartup(e);
        //...

        IContainer container = builder.Build();
        DISource.Resolver = (type) => {
            return container.Resolve(type);
        };
    }
}

This technique allows DISource to work with any possible container.

You can find a complete sample project here: How to register POCO type in dependency injection container.

Dependency Injection and DevExpress Services

In the examples above, we used an abstract data service that doesn’t communicate with visual controls. As you know, many DevExpress WPF services work with view controls. Therefore, a service must know which control to work with. For example, if you wish to inject NavigationFrameService into your view model, you also need to attach this service to a corresponding NavigationFrame control.

Create a public property that contains the service in your view model and bind the service to NavigationFrame:

publicclassMainViewModel {
    public INavigationService NavigationService { get; }

    publicMainViewModel(INavigationService navigationService) =>
        NavigationService = navigationService;
}
<dxwui:NavigationFrame><dxmvvm:Interaction.Behaviors><common:AttachServiceBehaviorService="{Binding NavigationService}"/></dxmvvm:Interaction.Behaviors></dxwui:NavigationFrame>

AttachServiceBehavior is a simple attached behavior that calls NavigationFrameService.Attach when the Service property is changed. Although AttachServiceBehavior is not included in our library, you can obtain its code here:
How to use our Services with Dependency Injection/AttachServiceBehavior. Even though MainViewModel uses NavigationFrameService, it doesn’t have to implement the ISupportServices interface. Moreover, all child views involved in navigation can use the service without attaching to NavigationFrame - because it’s already configured at the main view level.

Not all DevExpress services require a visual component. Certain services, such as DXMessageBoxService or DXOpenFileDialogService, don’t need to be explicitly attached, so you can inject them as any other non-DevExpress service.

In certain instances, it might not be wise to inject a service using a DI container if the service needs to be configured for a specific view. For example, this is the case if you have a service that binds to your view model’s commands. It’s much easier to define the service directly in the view and configure all bindings there. To access this service from the view model, use the techniques described here: Services -> Getting Started. A complete example for this topic is available here: How to use DevExpress Services with Dependency Injection.

Should you have any questions about this post, feel free to comment below or create a new support ticket via the DevExpress Support Center.

Office File API & Office-Inspired UI Controls – 2022 Roadmap

$
0
0

Based on your votes and feedback, we’ve finalized our 2022 Office File API and Office-inspired UI Controls Roadmap. We thank you for your continued support and for sharing your needs/requirements. If you’d like to discuss the items on this roadmap in greater detail, or if you’d like to share a business use case that we don’t support, feel free to submit your comments below. We’ll be happy to follow-up.

Word Processing Document API and Rich Text Editors for WinForms and WPF

Rotated Text Support (v22.1)

We expect to add rotated text support within text boxes and table cells. You will be able to specify text direction in code or via the Rich Text Editor’s UI (in addition to UI display and print output, you will be able to export rotated text to PDF).

Spreadsheet Document API and Spreadsheet UI Controls for WinForms and WPF

Page Break Preview (v22.1)

Our WinForms Spreadsheet and WPF Spreadsheet controls will support Page Break Preview– a separate view that displays horizontal and vertical page breaks for a worksheet. You will be able to insert/remove page breaks via the Spreadsheet control’s UI and drag existing page breaks to a new position with a mouse.

Shrink to Fit (v22.1)

We plan to introduce a Shrink to Fit alignment option across our Spreadsheet product line (Document API and UI controls for WinForms and WPF). When enabled, this option automatically reduces text size to fit a cell.

Cross-Platform Rendering Engine for Office File API (v22.2)

As you may already know, System.Drawing.Common was deprecated for non-Windows operating systems in .NET 6 and higher. See the following page for more information: System.Drawing.Common only supported on Windows.

This breaking change significantly affects those using our Office File API library on Linux and macOS (we use System.Drawing.Common to measure document text and render graphic objects including shapes, pictures, and charts). To address rendering-related issues on non-Windows operating systems, we must implement our own cross-platform rendering engine based on the SkiaSharp library. We will update our public API to use this new implementation for all System.Drawing classes not supported in .NET 6 and higher (Image, Bitmap, Font, Pen, Brush, etc.). Once our new rendering engine is available, you will need to replace System.Drawing object calls with custom DevExpress counterparts.

Office-Inspired UI Controls for Blazor

Rich Text Editor for Blazor

Mail Merge (v22.1)

We will introduce mail merge support to our Blazor Rich Text Editor in our v22.1 release cycle. Our mail merge implementation will allow you to bind the control to an external data source, preview dynamic content/execute final merge operations.

Ribbon Customization (v22.1)

We expect to incorporate Ribbon UI customization in our v22.1 release cycle. Through customization, you will be able to hide/modify default ribbon items and add custom items to the Rich Text Editor’s default UI ribbon.

Spreadsheet for Blazor (v22.2)

In the second half of 2022 we plan to release a Spreadsheet control for Blazor. As you might expect, this will be an Excel-inspired control and will allow you to incorporate spreadsheet functionality into a Blazor Server application. With our Blazor Spreadsheet’s UI and API, you will be able to create, edit and save spreadsheet documents as needs dictate.

Office-Inspired UI Controls for WinUI 3 on Desktop

PDF Viewer (v22.2)

In the second half of 2022, we expect to release a new WinUI PDF Viewer control. The DevExpress WinUI PDF Viewer will ship with the following built-in features:

  • Ribbon Toolbar
  • Page Thumbnails
  • Page Navigation
  • Text Selection
  • Text Search
  • Zoom Settings

Spreadsheet Control (v23.1)

We expect to release a WinUI Spreadsheet control in our v23.1 release cycle. With this new control, you will be able to create, load, edit, save, and print spreadsheet documents within your WinUI app. The DevExpress WinUI Spreadsheet control will also include the following features:

  • Ribbon Toolbar
  • Normal View Support with Row & Columns Headers
  • Sheet Tab Selector
  • Context Menus
  • Row & Column Operations (Add, Remove, Hide, Freeze, Resize, and AutoFit)
  • Cell Selection
  • Cell Editing
  • Cell Formatting
  • Merge & Unmerge Cells
  • Conditional Formatting
  • Formulas & Formula Calculation Engine
  • Defined Names
  • Pictures
  • Page Setup
  • Print Preview
  • Zoom Settings
  • Clipboard Operations

Rich Text Editor (v23.1)

We expect to release a new Rich Text Editor control for WinUI in the first half of 2023. With this new control, you will be able to create, open, edit, convert, save, and print rich-formatted text files within your WinUI app.  The DevExpress WinUI Rich Text Editor will include the following features:

  • Ribbon Toolbar
  • Print Layout / Simple / Draft Views
  • Horizontal and Vertical Rulers
  • Context Menus
  • Character & Paragraph Formatting
  • Bullets & Numbering
  • Bookmarks & Hyperlinks
  • Table of Contents
  • Tables
  • Fields & Mail Merge
  • Shapes & Pictures (Rendering & API)
  • Watermarks (Rendering & API)
  • Headers & Footers (Rendering & API)
  • Footnotes & Endnotes (Rendering & API)
  • Page & Section Breaks (Rendering & API)
  • Search and Replace
  • Zoom Settings
  • Clipboard Operations

Your Feedback Matters

As always, we welcome your feedback. Let us know what you think in the field below or submit a support ticket via the DevExpress Support Center.

The information contained within this blog post details our current/projected development plans. Please note that this information is being shared for INFORMATIONAL PURPOSES ONLY and does not represent a binding commitment on the part of Developer Express Inc. This roadmap and the features/products listed within it are subject to change. You should not rely on or use this information to help make a purchase decision about Developer Express Inc products.

Viewing all 2399 articles
Browse latest View live