Exemplo n.º 1
0
        void OnLoaded(object sender, UI.Xaml.RoutedEventArgs e)
        {
            _queryTextBox = NativeView?.GetFirstDescendant <MauiTextBox>();
            _cancelButton = _queryTextBox?.GetFirstDescendant <MauiCancelButton>();

            if (_cancelButton != null)
            {
                if (_defaultDeleteButtonBackgroundColorBrush == null)
                {
                    _defaultDeleteButtonBackgroundColorBrush = _cancelButton.Background;
                }

                if (_defaultDeleteButtonForegroundColorBrush == null)
                {
                    _defaultDeleteButtonForegroundColorBrush = _cancelButton.Foreground;
                }

                // The Cancel button's content won't be loaded right away (because the default Visibility is Collapsed)
                // So we need to wait until it's ready, then force an update of the button color
                _cancelButton.ReadyChanged += (o, args) =>
                {
                    if (VirtualView != null)
                    {
                        NativeView?.UpdateCancelButtonColor(VirtualView, _cancelButton, _defaultDeleteButtonBackgroundColorBrush, _defaultDeleteButtonForegroundColorBrush);
                    }
                };
            }

            if (VirtualView != null)
            {
                NativeView?.UpdateHorizontalTextAlignment(VirtualView, _queryTextBox);
                NativeView?.UpdateMaxLength(VirtualView, _queryTextBox);
            }
        }
Exemplo n.º 2
0
 void NativeViewGotFocus(object sender, UI.Xaml.RoutedEventArgs e)
 {
     if (VirtualView != null)
     {
         VirtualView.IsFocused = true;
     }
 }
Exemplo n.º 3
0
        void OnToggled(object sender, UI.Xaml.RoutedEventArgs e)
        {
            if (VirtualView == null || NativeView == null)
            {
                return;
            }

            VirtualView.IsOn = NativeView.IsOn;
        }
Exemplo n.º 4
0
        void OnToggled(object sender, UI.Xaml.RoutedEventArgs e)
        {
            if (VirtualView is null || PlatformView is null || VirtualView.IsOn == PlatformView.IsOn)
            {
                return;
            }

            VirtualView.IsOn = PlatformView.IsOn;
        }
Exemplo n.º 5
0
 void OnLoaded(object sender, UI.Xaml.RoutedEventArgs e)
 {
     if (VirtualView != null)
     {
         PlatformView?.UpdateTextColor(VirtualView);
         PlatformView?.UpdatePlaceholderColor(VirtualView);
         PlatformView?.UpdateHorizontalTextAlignment(VirtualView);
         PlatformView?.UpdateMaxLength(VirtualView);
     }
 }
 void OnClick(object sender, UI.Xaml.RoutedEventArgs e)
 {
     VirtualView?.Clicked();
     VirtualView?.Released();
 }
Exemplo n.º 7
0
 void OnClicked(object sender, UI.Xaml.RoutedEventArgs e)
 {
     VirtualView.Clicked();
 }
 private void IrItemContentControl_Loaded(object sender, UI.Xaml.RoutedEventArgs e)
 {
     Data.virtualListView.ViewSelector.ViewAttached(Data.position, View);
 }
Exemplo n.º 9
0
 private void OnLoaded(object sender, UI.Xaml.RoutedEventArgs e)
 {
     UpdateValue(nameof(Shell.FlyoutBackground));
 }