protected override bool OnUpdate() { UpdateUI(); NativeActions.GetInstance().Execute(); DllImports.Draw(); return(true); }
private void LoadTiles() { _resourcesTargetCount += ContentList.Count; foreach (var contentItem in ContentList) { NativeActions.GetInstance().Enqueue(() => LoadAndSchedule(new TileResource(DllImports.AddTile(), contentItem.Poster, contentItem.Title ?? "", contentItem.Description ?? ""))); } }
private async void LoadAndSchedule(Resource resource) { await Task.Run(async() => { await resource.Load(); }); NativeActions.GetInstance().Enqueue(resource.Push); ++_resourcesLoadedCount; UpdateLoadingState(); }
private async void SetLoaderLogo(string path) { var imageData = await Resource.GetImage(path); NativeActions.GetInstance().Enqueue(() => { unsafe { fixed(byte *pixels = imageData.Pixels) DllImports.SetLoaderLogo(new DllImports.ImageData { id = 0, pixels = pixels, width = imageData.Width, height = imageData.Height, format = (int)imageData.Format }); } }); }