ApplicationView.TryResizeView(Size) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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 (Windows 10 only).
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).