View. Try Resize View(Size) Method
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 value);
public bool TryResizeView(Size value);
Public Function TryResizeView (value As Size) As Boolean
The new size of the view in effective pixels.
true if the view is resized to the requested size; otherwise, false.
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).