Skip to content
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

Fix samples UI (StackPanels usage) #361

Open
xperiandri opened this issue Mar 6, 2021 · 21 comments
Open

Fix samples UI (StackPanels usage) #361

xperiandri opened this issue Mar 6, 2021 · 21 comments

Comments

@xperiandri
Copy link

Usage of StackPanels in samples causes a lot of layout and render issues like disabled UI virtualization in ListView.
On the Android emulator, I thought that the app hang but it was rendering 1000 items twice 😂

If you are fine with what I did in https://github.com/xperiandri/Elmish.Uno/tree/uno/src/Samples/Samples.Shared I can backport that

@TysonMN
Copy link
Member

TysonMN commented Mar 6, 2021

Hello @xperiandri. Thanks for creating all these issues! :)

Yes, StackPanel can be a bit restrictive like that sometimes. Feel free to with something that makes the UI look or function better (as long as for XAML is still "simple").

@xperiandri
Copy link
Author

If you agree to consolidate all samples in a single project it would be simpler for me

@xperiandri
Copy link
Author

@TysonMN do you confirm that I can merge all samples into a single project and apply layout fixes?

@TysonMN
Copy link
Member

TysonMN commented Mar 8, 2021

I would like to try your samples first. How can I do that? Maybe you could update your README with instructions on how that is done.

@xperiandri
Copy link
Author

Just clone and run UWP app. If Visual Studio asks to install components let it install.
For UWP you need Window 10 of 2019 year or newer and Visual Studio 16.7+ I suppose
For Android just Xamarin workload and creating and Android emulator

@xperiandri
Copy link
Author

Navigation may not work on Android. As far as I remember there is an issue with NavigateToPageAction

@TysonMN
Copy link
Member

TysonMN commented Mar 8, 2021

What do you mean by "UWP app"? There is no project with that name. Can you adjust your solution file so that the project you typically want people to execute is listed first?

@xperiandri
Copy link
Author

OK, I'll update

@xperiandri
Copy link
Author

This one
image

@TysonMN
Copy link
Member

TysonMN commented Mar 9, 2021

Yes, this is nice. It reminds me of the WPF demo for Material Design in XAML.

What do you think @cmeeren? Can @xperiandri combine the samples into one executable?

I want the SingleCounter sample to remain separate. Then the combined sample can be about the different binding types.

@cmeeren
Copy link
Member

cmeeren commented Mar 9, 2021

Can @xperiandri combine the samples into one executable?

I haven't given this much thought yet, but this doesn't strike me as a good idea. Each sample consists of views and domain code, and is an easy-to-understand "vertical slice", so to speak. This makes it easy to get an overview of what this specific sample contains, from entry point to views, and makes it easy to test and experiment with. IMHO this becomes a lot harder, particularly for beginners, if the samples are merged (like in the MaterialDesignInXamlToolkit demo, which I found quite dizzying when trying to understand it).

Separate samples are also better for dependencies. We don't have to pollute all samples with dependencies on the behaviors nuget, etc.

I think the samples should stay separate, but I'm open to hearing good reasons to merge.

Also note that my capacity is very limited at the moment, so please help me help you by being completely clear about what exactly is being proposed.

@xperiandri
Copy link
Author

They are separate. Just in a single project. Look at my solution

@cmeeren
Copy link
Member

cmeeren commented Mar 9, 2021

But each sample consists of two projetcs; one for the domain code and one for the views. There is no way around this. So with your suggestion then we'd need one project for all domain code, and one project for all views. We take vertical slices and "zip" them together horizontally on different vertical levels. This still has the drawbacks I mentioned above.

@xperiandri
Copy link
Author

How do developers consume your samples in your opinion?

@xperiandri
Copy link
Author

xperiandri commented Mar 9, 2021

For me, it was very inconvenient to use samples because I have to run different apps which can take up to a minute on a real iOS device from pressing F5 till it appears on the screen.
And I have never needed the whole app, just to see an approach and grab some code.

@TysonMN
Copy link
Member

TysonMN commented Mar 9, 2021

I think it might be possible to do both:

  1. Two projects for each sample
  2. Two additional projects that combine all the samples into one executable.

@cmeeren
Copy link
Member

cmeeren commented Mar 9, 2021

How do developers consume your samples in your opinion?

Each sample demonstrates one thing. As a dev, I want to know what makes a particular sample tick. I think that insight is a lot easier to gain when I know exactly what code makes up the particular thing I am interested in - namely, all the code in the relevant project(s) (with all the code being fairly relevant).

And I have never needed the whole app, just to see an approach and grab some code.

Given this, may I ask why are you interested in running the samples, instead of just looking at the code? And, in particular, why you are interested in running multiple samples (which, as I understand it, is what's causing headaches for you, since the startup time is too long)?

I think it might be possible to do both:

  1. Two projects for each sample
  2. Two additional projects that combine all the samples into one executable.

I think I can live with this.

Note that I don't mean to put my foot down. If, given my arguments, both of you (particularly @TysonMN since he knows the library well) still think merging the samples are the best option, I'm willing to listen.

@TysonMN
Copy link
Member

TysonMN commented Mar 10, 2021

I don't feel strongly either way, but I am inclined to agree with @xperiandri since he wants to make other improvements as well.

@cmeeren
Copy link
Member

cmeeren commented Mar 11, 2021

I have changed my mind.

I still stand by my reasoning, but I realize that since I am not actively using Elmish.WPF, nor have been for some time, the reasoning may be flawed in ways that are hard for me to see.

I will trust @TysonMN's judgement in this matter. I am also unsubscribing from this issue. Feel free to ping me if you want opinion on something.

@TysonMN
Copy link
Member

TysonMN commented Mar 12, 2021

Ok @xperiandri, let's move ahead with this.

I am think it would be good to keep SingleCounter as is. Then you could create project called BindingsDemo and BindingsDemo.Core (since I think usings Bindings instead of BindingsDemo could cause naming issues). That demo have a screen for each type of binding.

As a step in that direction, you could start with something similar to what you did in your repository.

@TysonMN
Copy link
Member

TysonMN commented Aug 14, 2021

I created a sample called Capabilities that should eventually contain most (but not all) of the existing samples. The Single Counter sample will remain separate. I want this combined sample to have more of a use-case driven approach instead of a feature driven approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants