This page contains documentation for advanced Fuse features, so we have taken the liberty to tick the "Show advanced things" checkbox above for you in advance to be able to provide you with some additional information.

This module provides access to whether or not the current OS setting for Dark Mode is enabled and or changed.

Example

<App>
    <JavaScript>

        var DarkMode = require("FuseJS/DarkMode");
        var Observable = require("FuseJS/Observable");

        var isDarkMode = Observable(false);

        DarkMode.on("changed", function(val) {
            console.log("DARKMODE CHANGED: " + val);
            switch(val) {
                case 'light': isDarkMode.value = false;
                    break;
                case 'dark': isDarkMode.value = true;
                    break;
            }
        });

        module.exports = {
            isDarkMode
        }

    </JavaScript>
    <StackPanel Alignment="Center">
        <Text ux:Name="title" Value="Hello World!" />
    </StackPanel>
    <Rectangle ux:Name="bk" Layer="Background" Color="#FFF" />

    <WhileTrue Value="{isDarkMode}">
        <Change title.Value="Hello Dark World!" />
        <Change title.Color="#FFF" />
        <Change bk.Color="#000" />
    </WhileTrue>
    <WhileFalse Value="{isDarkMode}">
        <Change title.Value="Hello World!" />
        <Change title.Color="#000" />
        <Change bk.Color="#FFF" />
    </WhileFalse>
</App>

Location

Namespace
Fuse.Controls.Native.iOS
Package
Fuse.Controls.Native 2.9.1
Show Uno properties and methods

Interface of DarkMode

Inherited from NativeEventEmitterModule

Emit(object[]) uno

Call emit with the given arguments on the underlying JS EventEmitter.

Inherited from NativeModule

Inherited from Module

GetFile : FileSource uno

Returns the file source that will be watched by the Context for changes in Fuse preview. Override in subclasses and return correct file source to support live updates in Fuse preview.

Inherited from object

Attached UX Attributes

GlobalKey (attached by Resource) : string ux

The ux:Global attribute creates a global resource that is accessible everywhere in UX markup.

Implemented Interfaces