You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `Visible` parameter also exposes an event - `VisibleChanged`. You can use it to get notifications when the user tries to close the window. You can effectively cancel the event by not propagating the new visibility state to the variable the `Visible` property is bound to.
106
+
107
+
>caption React to the user closing the window
101
108
102
109
````CSHTML
103
110
@result
104
111
105
-
<button @onclick="ToggleWindow">Toggle the Window</button>
112
+
<button @onclick="ToggleWindow">Toggle the Window</button>
isVisible = currVisible; // if you don't do this, the window won't close because of the user action
133
+
125
134
result = $"the window is now visible: {isVisible}";
126
135
}
127
-
136
+
128
137
public void ToggleWindow()
129
138
{
130
139
isVisible = !isVisible;
140
+
141
+
result = $"the window is now visible: {isVisible}";
131
142
}
132
143
}
133
144
````
134
145
146
+
>tip You may also find useful handling the `StateChanged` event - it provides similar functionality for the minimized/maximized/standard state of the window.
147
+
135
148
## Styling
136
149
137
150
The `Class` property lets you define a CSS class that will be rendered on the popup element so you can cascade through it in order to change the appearane of both the content, and the built-in elements of the Window.
<button @onclick="MaximizeWindow">Change Maximize state of the Window</button>
76
-
<button @onclick="MinimizeWindow">Change Minimize state of the Window</button>
77
-
</WindowContent>
101
+
The `State` parameter also exposes an event - `StateChanged`. You can use it to get notifications when the user tries to minimize, maximize or restore the window. You can effectively cancel the event by not propagating the new state to the variable the `State` property is bound to.
102
+
103
+
>caption React to the user actions to minimize, restore or maximize the window
Copy file name to clipboardExpand all lines: upgrade/breaking-changes/2-0-0.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,9 +100,10 @@ This is a list of the components that had methods removed and the new approach o
100
100
101
101
### Window
102
102
103
-
* The `Open()`, `Close()`, `Minimize()`, `Maximize()`, `Restore()` methods are removed in favor of parameter binding.
103
+
* The `Open()`, `Close()`, `Minimize()`, `Maximize()`, `Restore()` methods are removed in favor of parameter binding - for the `Visible` parameter and the new `State` parameter.
104
+
* The `Minimized` and `Maximized` parameters are removed in favor of the `State` parameter.
104
105
* The `AddAction()`, `RemoveAction()` methods are removed in favor of conditional markup.
105
-
* The window renders at the root of the app and not in place. Thus, its position is relative to the root and maximizing fills it up, instead of the closest parent with special positioning.
106
+
* The window renders at the root of the app and not in place. Thus, its position is relative to the root and maximizing fills it up, instead of the closest parent with special positioning. This also applies to the `Top` and `Left` offsets - they are now relative to the app root as well.
0 commit comments