【发布时间】:2018-03-16 04:43:17
【问题描述】:
我在 Xamarin 表单中使用 Rg.Popups 创建了一个弹出页面。应用程序中的弹出窗口有不同的变体,理想情况下,我希望使用包含不同内容的相同弹出窗口。
<?xml version="1.0" encoding="UTF-8"?>
<pages:PopupPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="CustomKeyboard.Controls.CustomPopup"
xmlns:local="clr-namespace:CustomKeyboard.Controls;assembly=CustomKeyboard"
xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup">
<StackLayout
VerticalOptions="Center"
HorizontalOptions="Center"
BackgroundColor = "#00000000"
Padding="20, 0, 20, 0">
<Frame CornerRadius = "8" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">
<local:Content1 />
</Frame>
</StackLayout>
这是一个内容视图及其静态。我需要内容视图是动态的。
所以当我导航到 CustomPopup 时,我应该能够指定我需要使用哪个 ContentView,并且弹出窗口需要呈现那个特定的内容视图。感谢有人可以提出一种巧妙的方法来实现这一点。
【问题讨论】:
标签: c# xaml xamarin xamarin.forms