2
2
3
3
using System ;
4
4
using System . Collections . Generic ;
5
- using System . Linq ;
6
5
using DirectUI ;
7
6
using Microsoft . UI . Input ;
8
7
using Microsoft . UI . Xaml . Controls . Primitives ;
@@ -70,10 +69,10 @@ private void SetupEditableMode()
70
69
if ( m_tpDropDownOverlayPart is not null )
71
70
{
72
71
m_tpDropDownOverlayPart . PointerEntered += OnDropDownOverlayPointerEntered ;
73
- m_spDropDownOverlayPointerEnteredHandler . Disposable = Disposable . Create ( ( ) => m_tpContentPresenterPart . PointerEntered -= OnDropDownOverlayPointerEntered ) ;
72
+ m_spDropDownOverlayPointerEnteredHandler . Disposable = Disposable . Create ( ( ) => m_tpDropDownOverlayPart . PointerEntered -= OnDropDownOverlayPointerEntered ) ;
74
73
75
74
m_tpDropDownOverlayPart . PointerExited += OnDropDownOverlayPointerExited ;
76
- m_spDropDownOverlayPointerExitedHandler . Disposable = Disposable . Create ( ( ) => m_tpContentPresenterPart . PointerExited -= OnDropDownOverlayPointerExited ) ;
75
+ m_spDropDownOverlayPointerExitedHandler . Disposable = Disposable . Create ( ( ) => m_tpDropDownOverlayPart . PointerExited -= OnDropDownOverlayPointerExited ) ;
77
76
78
77
m_tpDropDownOverlayPart . Visibility = Visibility . Visible ;
79
78
}
@@ -86,13 +85,14 @@ private void SetupEditableMode()
86
85
ResetSearch ( ) ;
87
86
ResetSearchString ( ) ;
88
87
89
- wrl ::ComPtr < xaml_controls ::IInputValidationContext > context ;
90
- get_ValidationContext ( & context ) ) ;
91
- pEditableTextPartAsTextBox . ValidationContext ( context . Get ( ) ) ) ;
88
+ // TODO Uno: Input validation support #4839
89
+ //wrl::ComPtr<xaml_controls::IInputValidationContext> context;
90
+ //get_ValidationContext(&context));
91
+ //pEditableTextPartAsTextBox.ValidationContext(context.Get()));
92
92
93
- wrl ::ComPtr < xaml_controls ::IInputValidationCommand > command ;
94
- get_ValidationCommand ( & command ) ) ;
95
- pEditableTextPartAsTextBox ->put_ValidationCommand ( command . Get ( ) ) ) ;
93
+ // wrl::ComPtr<xaml_controls::IInputValidationCommand> command;
94
+ // get_ValidationCommand(&command));
95
+ // pEditableTextPartAsTextBox->put_ValidationCommand(command.Get()));
96
96
97
97
if ( m_tpPopupPart is not null )
98
98
{
@@ -129,10 +129,8 @@ private void DisableEditableMode()
129
129
130
130
if ( m_tpDropDownOverlayPart is not null )
131
131
{
132
- var pDropDownOverlayPartAsI = iinspectable_cast ( m_tpDropDownOverlayPart . Cast < Border > ( ) ) ;
133
-
134
- m_spDropDownOverlayPointerEnteredHandler . DetachEventHandler ( pDropDownOverlayPartAsI ) ) ;
135
- m_spDropDownOverlayPointerExitedHandler . DetachEventHandler ( pDropDownOverlayPartAsI ) ) ;
132
+ m_spDropDownOverlayPointerEnteredHandler . Disposable = null ;
133
+ m_spDropDownOverlayPointerExitedHandler . Disposable = null ;
136
134
137
135
m_tpDropDownOverlayPart . Visibility = Visibility . Collapsed ;
138
136
}
@@ -621,7 +619,7 @@ private void UpdateEditableContentPresenterTextBlock(object item)
621
619
}
622
620
623
621
EnsurePropertyPathListener ( ) ;
624
- var itemString = TryGetStringValue ( item ) //, m_spPropertyPathListener); TODO Uno: Missing PropertyPathListener support
622
+ var itemString = TryGetStringValue ( item ) ; //, m_spPropertyPathListener); TODO Uno: Missing PropertyPathListener support
625
623
UpdateEditableContentPresenterTextBlock ( itemString ) ;
626
624
}
627
625
@@ -699,17 +697,15 @@ private void CommitRevertEditableSearch(bool restoreValue)
699
697
700
698
if ( m_customValueRef is not null )
701
699
{
702
- wrl_wrappers ::HString storedString ;
703
- IValueBoxer ::UnboxValue ( m_customValueRef . Get ( ) , storedString . GetAddressOf ( ) ) ;
700
+ var storedString = m_customValueRef as string ;
704
701
705
702
// Prevent sending the event if the custom value is the same.
706
703
sendEvent = ! AreStringsEqual ( storedString , searchString ) ;
707
704
}
708
705
709
706
if ( sendEvent )
710
707
{
711
- ctl ::ComPtr < IInspectable > spInspectable ;
712
- PropertyValue ::CreateFromString ( searchString , & spInspectable ) ) ;
708
+ var spInspectable = searchString ;
713
709
714
710
bool isHandled = RaiseTextSubmittedEvent ( searchString ) ;
715
711
@@ -845,7 +841,6 @@ private void OnKeyDownPrivate(object pSender, KeyRoutedEventArgs pArgs)
845
841
m_handledGamepadOrRemoteKeyDown = eventHandled && XboxUtility . IsGamepadNavigationInput ( originalKey ) ;
846
842
}
847
843
848
-
849
844
private void OnTextBoxTextChanged ( object sender , TextChangedEventArgs args )
850
845
{
851
846
//DEAD_CODE_REMOVAL
@@ -893,7 +888,7 @@ protected override void OnPointerEntered(PointerRoutedEventArgs e)
893
888
894
889
if ( isEventSourceTarget )
895
890
{
896
- m_isPointerOverMain = true ;
891
+ m_IsPointerOverMain = true ;
897
892
m_bIsPressed = false ;
898
893
UpdateVisualState ( ) ;
899
894
}
@@ -1434,7 +1429,7 @@ private bool StartsWithIgnoreLinguisticSemantics(string strSource, string strPre
1434
1429
return strSource . StartsWith ( strPrefix , StringComparison . InvariantCultureIgnoreCase ) ;
1435
1430
}
1436
1431
1437
- private bool AreStringsEqual ( string str1 , string str2 ) => string . Equals ( str1 , str2 , StringComparison . OrdinalIgnoreCase ) ;
1432
+ private bool AreStringsEqual ( string ? str1 , string ? str2 ) => string . Equals ( str1 , str2 , StringComparison . OrdinalIgnoreCase ) ;
1438
1433
1439
1434
private bool IsSearchStringValid ( string str )
1440
1435
{
@@ -1628,7 +1623,7 @@ private bool IsChildOfTarget(
1628
1623
return result ;
1629
1624
}
1630
1625
1631
- private InputDeviceType GetInputDeviceTypeUsedToOpen ( ) => m_inputDeviceTypeUsedToOpen ;
1626
+ internal InputDeviceType GetInputDeviceTypeUsedToOpen ( ) => m_inputDeviceTypeUsedToOpen ;
1632
1627
1633
1628
private void OverrideSelectedIndexForVisualStates ( int selectedIndexOverride )
1634
1629
{
@@ -1736,4 +1731,21 @@ private void CreateEditableContentPresenterTextBlock()
1736
1731
m_tpEditableContentPresenterTextBlock = spTextBlock ;
1737
1732
}
1738
1733
}
1734
+
1735
+
1736
+ #if HAS_UNO // Not ported yet
1737
+ private void SetContentPresenter ( int value ) { }
1738
+
1739
+ private void PopupKeyDown ( KeyRoutedEventArgs args ) { }
1740
+
1741
+ private void MainKeyDown ( KeyRoutedEventArgs args ) { }
1742
+
1743
+ private void ArrangePopup ( bool value ) { }
1744
+
1745
+ private void EnsurePresenterReadyForFullMode ( ) { }
1746
+
1747
+ private void EnsurePresenterReadyForInlineMode ( ) { }
1748
+
1749
+ private void ForceApplyInlineLayoutUpdate ( ) { }
1750
+ #endif
1739
1751
}
0 commit comments