-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(Window): add kb for programmatic center of the window #2821
base: master
Are you sure you want to change the base?
Conversation
Hello @Tsvetomir-Hr, Check the below option if you would like to automatically generate PR to production. The automation uses the branch for the cherry-pick, and then will delete the branch. Please, do not delete it manually.
|
>caption Telerik Blazor Window Centered Programmatically | ||
|
||
````RAZOR | ||
@if (!IsWindowVisible) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example can be simplified:
- Remove the toggle button
- Make the Window always visible
- Move the Center button inside the Window
|
||
To center a Telerik Window programmatically, follow these steps: | ||
|
||
1. Use [`Top` and `Left` parameters](slug:components/window/position#top-and-left) – These parameters define the Window position on the screen. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step is not actionable, especially if the customer wants the Window to be initially centered. For example, explain:
- That the parameters must use two-way binding.
- What should be their default values.
This may also help you to make the next step simpler, because the reader will already be familiar with the string.Empty
value.
|
||
1. Use [`Top` and `Left` parameters](slug:components/window/position#top-and-left) – These parameters define the Window position on the screen. | ||
2. Reset `Top` and `Left` parameters to center the Window – Setting them to `string.Empty` allows automatic centering. | ||
3. Refresh the Window using component reference – Calling `WindowRef?.Refresh();` re-renders the Window with the new position. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Reset `Top` and `Left` parameters to center the Window – Setting them to `string.Empty` allows automatic centering. | ||
3. Refresh the Window using component reference – Calling `WindowRef?.Refresh();` re-renders the Window with the new position. | ||
|
||
>caption Telerik Blazor Window Centered Programmatically |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the caption an action "verb", rather than a "noun". For example:
>caption Telerik Blazor Window Centered Programmatically | |
>caption Center the Telerik Blazor Window Programmatically |
Related to: https://github.com/telerik/blazor/issues/8956
Once we deprecate the Centered parameter of the Window, will link this KB to Window Position documentation.