Пример #1
0
        public TextBox(ISpriteFont spriteFont)
        {
            _textBlock = new TextBlock(spriteFont)
            {
                Margin     = new Thickness(3, 6),
                Foreground = new SolidColorBrush(Colors.Black),
            };

            _textBlock.Bind(TextBlock.TextProperty, BindingFactory.CreateOneWay(this, TextProperty));

            Content = new Border()
            {
                Background      = new SolidColorBrush(Colors.Gray),
                BorderThickness = new Thickness(1),
                Child           = _textBlock,
            };

            _clickSubscription = Gestures
                                 .Where(gesture => gesture.Type == GestureType.LeftButtonDown)
                                 .Subscribe(HandleClick);
        }
Пример #2
0
 public SimpleButton()
 {
     Gestures
     .Where(gesture => gesture.Type == GestureType.LeftButtonUp)
     .Subscribe(HandleClick);
 }