Back to Devexpress

WindowsFormsSettings.OptimizeRemoteConnectionPerformance Property

windowsforms-devexpress-dot-xtraeditors-dot-windowsformssettings-ebe7456a.md

latest6.1 KB
Original Source

WindowsFormsSettings.OptimizeRemoteConnectionPerformance Property

Gets or sets whether the application should disable various visual effects to enhance the performance when accessed over slow remote connections.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
public static DefaultBoolean OptimizeRemoteConnectionPerformance { get; set; }
vb
Public Shared Property OptimizeRemoteConnectionPerformance As DefaultBoolean

Property Value

TypeDescription
DefaultBoolean

Specifies whether the remote connection optimization is on. The Default value is equal to false.

|

Available values:

NameDescriptionReturn Value
True

The value is true.

|

0

| | False |

The value is false.

|

1

| | Default |

The value is specified by a global option or a higher-level object.

|

2

|

Remarks

When enabled, this property minimizes the amount of visual effects and animations. This allows applications to reduce traffic consumption and improve overall performance in remote environments.

The OptimizeRemoteConnectionPerformance property has the following effects:

Animations

  • Transition animations managed by the TransitionManager.
  • FadeIn and FadeOut effects of splash screens.
  • Bar item link hover animations. Enable the AllowLinkLighting to turn on this animation effect.
  • Various expand/collapse, sort, drag-and-drop, and other animations that follow end-user actions. Enable the static AnimationMode property to turn these animations back on.

Shadows

  • Shadows cast by XtraForm, XtraDialog and XtraMessageBox. Call the static EnableWindowShadows() method to restore them.
  • Bar sub-menu shadows. Enable the SubmenuHasShadow property to display these shadows.

Other effects

  • XtraForms display thick borders for a better drag-and-resize experience. You can disable the FormThickBorder property to keep thin form borders, or modify the ThickBorderWidth property to change their thickness.
  • Scroll paint operations are delayed for 75ms.
  • Acrylic Material and Reveal Highlight effects for Fluent Design Forms are disabled. Set the SurfaceMaterial property to Acrylic to enable these effects.

Tip

To maximize performance, we recommend that you apply a flat vector skin (for instance, “Bezier” or “Basic”). Skins with gradient bitmaps (such as “Valentine” or “Caramel”) generate more traffic and can negatively impact the user experience.

How to use the property and override its settings

Enable the OptimizeRemoteConnectionPerformance property when the SystemInformation.TerminalServerSession property returns true :

csharp
WindowsFormsSettings.OptimizeRemoteConnectionPerformance = 
    SystemInformation.TerminalServerSession ? DefaultBoolean.True : DefaultBoolean.False;
vb
WindowsFormsSettings.OptimizeRemoteConnectionPerformance =
    If(SystemInformation.TerminalServerSession, DefaultBoolean.True, DefaultBoolean.False)

When the OptimizeRemoteConnectionPerformance property changes its value, the LookAndFeel.Default.StyleChanged event fires. You can handle this event to re-enable animations that you wish to keep:

csharp
DevExpress.LookAndFeel.UserLookAndFeel.Default.StyleChanged += Default_StyleChanged;

void Default_StyleChanged(object sender, EventArgs e) {
    var reason = (e as LookAndFeelChangedEventArgs).Reason;
    if (reason == LookAndFeelChangeReason.OptimizeRemoteConnectionPerformanceChanged) {
        //fine-tune animations and effects
        //for example
        //WindowsFormsSettings.EnableWindowShadows();
        //barManager1.Controller.PropertiesBar.AllowLinkLighting = true;
    }
}
vb
Private DevExpress.LookAndFeel.UserLookAndFeel.Default.StyleChanged += AddressOf Default_StyleChanged

Sub Default_StyleChanged(ByVal sender As Object, ByVal e As EventArgs)
    Dim reason = (TryCast(e, LookAndFeelChangedEventArgs)).Reason
    If reason Is LookAndFeelChangeReason.OptimizeRemoteConnectionPerformanceChanged Then
        'fine-tune animations and effects
        'for example
        'WindowsFormsSettings.EnableWindowShadows();
        'barManager1.Controller.PropertiesBar.AllowLinkLighting = true;
    End If
End Sub

See Also

WindowsFormsSettings Class

WindowsFormsSettings Members

DevExpress.XtraEditors Namespace