-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1054 from unoplatform/dev/ramr/issueUno14746-addH…
…ashRedirect Add fragment or args redirect to samples page
- Loading branch information
Showing
10 changed files
with
381 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
Uno.Gallery/Uno.Gallery.Wasm/FragmentNavigationHandler.Interop.wasm.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Runtime.InteropServices.JavaScript; | ||
|
||
namespace Uno.Gallery.Wasm | ||
{ | ||
internal sealed partial class FragmentNavigationHandler | ||
{ | ||
internal static partial class NativeMethods | ||
{ | ||
private const string JsType = "globalThis.Uno.Gallery.Wasm.FragmentNavigation"; | ||
|
||
[JSImport($"{JsType}.getCurrentFragment")] | ||
internal static partial string GetCurrentFragment(); | ||
|
||
[JSImport($"{JsType}.setCurrentFragment")] | ||
internal static partial string SetCurrentFragment(string fragment); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Uno.Foundation; | ||
|
||
namespace Uno.Gallery.Wasm | ||
{ | ||
internal partial class FragmentNavigationHandler | ||
{ | ||
public static string CurrentFragment | ||
{ | ||
get | ||
{ | ||
return NativeMethods.GetCurrentFragment(); | ||
} | ||
|
||
set | ||
{ | ||
var escaped = WebAssemblyRuntime.EscapeJs(value); | ||
NativeMethods.SetCurrentFragment(escaped); | ||
} | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
Uno.Gallery/Uno.Gallery.Wasm/LocationHrefNavigationHandler.Interop.wasm.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Runtime.InteropServices.JavaScript; | ||
|
||
namespace Uno.Gallery.Wasm | ||
{ | ||
internal sealed partial class LocationHrefNavigationHandler | ||
{ | ||
internal static partial class NativeMethods | ||
{ | ||
private const string JsType = "globalThis.Uno.Gallery.Wasm.LocationHrefNavigation"; | ||
|
||
[JSImport($"{JsType}.getCurrentLocationHref")] | ||
internal static partial string GetCurrentLocationHref(); | ||
|
||
[JSImport($"{JsType}.setCurrentLocationHref")] | ||
internal static partial string SetCurrentLocationHref(string locationHref); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
Uno.Gallery/Uno.Gallery.Wasm/LocationHrefNavigationHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Uno.Foundation; | ||
|
||
namespace Uno.Gallery.Wasm | ||
{ | ||
internal partial class LocationHrefNavigationHandler | ||
{ | ||
public static string CurrentLocationHref | ||
{ | ||
get | ||
{ | ||
return NativeMethods.GetCurrentLocationHref(); | ||
} | ||
|
||
set | ||
{ | ||
var escaped = WebAssemblyRuntime.EscapeJs(value); | ||
NativeMethods.SetCurrentLocationHref(escaped); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
declare namespace Uno.Gallery.Wasm { | ||
class FragmentNavigation { | ||
private static currentFragment; | ||
static getCurrentFragment(): string; | ||
static setCurrentFragment(fragment: string): string; | ||
private static subscribed; | ||
static subscribeToFragmentChanged(): string; | ||
private static notifyFragmentChangedMethod; | ||
private static notifyFragmentChanged; | ||
private static initializeMethods; | ||
} | ||
} | ||
declare namespace Uno.UI.Demo { | ||
class Analytics { | ||
private static isLoaded; | ||
static reportPageView(screenName: string, appName?: string): string; | ||
private static init; | ||
} | ||
} | ||
declare namespace Uno.Gallery.Wasm { | ||
class LocationHrefNavigation { | ||
private static currentLocationHref; | ||
static getCurrentLocationHref(): string; | ||
static setCurrentLocationHref(locationHref: string): string; | ||
private static subscribed; | ||
static subscribeToLocationHrefChanged(): string; | ||
private static notifyLocationHrefChangedMethod; | ||
private static notifyLocationHrefChanged; | ||
private static initializeMethods; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.