void SetSelectionLengthFromRenderer(int selectionLength) { try { _nativeSelectionIsUpdating = true; ElementController?.SetValueFromRenderer(Entry.SelectionLengthProperty, selectionLength); } catch (System.Exception ex) { Application.Current?.FindMauiContext()?.CreateLogger <EntryRenderer>()?.LogWarning(ex, "Failed to set SelectionLength from renderer"); } finally { _nativeSelectionIsUpdating = false; } }
void SetCursorPositionFromRenderer(int start) { try { _nativeSelectionIsUpdating = true; ElementController?.SetValueFromRenderer(Entry.CursorPositionProperty, start); } catch (System.Exception ex) { Internals.Log.Warning("Entry", $"Failed to set CursorPosition from renderer: {ex}"); } finally { _nativeSelectionIsUpdating = false; } }
void SetSelectionLengthFromRenderer(int selectionLength) { try { _nativeSelectionIsUpdating = true; ElementController?.SetValueFromRenderer(Entry.SelectionLengthProperty, selectionLength); } catch (System.Exception ex) { Internals.Log.Warning("Entry", $"Failed to set SelectionLength from renderer: {ex}"); } finally { _nativeSelectionIsUpdating = false; } }
private void OnLoadFinished(object o, EventArgs args) { if (Control == null) { return; } _ignoreSourceChanges = true; ElementController?.SetValueFromRenderer(WebView.SourceProperty, new UrlWebViewSource { Url = Control.Uri }); _ignoreSourceChanges = false; _lastEvent = _lastBackForwardEvent; WebViewController?.SendNavigated(new WebNavigatedEventArgs( _lastEvent, Element?.Source, Control.Uri, WebNavigationResult.Success)); UpdateCanGoBackForward(); }
private void OnTimeChanged(object sender, EventArgs e) { var currentTime = (DateTime.Today + Control.CurrentTime); ElementController?.SetValueFromRenderer(TimePicker.TimeProperty, currentTime); }
private void OnChanged(object sender, System.EventArgs e) { ElementController?.SetValueFromRenderer(Picker.SelectedIndexProperty, Control.Active); }
private void OnFocused(object o, FocusedArgs args) { ElementController?.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, true); }
private void TextViewFocusedOut(object o, FocusOutEventArgs args) { ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); EditorController.SendCompleted(); }
protected virtual void OnLostFocus(object sender, RoutedEventArgs args) { ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); }
void OnStarted(object sender, EventArgs eventArgs) { ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, true); }
void HandleChanged(object sender, EventArgs e) { ElementController.SetValueFromRenderer(Editor.TextProperty, TextView.Text); }
private void OnEditingDone(object sender, System.EventArgs e) { ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); EntryController?.SendCompleted(); }
private void OnChanged(object sender, System.EventArgs e) { ElementController.SetValueFromRenderer(Entry.TextProperty, Control.Entry.Text); }
private void OnCheckButtonToggled(object sender, EventArgs e) { ElementController.SetValueFromRenderer(Switch.IsToggledProperty, Control.Active); }
private void OnValueChanged(object sender, EventArgs e) { ElementController.SetValueFromRenderer(Stepper.ValueProperty, Control.Value); }
private void OnDateChanged(object sender, EventArgs e) { ElementController?.SetValueFromRenderer(DatePicker.DateProperty, Control.CurrentDate.Date); }
private void SearchFocusOutEvent(object o, Gtk.FocusOutEventArgs args) { ElementController?.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); }
public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); bool layoutFlyout = false; bool layoutDetails = false; if (Forms.IsiOS13OrNewer) { layoutFlyout = _flyoutController?.View?.Superview != null; layoutDetails = _detailController?.View?.Superview != null; } else if (View.Subviews.Length < 2) { return; } else { layoutFlyout = true; layoutDetails = true; } if (layoutFlyout) { var flyoutBounds = _flyoutController.View.Frame; if (Forms.IsiOS13OrNewer) { _flyoutWidth = flyoutBounds.Width; } else { _flyoutWidth = (nfloat)Math.Max(_flyoutWidth, flyoutBounds.Width); } if (!flyoutBounds.IsEmpty) { FlyoutPage.FlyoutBounds = new Rectangle(0, 0, _flyoutWidth, flyoutBounds.Height); } } if (layoutDetails) { var detailsBounds = _detailController.View.Frame; if (!detailsBounds.IsEmpty) { FlyoutPage.DetailBounds = new Rectangle(0, 0, detailsBounds.Width, detailsBounds.Height); } } if (_previousViewDidLayoutSize == CGSize.Empty) { _previousViewDidLayoutSize = View.Bounds.Size; } // Is this being called from a rotation if (_previousViewDidLayoutSize != View.Bounds.Size) { _previousViewDidLayoutSize = View.Bounds.Size; // make sure IsPresented matches state of Flyout View if (FlyoutPage.CanChangeIsPresented && FlyoutPage.IsPresented != IsFlyoutVisible) { ElementController.SetValueFromRenderer(Microsoft.Maui.Controls.FlyoutPage.IsPresentedProperty, IsFlyoutVisible); } } if (_previousDisplayMode != PreferredDisplayMode) { _previousDisplayMode = PreferredDisplayMode; // make sure IsPresented matches state of Flyout View if (FlyoutPage.CanChangeIsPresented && FlyoutPage.IsPresented != IsFlyoutVisible) { ElementController.SetValueFromRenderer(Microsoft.Maui.Controls.FlyoutPage.IsPresentedProperty, IsFlyoutVisible); } } }
private void OnIsPresentedChanged(object sender, EventArgs e) { ElementController.SetValueFromRenderer(MasterDetailPage.IsPresentedProperty, Widget.IsPresented); }
private void LostFocus(object sender, EventArgs e) { ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); }