1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Fixed a crash on Bubbles and Overlay views

This commit is contained in:
SpoinkyNL 2016-11-14 12:36:55 +01:00
parent b1f4461b75
commit 479ed0300a
2 changed files with 12 additions and 3 deletions

View File

@ -5,7 +5,7 @@
-- This is a default script to be executed by Artemis.
-- You do not need to use this if you don't want to script. The default profiles
-- should provide you with a lot of functionality out of the box.
-- However, if you wan't to change the way profiles work, this is the ideal way
-- However, if you want to change the way profiles work, this is the ideal way
-- go about it.
-- For docs and examples, see wiki: https://github.com/SpoinkyNL/Artemis/wiki/LUA
@ -15,7 +15,9 @@
-- This event is raised after every profile update, before drawing.
function updateHandler(profile, eventArgs)
-- In this example we only want to update once per frame when the keyboard is updated
-- In this example we only want to update once per frame when the keyboard is
-- updated. If you don't do this the updateHandler will trigger on every
-- device's update.
if eventArgs.DeviceType != "keyboard" then
return
end
@ -25,7 +27,8 @@ end
-- This event is raised after every profile draw, after updating.
function drawHandler(profile, eventArgs)
-- In this example we only want to draw to the keyboard
-- In this example we only want to draw to the keyboard. Each device has it's
-- own drawing event
if eventArgs.DeviceType != "keyboard" then
return
end

View File

@ -141,6 +141,12 @@ namespace Artemis.ViewModels
CheckDuplicateInstances();
Updater.CheckChangelog(MetroDialogService);
// Run this on the UI thread to avoid having to use dispatchers in VMs
Execute.OnUIThread(ActivateViews);
}
private void ActivateViews()
{
var vms = _kernel.GetAll<BaseViewModel>().ToList();
Items.Clear();
Items.AddRange(vms);