Hi,
I used the Docklayout.On the navigation i have two buttons.
On the content I want to switch for two content views.
I used this code without success.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MAUI.MainPage"
xmlns:telerik="clr-namespace:Telerik.Maui.Controls;assembly=Telerik.Maui.Controls"
BackgroundColor="White">
<telerik:RadDockLayout x:Name="dockLayout">
<Grid HeightRequest="60"
telerik:RadDockLayout.Dock="Top">
<Label Text="Header" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" FontSize="Medium"/>
</Grid>
<Grid
telerik:RadDockLayout.Dock="Bottom">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Text="CopyRight" HorizontalOptions="EndAndExpand" VerticalOptions="CenterAndExpand" FontSize="Caption"/>
</Grid>
<Grid
telerik:RadDockLayout.Dock="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<telerik:RadButton Grid.Row="0" Grid.Column ="0" Text="Button 1" HorizontalOptions="Start" VerticalOptions="Center" Clicked="OnButton1Clicked"/>
<telerik:RadButton Grid.Row="1" Grid.Column ="0" Text="Button 2" HorizontalOptions="Start" VerticalOptions="Center" Clicked="OnButton2Clicked"/>
</Grid>
<Grid >
<ContentView x:Name="cuurentContentView"/>
</Grid>
</telerik:RadDockLayout>
</ContentPage>
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void OnButton1Clicked(object sender, EventArgs e)
{
cuurentContentView = new DashboardView();
}
private void OnButton2Clicked(object sender, EventArgs e)
{
cuurentContentView = new RoutesView();
}
}
The tile change the content dynamically