MauiReactor Stacklayout inside datatemplate
See original GitHub issueHi, I’m using some 3rd part component that have a property called ContentTemplate that accepts a DataTemplate.
I have used this code but it goes on error:
class MainPage : Component
{
SfPopup poppy;
public override VisualNode Render()
{
poppy = new SfPopup()
{
IsOpen = false,
ContentTemplate = new MauiControls.DataTemplate(() =>
{
StackLayout stack = new()
{
new Label("testo popup")
};
return stack;
})
};
return new ContentPage("Pagina uno")
{
new ScrollView() {
new Label("Main page"),
new Button().Text("Apri popup").OnClicked(ApriPopup)
}.VCenter().HCenter()
};
}
private void ApriPopup()
{
poppy.Show();
}
}
This is the erorr:
How can i use the MauiReactor Stacklayout inside a DataTemplate?
Thank you.
Issue Analytics
- State:
- Created 3 months ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Data templates - .NET MAUI
A DataTemplate is used to specify the appearance of data, and typically uses data binding to display data. A common usage scenario for...
Read more >Binding command inside stacklayout datatemplate not ...
Trying to fire a command inside a stacklayout with itemssource. I wonder why the NavigateToProductListViewShopTappedCommand is not getting fired ...
Read more >Component-based UI & MVU for .NET MAUI - YouTube
Join me in this video to get started with MauiReactor ! ... NET MAUI apps without XAML 1:19 - MauiReactor GitHub Repository 2:13...
Read more >Reusable Controls and Data Template Selectors in Xamarin ...
Stop copy and pasting around XAML all over your Xamarin.Forms and .NET MAUI apps and start reusable controls, templates, cells, ...
Read more >docs-maui/docs/fundamentals/datatemplate.md at main
DataTemplate is used to specify the appearance of data, and typically uses data binding to display data. A common usage scenario for data...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

ok, I see that SfPopup doesn’t provide a direct way to set the content so you have to use a
TemplateHost(that is a class that allows you to create a native Maui control from a MauiReactor VisualNode):Hi, yes is correct.
Check the syncfusion documentation to know more: https://help.syncfusion.com/maui/popup/getting-started
There is a a sample where the app is configured and the code
builder.ConfigureSyncfusionCore();is used 😉