File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Samples/Islands/WpfCalculator/CalculatorDemo Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ void SetCompactView(bool useCompactView)
42
42
43
43
CompactViewText . Text = DisplayBox . Text ;
44
44
45
+ if ( ! _registeredEventHandler )
46
+ {
47
+ DisplayBox . TextChanged += DisplayBox_TextChanged ;
48
+ _registeredEventHandler = true ;
49
+ }
50
+
45
51
// The AppWindow's CompactOverlay mode will make it always-on-top.
46
52
_appWindow . SetPresenter ( AppWindowPresenterKind . CompactOverlay ) ;
47
53
_appWindow . ResizeClient ( new Windows . Graphics . SizeInt32 ( 400 , 400 ) ) ;
@@ -54,5 +60,12 @@ void SetCompactView(bool useCompactView)
54
60
_appWindow . SetPresenter ( AppWindowPresenterKind . Default ) ;
55
61
}
56
62
}
57
- }
63
+
64
+ private void DisplayBox_TextChanged ( object sender , System . Windows . Controls . TextChangedEventArgs e )
65
+ {
66
+ CompactViewText . Text = DisplayBox . Text ;
67
+ }
68
+
69
+ bool _registeredEventHandler = false ;
70
+ }
58
71
}
You can’t perform that action at this time.
0 commit comments