33 lines
917 B
Text
33 lines
917 B
Text
@inherits LayoutComponentBase
|
|
@implements IDisposable
|
|
@inject NavigatorService NavigatorService
|
|
@inject NavigationManager NavigationManager
|
|
@inject State State
|
|
<NavMenu />
|
|
<main class="responsive max">
|
|
@Body
|
|
</main>
|
|
|
|
@code {
|
|
protected override void OnInitialized() {
|
|
base.OnInitialized();
|
|
NavigatorService.NavigationManager = NavigationManager;
|
|
State.IntentReceived += IntentRecieved;
|
|
if (!string.IsNullOrEmpty(State.ShareString) || !string.IsNullOrEmpty(State.SharePhoto)) {
|
|
IntentRecieved();
|
|
}
|
|
}
|
|
|
|
private void IntentRecieved(object? sender = null, EventArgs? e = null) {
|
|
if (!string.IsNullOrEmpty(State.ShareString)) {
|
|
NavigationManager.NavigateTo($"/sharetext");
|
|
}
|
|
else if (!string.IsNullOrEmpty(State.SharePhoto)) {
|
|
NavigationManager.NavigateTo($"/sharepic");
|
|
}
|
|
}
|
|
|
|
void IDisposable.Dispose() {
|
|
State.IntentReceived -= IntentRecieved;
|
|
}
|
|
}
|