Skip to content

Commit 6610993

Browse files
github-actions[bot]dimodixristianstefanov
authored
Merge dock-unpinnedchanged-3184 into production (#3185)
* docs(DockManager): Add missing UnpinnedChanged event * Update components/dockmanager/events.md Co-authored-by: Hristian Stefanov <[email protected]> --------- Co-authored-by: Dimo Dimov <[email protected]> Co-authored-by: Hristian Stefanov <[email protected]>
1 parent f854638 commit 6610993

File tree

2 files changed

+48
-31
lines changed

2 files changed

+48
-31
lines changed

components/dockmanager/events.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This article explains the events available in the Telerik DockManager for Blazor
1616
* [OnUndock](#ondock)
1717
* [VisibleChanged](#visiblechanged)
1818
* [SizeChanged](#sizechanged)
19+
* [UnpinnedChanged](#unpinnedchanged)
1920
* [UnpinnedSizeChanged](#unpinnedsizechanged)
2021
* [OnPaneResize](#onpaneresize)
2122
* [State Events](#state-events)
@@ -24,7 +25,7 @@ This article explains the events available in the Telerik DockManager for Blazor
2425

2526
## OnDock
2627

27-
The `OnDock` event is fired when any pane is docked.
28+
The `OnDock` event fires when any pane is docked.
2829

2930
The event handler receives as an argument an `DockManagerDockEventArgs` object that contains:
3031

@@ -37,7 +38,7 @@ The event handler receives as an argument an `DockManagerDockEventArgs` object t
3738

3839
## OnUndock
3940

40-
The `OnUndock` event is fired when any pane is undocked.
41+
The `OnUndock` event fires when any pane is undocked.
4142

4243
The event handler receives as an argument an `DockManagerUndockEventArgs` object that contains:
4344

@@ -48,19 +49,23 @@ The event handler receives as an argument an `DockManagerUndockEventArgs` object
4849

4950
## VisibleChanged
5051

51-
The `VisibleChanged` event is fired when the user tries to hide a given pane. You can effectively cancel the event by not propagating the new visibility state to the variable the `Visible` property is bound to. This is the way to cancel the event and keep the pane visible.
52+
The `VisibleChanged` event fires when the user tries to hide a given pane. You can effectively cancel the event by not propagating the new visibility state to the variable the `Visible` property is bound to. This is the way to cancel the event and keep the pane visible.
5253

5354
## SizeChanged
5455

55-
The `SizeChanged` event is triggered when the `Size` parameter of the corresponding pane is changed.
56+
The `SizeChanged` event fireswhen the `Size` parameter of the corresponding pane changes.
57+
58+
## UnpinnedChanged
59+
60+
The `UnpinnedChanged` event fireswhen the `Unpinned` parameter of the corresponding pane changes.
5661

5762
## UnpinnedSizeChanged
5863

59-
The `UnpinnedSizeChanged` event is triggered when the `UnpinnedSize` parameter of the corresponding pane is changed.
64+
The `UnpinnedSizeChanged` event fires when the `UnpinnedSize` parameter of the corresponding pane changes.
6065

6166
## OnPaneResize
6267

63-
The `OnPaneResize` event is fired when a pane is resized, except unpinned panes. It lets you respond to that change if needed - for example, call the `.Refresh()` method of a chart or otherwise repaint a child component in the content. You can also use it to, for example, update the saved [state](slug:dockmanager-state) for your users.
68+
The `OnPaneResize` event fires when a pane is resized, except unpinned panes. It lets you respond to that change if needed - for example, call the `.Refresh()` method of a chart or otherwise repaint a child component in the content. You can also use it to, for example, update the saved [state](slug:dockmanager-state) for your users.
6469

6570
The event handler receives as an argument an `DockManagerPaneResizeEventArgs` object that contains:
6671

@@ -81,7 +86,7 @@ Review the [DockManager state](slug:dockmanager-state) article for more details
8186

8287
## OnPin
8388

84-
The `OnPin` event is fired when any pane is pinned.
89+
The `OnPin` event fires when any pane is pinned.
8590

8691
The event handler receives as an argument an `DockManagerPinEventArgs` object that contains:
8792

@@ -92,7 +97,7 @@ The event handler receives as an argument an `DockManagerPinEventArgs` object th
9297

9398
## OnUnpin
9499

95-
The `OnUnpin` event is fired when any pane is unpinned.
100+
The `OnUnpin` event fires when any pane is unpinned.
96101

97102
The event handler receives as an argument an `DockManagerUnpinEventArgs` object that contains:
98103

@@ -124,13 +129,17 @@ The event handler receives as an argument an `DockManagerUnpinEventArgs` object
124129
<DockManagerContentPane HeaderText="Pane 1"
125130
Id="Pane1"
126131
Size="50%"
132+
Unpinned="@Pane1Unpinned"
133+
UnpinnedChanged="@Pane1UnpinnedChanged"
127134
UnpinnedSize="@Pane1UnpinnedSize"
128135
UnpinnedSizeChanged="@Pane1UnpinnedSizeChanged"
129136
Closeable="false">
130137
<Content>
131138
Pane 1. Undocking is allowed. Docking over it is cancelled.
132-
<code>UnpinnedSizeChanged</code> is handled.
133-
Current <code>UnpinnedSize</code>: <strong>@Pane1UnpinnedSize</strong>
139+
<code>UnpinnedChanged</code> and <code>UnpinnedSizeChanged</code> are handled.
140+
Current
141+
<code>UnpinnedSize</code>:
142+
<strong>@Pane1UnpinnedSize</strong>
134143
</Content>
135144
</DockManagerContentPane>
136145
@@ -206,6 +215,7 @@ The event handler receives as an argument an `DockManagerUnpinEventArgs` object
206215
@code {
207216
private TelerikDockManager? DockManagerRef { get; set; }
208217
218+
private bool Pane1Unpinned { get; set; }
209219
private string Pane1UnpinnedSize { get; set; } = "360px";
210220
private bool Pane4Visible { get; set; } = true;
211221
private bool FloatingPaneVisible { get; set; } = true;
@@ -247,7 +257,7 @@ The event handler receives as an argument an `DockManagerUnpinEventArgs` object
247257
}
248258
else
249259
{
250-
DockManagetEventLog.Insert(0, $"Pane <strong>{args.PaneId}</strong> was pinned.");
260+
DockManagetEventLog.Insert(0, $"[DockManager OnPanePin] Pane <strong>{args.PaneId}</strong> was pinned.");
251261
}
252262
}
253263
@@ -256,6 +266,13 @@ The event handler receives as an argument an `DockManagerUnpinEventArgs` object
256266
DockManagetEventLog.Insert(0, $"Pane <strong>{args.PaneId}</strong> was resized to {args.Size}.");
257267
}
258268
269+
private void Pane1UnpinnedChanged(bool newUnpinned)
270+
{
271+
Pane1Unpinned = newUnpinned;
272+
273+
DockManagetEventLog.Insert(0, $"[Pane UnpinnedChanged] Pane <strong>Pane 1</strong> was {(newUnpinned ? "unpinned" : "pinned")}.");
274+
}
275+
259276
private void Pane1UnpinnedSizeChanged(string newUnpinnedSize)
260277
{
261278
Pane1UnpinnedSize = newUnpinnedSize;
@@ -272,7 +289,7 @@ The event handler receives as an argument an `DockManagerUnpinEventArgs` object
272289
}
273290
else
274291
{
275-
DockManagetEventLog.Insert(0, $"Pane <strong>{args.PaneId}</strong> was unpinned.");
292+
DockManagetEventLog.Insert(0, $"[DockManager OnUnpin] Pane <strong>{args.PaneId}</strong> was unpinned.");
276293
}
277294
}
278295

components/dockmanager/overview.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,49 +119,49 @@ The following table lists the Dock Manager parameters. Also check the [DockManag
119119

120120
| Parameter | Type and Default&nbsp;Value | Description |
121121
| --- | --- | --- |
122-
| `AllowFloat` | `bool` <br /> (`false`) | Determines whether the pane can be dragged from the dock manager layout to create a new floating pane. |
122+
| `AllowFloat` | `bool` | Determines whether the pane can be dragged from the dock manager layout to create a new floating pane. |
123123
| `Class` | `string` | The custom CSS class of the `<div class="k-pane-scrollable">` element. Use it to [override theme styles](slug:themes-override). |
124-
| `Closeable` | `bool` <br /> (`false`) | Determines whether the pane can be closed. |
125-
| `Dockable` | `bool` <br /> (`false`) | Specifies whether the pane allows other panes to be docked to or over it. This determines if the end user can drop other panes over it or next to it, creating a DockManagerSplitPane (Splitter) or a DockManagerTabGroupPane (TabStrip). |
124+
| `Closeable` | `bool` | Determines whether the pane can be closed. |
125+
| `Dockable` | `bool` | Specifies whether the pane allows other panes to be docked to or over it. This determines if the end user can drop other panes over it or next to it, creating a DockManagerSplitPane (Splitter) or a DockManagerTabGroupPane (TabStrip). |
126126
| `HeaderText` | `string` | The pane title, displayed in the pane header and as the button text in the DockManager toolbar when the pane is unpinned. |
127127
| `Id` | `string` <br /> (`Guid`) | The id of the pane. |
128-
| `Maximizable` | `bool` <br /> (`false`) | Determines whether the pane can be maximized. |
129-
| `Size` | `string` | Determines the size of the splitter pane. |
130-
| `Unpinnable` | `bool` <br /> (`false`) | Determines whether the pane can be unpinned. |
131-
| `Unpinned` | `bool` <br /> (`true`) | Determines whether the pane is unpinned. |
132-
| `UnpinnedSize` | `string` | Determines the size of the splitter pane when it is unpinned. |
133-
| `Visible` | `bool` <br /> (`true`) | Determines whether the tab/pane is rendered. |
128+
| `Maximizable` | `bool` | Determines whether the pane can be maximized. |
129+
| `Size` | `string` | Determines the size of the splitter pane. Supports two-way binding. |
130+
| `Unpinnable` | `bool` | Determines whether the pane can be unpinned. |
131+
| `Unpinned` | `bool` | Determines whether the pane is unpinned. Supports two-way binding. |
132+
| `UnpinnedSize` | `string` | Determines the size of the splitter pane when it is unpinned. Supports two-way binding. |
133+
| `Visible` | `bool` <br /> (`true`) | Determines whether the tab/pane is rendered. Supports two-way binding. |
134134

135135
### DockManagerSplitPane Parameters
136136

137137
| Parameter | Type and Default&nbsp;Value | Description |
138138
| --- | --- | --- |
139-
| `AllowEmpty` | `bool` <br /> (`false`) | Determines whether a splitter pane is shown as empty when a child pane is removed (dragged out, closed, etc.). If set to false, the splitter is re-rendered without the removed child pane. |
139+
| `AllowEmpty` | `bool` | Determines whether a splitter pane is shown as empty when a child pane is removed (dragged out, closed, etc.). If set to false, the splitter is re-rendered without the removed child pane. |
140140
| `Class` | `string` | The custom CSS class of the `<div class="k-dock-manager-splitter">` element. Use it to [override theme styles](slug:themes-override). |
141141
| `Id` | `string` <br /> (`Guid`) | The id of the pane. |
142142
| `Orientation` | `DockManagerPaneOrientation` enum <br /> (`Vertical`) | Determines the orientation of the rendered splitter. |
143-
| `Size` | `string` | Determines the size of the splitter pane. |
144-
| `Visible` | `bool` <br /> (`true`) | Determines whether the tab/pane is rendered. |
143+
| `Size` | `string` | Determines the size of the splitter pane. Supports two-way binding. |
144+
| `Visible` | `bool` <br /> (`true`) | Determines whether the tab/pane is rendered. Supports two-way binding. |
145145

146146
#### DockManagerSplitPane Parameters (only when defined as a floating pane)
147147

148148
| Parameter | Type and Default&nbsp;Value | Description |
149149
| --- | --- | --- |
150-
| `FloatingHeight` | `string` | The height of the rendered window. |
151-
| `FloatingLeft` | `string` | The CSS `left` value of the rendered window, relative to the dock manager element (`k-dockmanager`) |
150+
| `FloatingHeight` | `string` | The height of the rendered window. Supports two-way binding. |
151+
| `FloatingLeft` | `string` | The CSS `left` value of the rendered window, relative to the dock manager element (`k-dockmanager`). Supports two-way binding. |
152152
| `FloatingResizable` | `bool` <br /> (`true`) | Determines whether the rendered window is resizable. |
153-
| `FloatingTop` | `string` | The CSS `top` value of the rendered window, relative to the dock manager element (`k-dockmanager`) |
154-
| `FloatingWidth` | `string` | The width of the rendered window. |
153+
| `FloatingTop` | `string` | The CSS `top` value of the rendered window, relative to the dock manager element (`k-dockmanager`). Supports two-way binding. |
154+
| `FloatingWidth` | `string` | The width of the rendered window. Supports two-way binding. |
155155

156156
### DockManagerTabGroupPane Parameters
157157

158158
| Parameter | Type and Default&nbsp;Value | Description |
159159
| --- | --- | --- |
160-
| `AllowEmpty` | `bool` <br /> (`false`) | Determines whether an empty space is left when all tabs are removed (unpinned, closed, etc.), allowing you to drop content panes and create a new tab. |
160+
| `AllowEmpty` | `bool` | Determines whether an empty space is left when all tabs are removed (unpinned, closed, etc.), allowing you to drop content panes and create a new tab. |
161161
| `Id` | `string` <br /> (`Guid`) | The id of the pane. |
162162
| `SelectedPaneId` | `int` | The `id` of the initially selected tab pane. |
163-
| `Size` | `string` | Determines the size of the splitter pane. |
164-
| `Visible` | `bool` <br /> (`true`) | Determines whether the tab/pane is rendered. |
163+
| `Size` | `string` | Determines the size of the splitter pane. Supports two-way binding. |
164+
| `Visible` | `bool` <br /> (`true`) | Determines whether the tab/pane is rendered. Supports two-way binding. |
165165

166166
## DockManager Reference
167167

0 commit comments

Comments
 (0)