예제 #1
0
        public override void SetEntryData(SettingsEntryBase entryData)
        {
            if (boolEntry != null)
            {
                boolEntry.OnDataValueChange -= OnEntryValueChange;
            }

            boolEntry = CastEntryData <SettingsEntryBool>(entryData);
            boolEntry.OnDataValueChange += OnEntryValueChange;

            toggle.LabelText = boolEntry.Name;
            toggle.IsFocused = boolEntry.Value;
        }
        public void TestEntryBool()
        {
            BindableBool data = new BindableBool(false);

            SettingsEntryBool boolEntry = new SettingsEntryBool("test-bool", data);

            Assert.AreEqual("test-bool", boolEntry.Name);
            Assert.AreEqual(data.Value, boolEntry.Value);

            boolEntry.Value = true;
            Assert.IsTrue(boolEntry.Value);
            Assert.IsTrue(data.Value);

            data.Value = false;
            Assert.IsFalse(boolEntry.Value);
            Assert.IsFalse(data.Value);
        }