示例#1
0
        /// <summary>
        /// Create a ScrollContentPresenter.
        /// </summary>
        /// <param name="random"></param>
        /// <returns></returns>
        public override ScrollContentPresenter Create(Core.DeterministicRandom random)
        {
            ScrollContentPresenter scrollContentPresenter = new ScrollContentPresenter();

            ApplyContentPresenterProperties(scrollContentPresenter, random);
            scrollContentPresenter.CanContentScroll      = random.NextBool();
            scrollContentPresenter.CanHorizontallyScroll = random.NextBool();
            scrollContentPresenter.CanVerticallyScroll   = random.NextBool();
            scrollContentPresenter.ScrollOwner           = ScrollOwner;

            return(scrollContentPresenter);
        }
示例#2
0
        public override Binding Create(Core.DeterministicRandom random)
        {
            Binding binding = new Binding();

            binding.Mode = random.NextEnum <BindingMode>();
            binding.UpdateSourceTrigger = random.NextEnum <UpdateSourceTrigger>();
            if (random.NextBool())
            {
                binding.Converter = Converter;
            }

            if (random.NextBool())
            {
                int index = random.Next() % GroupNames.Length;
                binding.BindingGroupName = GroupNames[index];
            }

            if (random.NextBool())
            {
                binding.ValidationRules.Add(Rule);
            }

            return(binding);
        }