Dela via


ApplicationView.TryResizeView(Size) Method

Definition

Attempts to change the size of the view to the specified size in effective pixels.

public:
 virtual bool TryResizeView(Size value) = TryResizeView;
bool TryResizeView(Size const& value);
public bool TryResizeView(Size value);
function tryResizeView(value)
Public Function TryResizeView (value As Size) As Boolean

Parameters

value
Size

The new size of the view in effective pixels.

Returns

Boolean

bool

true if the view is resized to the requested size; otherwise, false.

Remarks

A resize request affects only the view it was requested on. Resizing one view does not affect the size of any other views.

Even when this method returns false, the user can manually resize the view and cause a SizeChanged event to occur.

If the resize forces parts of the app to go outside of available work area, the system will move it back into the available work area.

The resize request has no effect and the method returns false in these cases:

We recommend that you not begin any layout work until the window's SizeChanged event occurs. This avoids two different layout passes (one that happens immediately after TryResizeView and then another when the SizeChanged event occurs).

Applies to

See also