/// <summary> /// Initializes a new instance of the <see cref="Xamarin.Forms.Platform.Tizen.Native.MasterDetailPage"/> class. /// </summary> /// <param name="parent">Parent evas object.</param> public MasterDetailPage(EvasObject parent) : base(parent) { LayoutUpdated += (s, e) => { UpdateChildCanvasGeometry(); }; // create the controls which will hold the master and detail pages _masterCanvas = new Canvas(this); _masterCanvas.SetAlignment(-1.0, -1.0); // fill _masterCanvas.SetWeight(1.0, 1.0); // expand _masterCanvas.LayoutUpdated += (sender, e) => { UpdatePageGeometry(_master); }; _detailCanvas = new Canvas(this); _detailCanvas.SetAlignment(-1.0, -1.0); // fill _detailCanvas.SetWeight(1.0, 1.0); // expand _detailCanvas.LayoutUpdated += (sender, e) => { UpdatePageGeometry(_detail); }; _splitPane = new Panes(this) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsFixed = true, IsHorizontal = false, Proportion = _splitRatio, }; _drawer = new Panel(Forms.NativeParent); _drawer.SetScrollable(_isGestureEnabled); _drawer.SetScrollableArea(1.0); _drawer.Direction = PanelDirection.Left; _drawer.Toggled += (object sender, EventArgs e) => { UpdateFocusPolicy(); IsPresentedChanged?.Invoke(this, new IsPresentedChangedEventArgs(_drawer.IsOpen)); }; ConfigureLayout(); // in case of the screen rotation we may need to update the choice between split // and popover behaviors and reconfigure the layout Device.Info.PropertyChanged += (s, e) => { if (e.PropertyName == nameof(Device.Info.CurrentOrientation)) { UpdateMasterBehavior(); } }; }
public LightweightPlatform(EvasObject parent) { Forms.NativeParent = parent; _defaultPlatformColor = Device.Idiom == TargetIdiom.Phone ? EColor.White : EColor.Transparent; _viewStack = new Native.Canvas(parent) { BackgroundColor = _defaultPlatformColor, }; _viewStack.SetAlignment(-1, -1); _viewStack.SetWeight(1.0, 1.0); _viewStack.LayoutUpdated += OnLayout; _viewStack.Show(); if (Forms.UseMessagingCenter) { _popupManager = new PopupManager(this); } }
/// <summary> /// Initializes a new instance of the <see cref="Xamarin.Forms.Platform.Tizen.Native.MasterDetailPage"/> class. /// </summary> /// <param name="parent">Parent evas object.</param> public MasterDetailPage(EvasObject parent) : base(parent) { LayoutUpdated += (s, e) => { var bound = Geometry; // main widget should fill the area of the MasterDetailPage if (_mainWidget != null) { _mainWidget.Geometry = bound; } bound.Width = (int)((s_popoverRatio * bound.Width)); _drawer.Geometry = bound; }; // create the controls which will hold the master and detail pages _masterCanvas = new Canvas(this); _masterCanvas.SetAlignment(-1.0, -1.0); // fill _masterCanvas.SetWeight(1.0, 1.0); // expand _masterCanvas.LayoutUpdated += (sender, e) => { UpdatePageGeometry(_master); }; _detailCanvas = new Canvas(this); _detailCanvas.SetAlignment(-1.0, -1.0); // fill _detailCanvas.SetWeight(1.0, 1.0); // expand _detailCanvas.LayoutUpdated += (sender, e) => { UpdatePageGeometry(_detail); }; _splitPane = new Panes(this) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsFixed = true, IsHorizontal = false, Proportion = s_splitRatio, }; _drawer = new Panel(Forms.Context.MainWindow); _drawer.SetScrollable(_isGestureEnabled); _drawer.SetScrollableArea(1.0); _drawer.Direction = PanelDirection.Left; _drawer.Toggled += (object sender, EventArgs e) => { IsPresentedChanged?.Invoke(this, EventArgs.Empty); }; ConfigureLayout(); // in case of the screen rotation we may need to update the choice between split // and popover behaviors and reconfigure the layout Forms.Context.MainWindow.RotationChanged += (sender, e) => { UpdateMasterBehavior(); }; }