XamarinCommunityToolkit
XamarinCommunityToolkit copied to clipboard
[Bug] x:TypeArguments is not working on Popup
Description
I'm trying to return strong type from popup but it's not compiling and showing error Partial declarations of 'ExpenseMiscellaneousSelectionPage' must not specify different base classes.
Also intelliSense is not showing x:TypeArguments in xaml.
ExpenseMiscellaneousSelectionPage.xaml
<xct:Popup xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyApp.Views.Expense.ExpenseMiscellaneousSelectionPage"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
xmlns:fa="clr-namespace:MyApp.Helpers.Fonts"
xmlns:b="clr-namespace:MyApp.Behaviours"
xmlns:dto="clr-namespace:MyApp.Models.Dtos.Expense"
x:DataType="dto:MiscellaneousItemDto"
x:TypeArguments="dto:MiscellaneousItemDto"
Size="300,400">
...
</xct:Popup>
ExpenseMiscellaneousSelectionPage.cs
using MyApp.Models.Dtos.Expense;
using Xamarin.CommunityToolkit.UI.Views;
using Xamarin.Forms.Xaml;
namespace MyApp.Views.Expense
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ExpenseMiscellaneousSelectionPage : Popup<MiscellaneousItemDto>
{
public ExpenseMiscellaneousSelectionPage()
{
InitializeComponent();
}
}
}
Steps to Reproduce
- Create popup page
- Set
xmlns:dto="clr-namespace:MyApp.Models.Dtos.Expense" - Set
x:TypeArguments="dto:MiscellaneousItemDto" - On
popup.xaml.csinherit from same typePopup<MiscellaneousItemDto>
Expected Behavior
Should compile and run
Actual Behavior
Not compiling and showing error
Severity Code Description Project File Line Suppression State
Error CS0263 Partial declarations of 'ExpenseMiscellaneousSelectionPage' must not specify different base classes F:\Xamarin\MyApp\MyApp\MyApp\Views\Expense\ExpenseMiscellaneousSelectionPage.xaml.cs 10
Basic Information
- Version with issue: 1.2.0
- Last known good version:
- IDE:
- Platform Target Frameworks:
- iOS: NA
- Android: 11.0
- UWP: NA
- Android Support Library Version:
- Nuget Packages:
- Affected Devices:
Could you maybe add a reproduction sample? As seen in this repo, this works. So I'm quite sure that this has to be something in your codebase rather than a bug on our side :)
The only difference I see between my sample and your code is the Toolkit version 1.1.0 vs 1.2.0 but I can hardly imagine this broke between these two versions
@uzairali001 this is a really late response but you don't actually need to define the base type in the C# your class definition can simply look like:
public partial class ExpenseMiscellaneousSelectionPage