私のポップアップの継承元のクラスがコールバックを処理します。Xamarin XAML問題:継承型がxmlns名前空間に見つかりません
私のアプローチ: クラス( "CallbackPopup")を作成しますPopupPageから継承(https://github.com/rotorgames/Rg.Plugins.Popup) CallbackPopupから継承XAML + CSファイルを作成します
CallbackPopup:(私のカスタムポップアップのための私の基本クラス)
using Rg.Plugins.Popup.Pages;
namespace MyProject
{
public class CallbackPopup : PopupPage
{
//[...]
}
}
継承するクラス - XAML:
<?xml version="1.0" encoding="utf-8" ?>
<myproject:CallbackPopup xmlns="http://xamarin.com/schemas/2014/forms" <!-- throws the error -->
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:myproject="clr-namespace:MyProject;assembly=MyProject"
x:Class="MyProject.Layout.Popups.InheritingPopup">
<CallbackPopup.Content>
<!-- [...] -->
</CallbackPopup.Content>
</myproject:CallbackPopup>
継承するクラス - CS:
using Rg.Plugins.Popup.Services;
using System;
using Xamarin.Forms.Xaml;
namespace MyProject.Layout.Popups
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class InheritingPopup: CallbackPopup
{
public InheritingPopup()
{
InitializeComponent();
}
// [...]
}
エラー:
Type CallbackPopup not found in xmlns http://xamarin.com/schemas/2014/forms
私はポップアップのfunctionallityをテストして、それが成功しています。 しかし、それを基本クラスとして作成し、他のポップアップを継承させることは、私のエラー状態としては機能しません。 XAML宣言に何かがないか、RG Plugins PopupPageから継承して問題が発生していますか?
http://www.burkharts.net/apps/blog/the-secret-life-of-a-xaml-page/状態: 「(彼らは唯一の資源となしコンテンツを定義しない限り)あなたは、XAMLを導き出すことはできませんが、別のXAML定義されたページからページを定義した」 は、それが問題の原因である可能性がありますか? RG Plugins PopupPagesがリソースとコンテンツ以上を定義するXaml定義のページであるかどうかは分かりません。
ご協力いただきありがとうございます。
を!ありがたいことに、RG PopupPagesでもこのように実装しています。良い一日を – Csharpest