Release Notes
Version 2.6.3 (2025-10-24)
Enhanced Features
TemplatedTaskLoader Events Now Include Actual View
The TemplatedTaskLoader events have been significantly enhanced! All four events now pass the actual view created from the ControlTemplate via the new ControlTemplateLoadedEventArgs class:
ResultControlTemplateLoaded- Now includes the result view ine.ViewLoadingControlTemplateLoaded- Now includes the loading view ine.ViewErrorControlTemplateLoaded- Now includes the error view ine.ViewEmptyControlTemplateLoaded- Now includes the empty view ine.View
New GetTemplateChild Method
Added GetTemplateChild(string name) method to easily retrieve named children from within the control template.
Usage Examples
Accessing the view from events:
myTemplatedTaskLoader.LoadingControlTemplateLoaded += (sender, e) =>
{
if (e.View is ActivityIndicator indicator)
{
// Directly manipulate the loading indicator
indicator.Color = Colors.Red;
Console.WriteLine($"Loading indicator is running: {indicator.IsRunning}");
}
};
myTemplatedTaskLoader.ResultControlTemplateLoaded += (sender, e) =>
{
if (e.View is Grid grid)
{
// Access and modify the result view
Console.WriteLine($"Result grid has {grid.Children.Count} children");
// Add custom behavior, animations, etc.
}
};Using GetTemplateChild to find named elements:
<tlv:TemplatedTaskLoader.LoadingControlTemplate>
<ControlTemplate>
<ActivityIndicator x:Name="MyLoadingIndicator"
Color="{StaticResource AccentColor}" />
</ControlTemplate>
</tlv:TemplatedTaskLoader.LoadingControlTemplate>// Find and manipulate named children
var indicator = myTemplatedTaskLoader.GetTemplateChild("MyLoadingIndicator") as ActivityIndicator;
if (indicator != null)
{
indicator.Scale = 1.5;
}Technical Implementation
This enhancement uses reflection to access MAUI's internal TemplateRoot property, which contains the actual view created from the ControlTemplate. The implementation is robust and includes proper error handling for future MAUI version compatibility.
Benefits
- Full view access: Directly manipulate views created from templates
- Custom animations: Add or trigger animations when states change
- Dynamic styling: Change appearance based on runtime conditions
- Advanced debugging: Inspect and validate template structure
- Named element access: Easily find specific controls within templates