protected virtual void OnElementChanged(ElementChangedEventArgs <MasterDetailPage> e) { if (e.OldElement != null) { e.OldElement.PropertyChanged -= OnElementPropertyChanged; } if (e.NewElement != null) { if (Control == null) { Control = new MasterDetailControl(); Control.Loaded += OnControlLoaded; Control.Unloaded += OnControlUnlaoded; Control.SizeChanged += OnNativeSizeChanged; Control.RegisterPropertyChangedCallback(MasterDetailControl.IsPaneOpenProperty, OnIsPaneOpenChanged); Tracker = new VisualElementTracker <Page, FrameworkElement> { Container = Control, Element = Element }; } e.NewElement.PropertyChanged += OnElementPropertyChanged; UpdateDetail(); UpdateMaster(); UpdateMode(); UpdateIsPresented(); if (!string.IsNullOrEmpty(e.NewElement.AutomationId)) { Control.SetValue(AutomationProperties.AutomationIdProperty, e.NewElement.AutomationId); } } }
protected virtual void OnElementChanged(ElementChangedEventArgs <MasterDetailPage> e) { if (e.OldElement != null) { e.OldElement.PropertyChanged -= OnElementPropertyChanged; } if (e.NewElement != null) { if (Control == null) { Control = new MasterDetailControl(); Control.Loaded += OnControlLoaded; Control.Unloaded += OnControlUnloaded; Control.SizeChanged += OnNativeSizeChanged; Control.RegisterPropertyChangedCallback(MasterDetailControl.IsPaneOpenProperty, OnIsPaneOpenChanged); Tracker = new VisualElementTracker <Page, FrameworkElement> { Container = Control, Element = Element }; } if (e.NewElement.MasterTitleBarIsVisible == false) { Control.MasterToolbarVisibility = Visibility.Collapsed; Control.MasterTitleBarVisibility = Visibility.Collapsed; } e.NewElement.PropertyChanged += OnElementPropertyChanged; UpdateDetail(); UpdateMaster(); UpdateMode(); UpdateIsPresented(); if (!string.IsNullOrEmpty(e.NewElement.AutomationId)) { Control.SetValue(AutomationProperties.AutomationIdProperty, e.NewElement.AutomationId); } #if WINDOWS_UWP UpdateToolbarPlacement(); #endif } }
protected virtual void OnElementChanged(ElementChangedEventArgs <MasterDetailPage> e) { if (e.OldElement != null) { e.OldElement.PropertyChanged -= OnElementPropertyChanged; } if (e.NewElement != null) { if (Control == null) { Control = new MasterDetailControl(); Control.Loaded += OnControlLoaded; Control.Unloaded += OnControlUnloaded; Control.SizeChanged += OnNativeSizeChanged; Control.RegisterPropertyChangedCallback(MasterDetailControl.IsPaneOpenProperty, OnIsPaneOpenChanged); Tracker = new VisualElementTracker <Page, FrameworkElement> { Container = Control, Element = Element }; } e.NewElement.PropertyChanged += OnElementPropertyChanged; UpdateMode(); UpdateDetail(); UpdateMaster(); UpdateIsPresented(); if (!string.IsNullOrEmpty(e.NewElement.AutomationId)) { Control.SetValue(AutomationProperties.AutomationIdProperty, e.NewElement.AutomationId); } ((ITitleProvider)this).BarBackgroundBrush = (Brush)Windows.UI.Xaml.Application.Current.Resources["SystemControlBackgroundChromeMediumLowBrush"]; UpdateToolbarPlacement(); } }
protected virtual void OnElementChanged(ElementChangedEventArgs<MasterDetailPage> e) { if (e.OldElement != null) e.OldElement.PropertyChanged -= OnElementPropertyChanged; if (e.NewElement != null) { if (Control == null) { Control = new MasterDetailControl(); Control.Loaded += OnControlLoaded; Control.Unloaded += OnControlUnlaoded; Control.SizeChanged += OnNativeSizeChanged; Control.RegisterPropertyChangedCallback(MasterDetailControl.IsPaneOpenProperty, OnIsPaneOpenChanged); Tracker = new VisualElementTracker<Page, FrameworkElement> { Container = Control, Element = Element }; } e.NewElement.PropertyChanged += OnElementPropertyChanged; UpdateDetail(); UpdateMaster(); UpdateMode(); UpdateIsPresented(); if (!string.IsNullOrEmpty(e.NewElement.AutomationId)) Control.SetValue(AutomationProperties.AutomationIdProperty, e.NewElement.AutomationId); } }