本文整理匯總了C#中Windows.UI.Xaml.Controls.Page.GetOrCreateRenderer方法的典型用法代碼示例。如果您正苦於以下問題:C# Page.GetOrCreateRenderer方法的具體用法?C# Page.GetOrCreateRenderer怎麽用?C# Page.GetOrCreateRenderer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Windows.UI.Xaml.Controls.Page
的用法示例。
在下文中一共展示了Page.GetOrCreateRenderer方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: UpdateMaster
void UpdateMaster()
{
ClearMaster();
FrameworkElement element = null;
_master = Element.Master;
if (_master != null)
{
_master.PropertyChanged += OnMasterPropertyChanged;
IVisualElementRenderer renderer = _master.GetOrCreateRenderer();
element = renderer.ContainerElement;
}
Control.Master = element;
Control.MasterTitle = _master?.Title;
}
示例2: UpdateDetail
void UpdateDetail()
{
ClearDetail();
FrameworkElement element = null;
_detail = Element.Detail;
if (_detail != null)
{
_detail.PropertyChanged += OnDetailPropertyChanged;
IVisualElementRenderer renderer = _detail.GetOrCreateRenderer();
element = renderer.ContainerElement;
}
Control.Detail = element;
UpdateDetailTitle();
}
示例3: SetMaster
void SetMaster(Page masterPage)
{
if (_masterRenderer != null)
{
FrameworkElement native = _masterRenderer.ContainerElement;
_container.MasterContent = null;
_masterRenderer = null;
}
if (masterPage == null)
return;
_masterRenderer = masterPage.GetOrCreateRenderer();
_container.MasterContent = _masterRenderer.ContainerElement;
}
示例4: SetDetail
void SetDetail(Page detailPage)
{
((ITitleProvider)this).ShowTitle = detailPage is NavigationPage;
if (_detailRenderer != null)
{
FrameworkElement native = _detailRenderer.ContainerElement;
_container.DetailContent = null;
_detailRenderer = null;
}
if (detailPage == null)
return;
_detailRenderer = detailPage.GetOrCreateRenderer();
_container.DetailContent = _detailRenderer.ContainerElement;
UpdateTitle();
}
示例5: SetCurrent
async void SetCurrent(Page newPage, bool animated, bool popping = false, Action completedCallback = null)
{
if (newPage == _currentPage)
return;
newPage.Platform = this;
if (_currentPage != null)
{
Page previousPage = _currentPage;
IVisualElementRenderer previousRenderer = GetRenderer(previousPage);
_container.Children.Remove(previousRenderer.ContainerElement);
if (popping)
previousPage.Cleanup();
}
newPage.Layout(new Rectangle(0, 0, _page.ActualWidth, _page.ActualHeight));
IVisualElementRenderer pageRenderer = newPage.GetOrCreateRenderer();
_container.Children.Add(pageRenderer.ContainerElement);
pageRenderer.ContainerElement.Width = _container.ActualWidth;
pageRenderer.ContainerElement.Height = _container.ActualHeight;
if (completedCallback != null)
completedCallback();
_currentPage = newPage;
UpdateToolbarTracker();
UpdateToolbarTitle(newPage);
await UpdateToolbarItems();
}
示例6: SetPage
void SetPage(Page page, bool isAnimated, bool isPopping)
{
if (_currentPage != null)
{
if (isPopping)
_currentPage.Cleanup();
_container.Content = null;
_currentPage.PropertyChanged -= OnCurrentPagePropertyChanged;
}
_previousPage = _currentPage;
_currentPage = page;
if (page == null)
return;
UpdateBackButton();
UpdateBackButtonTitle();
page.PropertyChanged += OnCurrentPagePropertyChanged;
IVisualElementRenderer renderer = page.GetOrCreateRenderer();
UpdateNavigationBarVisible();
UpdateTitleOnParents();
if (isAnimated && _transition == null)
{
_transition = new ContentThemeTransition();
_container.ContentTransitions = new TransitionCollection();
}
if (!isAnimated && _transition != null)
_container.ContentTransitions.Remove(_transition);
else if (isAnimated && _container.ContentTransitions.Count == 0)
_container.ContentTransitions.Add(_transition);
_container.Content = renderer.ContainerElement;
_container.DataContext = page;
}