1
1
using System ;
2
- using System . Collections . Generic ;
3
- using System . Linq ;
4
- using System . Text ;
2
+ using Uno . UI ;
5
3
using Windows . Foundation ;
6
4
using Windows . UI . Xaml . Input ;
7
- using Uno . Extensions ;
8
- using Uno . UI . DataBinding ;
9
5
using Windows . UI . Xaml . Media ;
10
- using Uno . UI ;
11
6
#if XAMARIN_IOS
12
7
using CoreGraphics ;
13
8
using UIKit ;
@@ -31,6 +26,17 @@ public partial class PopupBase : FrameworkElement, IPopup
31
26
/// </summary>
32
27
internal IDynamicPopupLayouter CustomLayouter { get ; set ; }
33
28
29
+ internal override void OnPropertyChanged2 ( DependencyPropertyChangedEventArgs args )
30
+ {
31
+ if ( args . Property == AllowFocusOnInteractionProperty ||
32
+ args . Property == AllowFocusWhenDisabledProperty )
33
+ {
34
+ PropagateFocusProperties ( ) ;
35
+ }
36
+
37
+ base . OnPropertyChanged2 ( args ) ;
38
+ }
39
+
34
40
private protected override void OnUnloaded ( )
35
41
{
36
42
IsOpen = false ;
@@ -71,10 +77,13 @@ partial void OnChildChangedPartial(UIElement oldChild, UIElement newChild)
71
77
{
72
78
provider . Store . ClearValue ( provider . Store . DataContextProperty , DependencyPropertyValuePrecedences . Local ) ;
73
79
provider . Store . ClearValue ( provider . Store . TemplatedParentProperty , DependencyPropertyValuePrecedences . Local ) ;
80
+ provider . Store . ClearValue ( AllowFocusOnInteractionProperty , DependencyPropertyValuePrecedences . Local ) ;
81
+ provider . Store . ClearValue ( AllowFocusWhenDisabledProperty , DependencyPropertyValuePrecedences . Local ) ;
74
82
}
75
83
76
84
UpdateDataContext ( null ) ;
77
85
UpdateTemplatedParent ( ) ;
86
+ PropagateFocusProperties ( ) ;
78
87
79
88
if ( oldChild is FrameworkElement ocfe )
80
89
{
@@ -142,6 +151,15 @@ private void UpdateTemplatedParent()
142
151
}
143
152
}
144
153
154
+ private void PropagateFocusProperties ( )
155
+ {
156
+ if ( Child is IDependencyObjectStoreProvider provider )
157
+ {
158
+ provider . Store . SetValue ( AllowFocusOnInteractionProperty , AllowFocusOnInteraction , DependencyPropertyValuePrecedences . Local ) ;
159
+ provider . Store . SetValue ( AllowFocusWhenDisabledProperty , AllowFocusWhenDisabled , DependencyPropertyValuePrecedences . Local ) ;
160
+ }
161
+ }
162
+
145
163
/// <summary>
146
164
/// A layouter responsible to layout the content of a popup at the right place
147
165
/// </summary>
0 commit comments