mirror of
https://github.com/Maassoft/ColorControl.git
synced 2026-10-22 00:22:18 -05:00
fix several issues, add remote controls to new UI
This commit is contained in:
1 parent
c6c7e1ccc0
commit
827157f30f
91 files changed
+4140
-2530
No files matched your search
@@ -2,6 +2,14 @@
|
||||
|
||||
namespace ColorControl.UI.Services;
|
||||
|
||||
public class RectDimension
|
||||
{
|
||||
public double X { get; set; }
|
||||
public double Y { get; set; }
|
||||
public double Width { get; set; }
|
||||
public double Height { get; set; }
|
||||
}
|
||||
|
||||
public class JSHelper(IJSRuntime jsRuntime)
|
||||
{
|
||||
private IJSObjectReference? jsModule;
|
||||
@@ -26,6 +34,20 @@ public class JSHelper(IJSRuntime jsRuntime)
|
||||
await InvokeVoidAsync("ShowToast", id);
|
||||
}
|
||||
|
||||
public async Task<RectDimension> GetElementDimensions(string id)
|
||||
{
|
||||
jsModule = await LoadModule();
|
||||
|
||||
return await jsModule.InvokeAsync<RectDimension>("GetElementDimensions", id);
|
||||
}
|
||||
|
||||
public async Task<string> GetElementClassName(string id)
|
||||
{
|
||||
jsModule = await LoadModule();
|
||||
|
||||
return await jsModule.InvokeAsync<string>("GetElementClassName", id);
|
||||
}
|
||||
|
||||
private async ValueTask<T> InvokeAsync<T>(string identifier, params object?[]? names) where T : struct
|
||||
{
|
||||
jsModule = await LoadModule();
|
||||
|
||||
Reference in new issue
Block a user