示例#1
0
        public DeferredProperty(IProperty <T> source)
        {
            _source = source;

            _realtimeValue = Observable.Merge(
                _maybeSetValue.NotNone(),
                source.Do(_ => _maybeSetValue.OnNext(Optional.None <T>())));
        }
示例#2
0
        static IControl CreateDebugItem(string name, Command selected)
        {
            var isSelected = SelectedControl.NotNone().Select(sel => sel == name);

            return(Button.Create(
                       text: name,
                       clicked: selected,
                       content: states =>
                       Label.Create(name, color: states.IsHovered.Select(hovered => hovered ? Color.FromBytes(0x6d, 0xc0, 0xd2) : Color.White).AsBrush())
                       .WithPadding(new Thickness <Points>(10, 5, 10, 5))
                       .WithOverlay(Shapes.Rectangle(fill: isSelected.Select(hovered => hovered ? Color.FromBytes(0x6d, 0xc0, 0xd2, 100) : Color.Transparent).AsBrush()))
                       )
                   .SetContextMenu(Menu.Item("Open in Text Editor", () => new Shell().OpenWithDefaultApplication(DebugControls.Value[name].FilePath))));
        }