Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions src/MatBlazor/Components/MatButton/BaseMatButton.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using System;
using System.Threading.Tasks;
using System.Windows.Input;

Expand Down Expand Up @@ -31,7 +32,7 @@ public BaseMatButton()
}

/// <summary>
/// Event occurs when the user clicks on an element.
/// Event occurs when the user clicks on an element.
/// </summary>
[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }
Expand All @@ -43,7 +44,7 @@ public BaseMatButton()
public bool OnClickStopPropagation { get; set; }

/// <summary>
/// Command executed when the user clicks on an element.
/// Command executed when the user clicks on an element.
/// </summary>
[Parameter]
public ICommand Command { get; set; }
Expand All @@ -60,7 +61,7 @@ public BaseMatButton()


/// <summary>
/// Command parameter.
/// Command parameter.
/// </summary>
[Parameter]
public object CommandParameter { get; set; }
Expand All @@ -74,7 +75,6 @@ public BaseMatButton()
/// <summary>
/// Force browser to redirect outside component router-space.
/// </summary>
///
[Parameter]
public bool ForceLoad { get; set; }

Expand Down Expand Up @@ -106,7 +106,6 @@ public BaseMatButton()
/// <summary>
/// Button has dense style.
/// </summary>

[Parameter]
public bool Dense { get; set; }

Expand Down Expand Up @@ -147,13 +146,19 @@ protected async void OnClickHandler(MouseEventArgs ev)
{
if (!string.IsNullOrEmpty(Target))
{
await JsInvokeAsync<object>("open", Link, Target);
try
{
await JsInvokeAsync<object>("open", Link, Target);
}
catch (TaskCanceledException ex)
{
Console.WriteLine(ex);
}
}
else
{
UriHelper.NavigateTo(Link, ForceLoad);
}

}
else
{
Expand All @@ -165,12 +170,4 @@ protected async void OnClickHandler(MouseEventArgs ev)
}
}
}

// public enum MatButtonType
// {
// Text = 0,
// Raised = 1,
// Unelevated = 2,
// Outlined = 3
// }
}
7 changes: 3 additions & 4 deletions src/MatBlazor/MatBlazor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.