Ejemplo n.º 1
0
        public void Arrange_Left()
        {
            textStyle.SetValue(textStyleDefinition.Alignment, Alignment.Start);

            var text = "Hello World, Here I am.";
            var view = CreateView(text);

            view.Arrange(new Rectangle(10, 20, 400, 100));

            view[0].LayoutRect.Location.Should().Be(new Point(10, 20));
            view[0].LayoutRect.Size.Should().Be(new Point(text.Length * 11, 15));
        }
Ejemplo n.º 2
0
        public bool SetValue(IStyleKey key, object value)
        {
            var idx = StyleSystem.LinearIndexFor(key);

            cachedValues[idx] = null;
            if (elementStyle.SetValue(key, value))
            {
                if (key.Inherit || InheritMarker.IsInheritMarker(value))
                {
                    // inherited styles are distributed to child elements, so we need to explicitly clear them all.
                    self.InvalidateStyle(false);
                }

                self.InvalidateLayout();
                return(true);
            }
            return(false);
        }