protected override void CustomTitleBar() { if (DeviceHelper.IsDesktop && _titleBar == null) { _titleBar = new TitleBarControl() { ShowBackBtn = false }; (this.Content as Grid).Children.Add(_titleBar); Grid.SetColumnSpan(_titleBar, 5); Grid.SetRowSpan(_titleBar, 5); Canvas.SetZIndex(_titleBar, 100); } _titleBar.Setup(); }
protected virtual void CustomTitleBar() { var currentContent = this.Content as Grid; if (currentContent == null) { throw new ArgumentNullException("The root element of the page should be Grid."); } if (TitleBarUC == null) { TitleBarUC = new TitleBarControl(); TitleBarUC.OnClickBackBtn += () => { if (Frame.CanGoBack) { Frame.GoBack(); } }; (currentContent as Grid).Children.Add(TitleBarUC); Grid.SetColumnSpan(TitleBarUC, 5); Grid.SetRowSpan(TitleBarUC, 5); } TitleBarUC.Setup(); }