@@ -7,8 +7,7 @@ namespace MaterialDesignThemes.Wpf
7
7
/// </summary>
8
8
public class DialogSession
9
9
{
10
- private readonly DialogHost _owner ;
11
- internal bool IsDisabled ;
10
+ private readonly DialogHost _owner ;
12
11
13
12
internal DialogSession ( DialogHost owner )
14
13
{
@@ -17,6 +16,14 @@ internal DialogSession(DialogHost owner)
17
16
_owner = owner ;
18
17
}
19
18
19
+ /// <summary>
20
+ /// Indicates if the dialog session has ended. Once ended no further method calls will be permitted.
21
+ /// </summary>
22
+ /// <remarks>
23
+ /// Client code cannot set this directly, this is internally managed. To end the dicalog session use <see cref="Close()"/>.
24
+ /// </remarks>
25
+ public bool IsEnded { get ; internal set ; }
26
+
20
27
/// <summary>
21
28
/// Gets the <see cref="DialogHost.DialogContent"/> which is currently displayed, so this could be a view model or a UI element.
22
29
/// </summary>
@@ -40,7 +47,7 @@ public void UpdateContent(object content)
40
47
/// <exception cref="InvalidOperationException">Thrown if the dialog session has ended, or a close operation is currently in progress.</exception>
41
48
public void Close ( )
42
49
{
43
- if ( IsDisabled ) throw new InvalidOperationException ( "Dialog session has ended." ) ;
50
+ if ( IsEnded ) throw new InvalidOperationException ( "Dialog session has ended." ) ;
44
51
45
52
_owner . Close ( null ) ;
46
53
}
@@ -52,7 +59,7 @@ public void Close()
52
59
/// <exception cref="InvalidOperationException">Thrown if the dialog session has ended, or a close operation is currently in progress.</exception>
53
60
public void Close ( object parameter )
54
61
{
55
- if ( IsDisabled ) throw new InvalidOperationException ( "Dialog session has ended." ) ;
62
+ if ( IsEnded ) throw new InvalidOperationException ( "Dialog session has ended." ) ;
56
63
57
64
_owner . Close ( parameter ) ;
58
65
}
0 commit comments