Ejemplo n.º 1
0
        public void Edit()
        {
            var user = ElementList.Where(row => row.IsSelected).FirstOrDefault();

            if (user != null)
            {
                EventAggregator.Publish(new ActivateScreenEvent(
                                            EditUserViewModel.CreateViewModel(user.Id, DbConversation, EventAggregator)));
            }
        }
Ejemplo n.º 2
0
        private int PreRenderChildren(IRenderData renderData)
        {
            var maxPageCount     = 1;
            var elementsToRender = ElementList.Where(x => x is MultiPageAreaElement || x is MultiPageElement);

            var stackTop = new UnitValue();

            foreach (var element in elementsToRender)
            {
                var resetLocation = false;
                if (Stack == StackMethod.Vertical)
                {
                    if (element.Top == null)
                    {
                        resetLocation = true;
                        element.Top   = stackTop;
                    }
                }

                int pageCount;
                if (element is MultiPageAreaElement)
                {
                    pageCount = ((MultiPageAreaElement)element).PreRender(renderData);
                }
                else if (element is MultiPageElement)
                {
                    pageCount = ((MultiPageElement)element).PreRender(renderData);
                }
                else
                {
                    throw new ArgumentOutOfRangeException(string.Format("Unknown type {0}.", element.GetType()));
                }

                stackTop = new UnitValue(stackTop.Value + renderData.ElementBounds.Height, stackTop.Unit);

                if (resetLocation)
                {
                    element.Top = null;
                }

                if (pageCount > maxPageCount)
                {
                    maxPageCount = pageCount;
                }
            }

            return(maxPageCount);
        }