Breaking Change T832854
Visible to All Users

The IWindowService and ICurrentWindowService interfaces have been changed

In v19.2 and earlier versions, the IWindowService and ICurrentWindowService interfaces contained the SetWindowState method, which has a parameter of the WindowState type. This type is located in the PresentationFramework assembly:

C#
public interface IWindowService { ... void SetWindowState(WindowState state); } public interface ICurrentWindowService { ... void SetWindowState(WindowState state); }
Visual Basic
Public Interface IWindowService ... Sub SetState(ByVal state As WindowState) End Interface Public Interface ICurrentWindowService ... Sub SetState(ByVal state As WindowState) End Interface

This issue prevented us from implementing IWindowService/ICurrentWindowService for the Windows Forms platform. In v20.1, we have changed these interfaces to fix the issue. A new WindowState property is now used to specify the state of a window:

C#
public enum DXWindowState { Normal = 0, Minimized = 1, Maximized = 2 } public interface IWindowService { ... DXWindowState WindowState { get; set; } } public interface ICurrentWindowService { ... DXWindowState WindowState { get; set; } } [EditorBrowsable(EditorBrowsableState.Never)] public static class WindowServicePlatformExtensions { [EditorBrowsable(EditorBrowsableState.Never)] public static void SetWindowState(this IWindowService service, WindowState state) { ... } } [EditorBrowsable(EditorBrowsableState.Never)] public static class CurrentWindowServicePlatformExtensions { [EditorBrowsable(EditorBrowsableState.Never)] public static void SetWindowState(this ICurrentWindowService service, WindowState state) { ... } }
Visual Basic
Public Enum DXWindowState Normal = 0 Minimized = 1 Maximized = 2 End Enum Public Interface IWindowService ... Property WindowState As DXWindowState End Interface Public Interface ICurrentWindowService ... Property WindowState As DXWindowState End Interface <EditorBrowsable(EditorBrowsableState.Never)> Public Module WindowServicePlatformExtensions <Extension()> <EditorBrowsable(EditorBrowsableState.Never)> Public Sub SetWindowState(ByVal service As IWindowService, ByVal state As WindowState) ... End Sub End Module <EditorBrowsable(EditorBrowsableState.Never)> Public Module CurrentWindowServicePlatformExtensions <Extension()> <EditorBrowsable(EditorBrowsableState.Never)> Public Sub SetWindowState(ByVal service As ICurrentWindowService, ByVal state As WindowState) ... End Sub End Module

The old SetWindowState method is available as an extension method. This method is hidden from Visual Studio IntelliSense with the EditorBrowsable(EditorBrowsableState.Never) attribute. If you encounter the "Method not found" error, make sure you referenced the DevExpress.Mvvm namespace:

C#
using DevExpress.Mvvm;
Visual Basic
Imports DevExpress.Mvvm

If you need to convert a WindowState object to the DXWindowState type and vice-versa, use the static DevExpress.Mvvm.DXWindowStateConverter class. Note that this class is also hidden from Visual Studio IntelliSense.

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.