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
Try closing the window with the [x] button on its toolbar, then toggle the checkbox and try again.
82
+
<br />
83
+
<label>
84
+
The user can close the window with the [x] button:
85
+
<TelerikCheckBox @bind-Value="@isClosable" />
86
+
</label>
87
+
</WindowContent>
88
+
<WindowActions>
89
+
<WindowAction Name="Close" />
90
+
</WindowActions>
91
+
</TelerikWindow>
92
+
93
+
@code {
94
+
bool isVisible { get; set; } = true;
95
+
bool isClosable { get; set; }
96
+
97
+
void VisibleChangedHandler(bool currVisible)
98
+
{
99
+
if (isClosable)
100
+
{
101
+
isVisible = currVisible; // if you don't do this, the window won't close because of the user action
102
+
}
103
+
else
104
+
{
105
+
Console.WriteLine("The user tried to close the window but the code didn't let them");
106
+
}
107
+
108
+
}
109
+
}
110
+
````
111
+
66
112
## StateChanged
67
113
68
114
You can use the `StateChanged` event 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.
0 commit comments