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

Create StepBar control #343

Closed
GeertvanHorrik opened this issue Feb 24, 2021 · 5 comments · Fixed by #349
Closed

Create StepBar control #343

GeertvanHorrik opened this issue Feb 24, 2021 · 5 comments · Fixed by #349

Comments

@GeertvanHorrik
Copy link
Member

GeertvanHorrik commented Feb 24, 2021

In Orc.Wizard we have a control named "breadcrumb", but this name is misleading (wrong). We would like to extract it into a separate control in Orc.Controls so we can use it (even without the wizard):

image

image

We want this control to:

  1. Support Orientation (Horizontal / Vertical)
  2. Look similar to the one from Orc.Wizard (by default)

Then we want to have 2 subparts:

StepBar

Should have:

  1. Items (list of BreadcrumbItem / models)
  2. SelectedItem (to control which one is active)

StepBarItem (old breadcrumbitem)

Should have:

  1. Command (so we can enable clicking it if the command is active (executable))
  2. Label
  3. Icon

This way we can change the icon based on the state, etc.

Please think about the API before writing code and discuss any potential issues you are seeing. Note that we want to replace the "breadcrumb" in Orc.Wizard by this control so it should at least contain that functionality.

@GeertvanHorrik
Copy link
Member Author

It's important not to remove the breadcrumb in Orc.Wizard just yet, we need to plan the removal carefully.

@Orcomp
Copy link

Orcomp commented Feb 24, 2021

Just some random thoughts that may or may not be applicable.

Knowing whether a step has been "visited" or not is important.

This would allow us to write some logic along the lines of: You can't click on step 5 unless step 2 and 3 have been visited.

Actually, we might need another state of "completed". It is one thing to "visit" a step, and another to "complete" it satisfactorily.

It also means that we can prevent users from re-visiting (or visiting for the first time) earlier steps if they have already completed a subsequent step.

For example we have 5 steps. We allow them to visit and complete step 3 first. But once that is done we can add logic in our apps that a user can no longer visit steps 1 and 2.

All I am trying to do is figure out the minimum "statuses" we need in the API to enable us to write all the logic we need in our apps.

In summary I think "IsVisited" and "IsCompleted" are important. ("IsClickable" should be taken care of by the command)

We can then use different icons for different step states.

@GeertvanHorrik
Copy link
Member Author

The stepbar is "just a bar representing some state". Note that it's not for managing navigation state, that is done by the wizard (and yes, these items you mention will be possible).

The wizard page has an IsVisited page so this is taken care off. The step bar is similar to a progress bar without any actual logic (e.g. the progress bar is not responsible for actually downloading anything).

@kote2ster
Copy link
Contributor

kote2ster commented Mar 15, 2021

Hello, I am almost done with this task, before the PR I would like to discuss some things about this control.

I have created a HorizontalNavigationStepBarView, and a SideNavigationStepBarView with VMs (HorizontalNavigationStepBarViewModel, SideNavigationStepBarViewModel) in the Orc.Controls.Example project to demonstrate the control's usage. In these there is a StepBar control and two buttons for manual navigation. I have also created an example AgeExampleItem model, which can be registered as an item for the StepBar control. New items can be easily created with the StepBarItemBase model and IStepBarItem interface (like in the wizard project). I don't really know if this is the right way for doing this.

The StepBar control works like the one in the Wizard project, it has StepBarItems with orientation support. Based on the orientation some layout control needs to be changed in the StepBarItemViewModel, this command is called on the Loaded event. The round "ellipse" visual items can now be replaced with an uri which points to a local file. I'm also not sure if this is what you were looking for. 😃

Should I create a PR for concretising things?

Thanks.

@kote2ster kote2ster mentioned this issue Mar 16, 2021
5 tasks
@GeertvanHorrik
Copy link
Member Author

We don't want to work with local files, etc. I'll review the PR and let you know.

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

Successfully merging a pull request may close this issue.

3 participants