Hey Team,
I have a very strange question for you, I created a MAUI class library: and then created a TestButton inherits from RadButton,
like below
using Telerik.Maui.Controls; namespace TelerikLib.Components { public class NovaButton : RadButton { } }
I also created a TestListView inherited from RadListView like below
<?xml version="1.0" encoding="utf-8" ?>
<telerik:RadListView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
xmlns:local="clr-namespace:TelerikLib.Components"
x:Class="TelerikLib.Components.TestListView" ItemsSource="{Binding Source}">
<telerik:RadListView.BindingContext>
<local:ViewModel />
</telerik:RadListView.BindingContext>
<telerik:RadListView.ItemTemplate>
<DataTemplate>
<telerik:ListViewTemplateCell>
<telerik:ListViewTemplateCell.View>
<Grid>
<Label Margin="10" Text="{Binding Name}" />
</Grid>
</telerik:ListViewTemplateCell.View>
</telerik:ListViewTemplateCell>
</DataTemplate>
</telerik:RadListView.ItemTemplate>
</telerik:RadListView>
Code behind:
using Telerik.XamarinForms.DataControls;
namespace TelerikLib.Components;
public partial class TestListView : RadListView
{
public TestListView()
{
InitializeComponent();
}
}
After that I created a MAUI Main Project, and added class library reference into Main Project.
1. When I only add custom TestButton into Main Page, it runs well.
2. When I added custom TestListView, application always crashed, when I added .UseTelerik() method, then it runs well.
May I know why some components need .UseTelerik(), but some are not?
If I define custom components based on Telerik, should I have to add .UseTelerik() method into MAUIProgram?
Issue: based on Telerk.UI.for.MAUI Trial 1.0.1 + MAUI 6.0.312
Thanks
Allen