-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Views to expose "Design Time" default data? #3522
Comments
I wanted Slider to work in AllViewsTester so I made setting Feel free to undo this, but I'd live ideas on how to make AllViewsTester support causing Views to be "useful/visible" without having custom logic per-view. I did the same thing to |
Hmn, I don't think In general I think properties are not the place for non deterministic behaviours. Consider the following example: [Test]
public void TestTextSliderString()
{
var s1 = new Slider<string>();
var s2 = new Slider<string>();
s2.Text = "I've got a lovely bunch of coconuts, here they are sitting in a row!";
// This line does not do what it looks like
s1.Text = s2.Text;
TestContext.Out.WriteLine("Options:" + s1.Options.Count); //2
TestContext.Out.WriteLine("Options:" + s2.Options.Count); //6!
ClassicAssert.IsTrue(s1.Options.Count == s2.Options.Count );
} |
I think the Edit: |
Fixes #3522. Adds `IDesignable`: Ability for Views to load design-time/demo data
By default, many Views have no good visual representation unless set with "data". E.g.
ListView
,RadioGroup
, andSlider
.This Issue is to come up with a design and implementation that allows a "designer" (TGD) or "tester" (AllViewsTester/Unit Tests) component to say to a View "Hey, go into a good demo mode".
My current (probably lame) thinking is we'd do this by defining an interface that a View that supports such a thing could implement:
Background
Slider<> is doing strange things when setting it's
Text
property.Text
should be completely independent fromOptions
.It seems
Text
setter is putting data intoOptions
. This is problematic for many reasons. It happens also with the<int>
generic. Notice how if you reverse the properties it will have different result.The text was updated successfully, but these errors were encountered: