ApplicationView.TryResizeView(Size) ApplicationView.TryResizeView(Size) ApplicationView.TryResizeView(Size) ApplicationView.TryResizeView(Size) ApplicationView.TryResizeView(Size) Method

Definition

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

public : Platform::Boolean TryResizeView(Size value)
bool TryResizeView(Size value) const;
public bool TryResizeView(Size value)
Public Function TryResizeView(value As Size) As bool
var bool = applicationView.tryResizeView(value);

Parameters

value
Size Size Size

The new size of the view in effective pixels.

Returns

bool bool 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:

  • The requested size is larger than the available work area.
  • The requested size is less than the view's minimum size. (See SetPreferredMinSize.)
  • This method is called while the app is running in Tablet Mode.

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).

See also