File tree Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -34,27 +34,31 @@ public MainPage()
34
34
35
35
public void SwitchToStyle ( PageStyle newStyle )
36
36
{
37
- if ( newStyle == PageStyle . Narrow )
37
+ var frame = Window . Current . Content as Frame ;
38
+ if ( frame . CurrentSourcePageType == typeof ( MainPage ) )
38
39
{
39
- if ( Vm . SelectedThread != null )
40
+ if ( newStyle == PageStyle . Narrow )
40
41
{
41
- Utils . EnableBackButton ( Vm . BackButton_Click ) ;
42
- Vm . IsPaneOpen = false ;
43
- Vm . CompactPaneLength = 0 ;
42
+ if ( Vm . SelectedThread != null )
43
+ {
44
+ Utils . EnableBackButton ( Vm . BackButton_Click ) ;
45
+ Vm . IsPaneOpen = false ;
46
+ Vm . CompactPaneLength = 0 ;
47
+ }
48
+ else
49
+ {
50
+ Unselect ( ) ;
51
+ Vm . IsPaneOpen = true ;
52
+ }
44
53
}
45
- else
54
+ else if ( newStyle == PageStyle . Wide )
46
55
{
47
- Unselect ( ) ;
48
- Vm . IsPaneOpen = true ;
56
+ Utils . DisableBackButton ( Vm . BackButton_Click ) ;
57
+ Vm . IsPaneOpen = false ;
58
+ Vm . CompactPaneLength = ContactsGrid . Width = 320 ;
49
59
}
60
+ UpdateStyle ( newStyle ) ;
50
61
}
51
- else if ( newStyle == PageStyle . Wide )
52
- {
53
- Utils . DisableBackButton ( Vm . BackButton_Click ) ;
54
- Vm . IsPaneOpen = false ;
55
- Vm . CompactPaneLength = ContactsGrid . Width = 320 ;
56
- }
57
- UpdateStyle ( newStyle ) ;
58
62
}
59
63
60
64
private void UpdateStyle ( PageStyle currentStyle )
You can’t perform that action at this time.
0 commit comments