diff --git a/BlazorApp-Investment Tax Calculator/MainLayout.razor b/BlazorApp-Investment Tax Calculator/MainLayout.razor index c029db0a..5ca57c39 100644 --- a/BlazorApp-Investment Tax Calculator/MainLayout.razor +++ b/BlazorApp-Investment Tax Calculator/MainLayout.razor @@ -18,7 +18,7 @@ + @code { + public bool SidebarToggle = true; // Specify the value of ListView component DataSource property. public List List = new List { - new listData {Id="1", Text = "Home", IconCss = "sb-icons icon-grid e-sb-icon control-icon", PageAddress = ""}, - new listData {Id="2",Text = "Import/Export", IconCss = "sb-icons icon-chart e-sb-icon control-icon", PageAddress = "MainCalculatorPage"}, - new listData {Id="3",Text = "Disposal Summary", IconCss = "sb-icons icon-datepicker e-sb-icon control-icon", PageAddress = "CalculationViewPage"}, - new listData {Id="4", Text = "Trade Matches", IconCss = "sb-icons icon-dialog e-sb-icon control-icon", PageAddress = "TradeMatchPage"}, - new listData {Id="5", Text = "Dividend Data", IconCss = "sb-icons icon-dialog e-sb-icon control-icon", PageAddress = "DividendDataPage"}, + new listData {Id="1", Text = "Home", PageAddress = ""}, + new listData {Id="2",Text = "Import/Export", PageAddress = "MainCalculatorPage"}, + new listData {Id="3",Text = "Disposal Summary", PageAddress = "CalculationViewPage"}, + new listData {Id="4", Text = "Trade Matches", PageAddress = "TradeMatchPage"}, + new listData {Id="5", Text = "Dividend Data", PageAddress = "DividendDataPage"}, }; + public class listData { public required string Id { get; set; } public required string Text { get; set; } - public required string IconCss { get; set; } public required string PageAddress { get; set; } } + // Specifies the event handler for Clicked event in ListView component. public void OnSelect(Syncfusion.Blazor.Lists.ClickEventArgs args) { Navigation.NavigateTo(Navigation.BaseUri + args.ItemData.PageAddress); } + + public void ToggleMenu() + { + SidebarToggle = !SidebarToggle; + } }