Giter Site home page Giter Site logo

orc.wizard's Introduction

Orc.Wizard

Name Badge
Chat Join the chat at https://gitter.im/WildGums/Orc.Wizard
Downloads NuGet downloads
Stable version Version
Unstable version Pre-release version

Easily create beautifully looking wizards for WPF using MVVM.

For documentation, please visit the documentation portal

orc.wizard's People

Contributors

averus-a avatar ceo1647 avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar dmitry-vf avatar geertvanhorrik avatar github-actions[bot] avatar herzbube avatar hubo0831 avatar johncbaur avatar kote2ster avatar michu avatar mkhomutov avatar zycnde1908 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

orc.wizard's Issues

Raising the Resumed event required for closing the wizard

Summary

Since the introduction of the Resumed event it is necessary for all classes derived from WizardBase to call base.ResumeAsync() in order to close the wizard (saving all pages & raising the event). This makes it impossible (short of re-implementing IWizard) to modify the Save behavior- e.g. calling unitOfWork.Save() after the page-save iteration (and aborting in case of failure).

API Changes

Move the pages-save iteration back to the SaveAsync method (which is currently marked as obsolete) and have the ResumeAsync method call it, allowing the user to override the page-save iteration subroutine, before raising the Resumed event (unless of course an exception is thrown by the SaveAsync method).

Intended Use Case

I have already created my own WizardBaseEx (introducing an additional PagesUpdated event)- so the proposed modification would not affect me- but I feel like it might be useful to others.. Here are a few use cases that come to mind (i.e. ways of modifying the save-behavior):

  1. Wrapping the save operation in a unit of work (assuming each page holds its own repository)
  2. Have the pages update the in-memory model-object (something like UpdateExplicitViewModelToModelMappings) and then have it send over to the persistence layer (aborting on failure)
  3. Add progress update: something like _pleaseWaitService.UpdateStatus(currentPage++, nbPages)

Consider making the space between the bubbles in the navigation pane autosize

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Summary

My wizard has 8 pages but the height of my wizard is 600 pixels. It looks like the space between the side by side navigation bubbles are fixed in the XAML. I am wondering if the distance between the bubbles could be made a property in the view model and then perhaps defaulted by generally dividing the height of the wizard by the number of bubbles.

API Changes

There are two values in the XAML that need to adjusted. The Grid margin and the Height of the rectangle used to draw the navigation bubbles.

Intended Use Case

This should allow for wizards with more pages without having the navigation pane extend past the window or introduce scrollbars.

WizardWindow derives from a XAML generated class, cannot be main window

Steps to reproduce

  1. Create a new Catel project
  2. Add Orc.Wizard as a reference, and its dependencies
  3. Modify MainWindow.XAML to be a Orc.Wizard.View.WizardWindow instead of a Window
  4. Try to generate

Platform:
.NET version: 4.0

Expected behaviour

Having a WizardWindow as the main window for the program.

Actual behaviour

The program cannot compile, producing an error reading " 'Orc.Wizard.Views.WizardWindow' cannot be the root of a XAML file because it was defined using XAML ".
See also: https://support.microsoft.com/en-us/help/957231/wpf-build-error-mc6017-when-you-define-a-class-that-derives-from-a-xam

Dependency on Catel

Your control looks great, but it depends on Catel, which is bad.
I mean, there are other MVVM frameworks and turns out each project uses a different one, for example, I'm using Caliburn.Micro.

It would be great if your lib drop this dependency and let the users choose which MVVM framework fits best.

ViewModel warnings aren't shown

When adding a business rule/field warning to a ViewModel, it is not displayed in any way in the wizard, if there are no business rule/field errors. As an example, a field error would mark the field red and display an errors-and-warnings status bar at the top of the page.

Handling of the field warning is as follows:

internal class MyWizardPageViewModel : WizardPageViewModelBase<MyWizardPage>
{
    public MyWizardPageViewModel(MyWizardPage wizardPage) : base(wizardPage)
    {
    }

    [ViewModelToModel]
    [Range(ushort.MinValue, ushort.MaxValue, ErrorMessageResourceName = nameof(Resources.field_value_out_of_range_validation_error_message), ErrorMessageResourceType = typeof(Resources))]
    public string Port { get; set; }

    protected override void ValidateFields(List<IFieldValidationResult> validationResults)
    {
        System.ComponentModel.DataAnnotations.ValidationResult localPortIsAvailable = NetworkRelatedFieldValidation.LocalPortIsAvailable(Port, new System.ComponentModel.DataAnnotations.ValidationContext(this));

        if (localPortIsAvailable != System.ComponentModel.DataAnnotations.ValidationResult.Success)
        {
            validationResults.Add(FieldValidationResult.CreateWarning(() => Port, "Oh NO!!!"));
        }
    }
}

Add quick navigation to step bar wizard header

image

We need to add support for "quick navigation" via the step bar wizard header. Note that this is only possible when the pages are optional or free navigation is allowed.

The example app has some options to specify whether navigation to the end is immediately available. If so, we should make the step bar header items clickable so users can directly navigate to a specific page.

Currently users can only navigate forward / backward using the previous / next buttons. In "free navigation mode", we want users to be able to navigate to a specific page directly.

Next/Previous buttons

Hi. Not really an issue, more a question on how to disable the next button until an asynchrous task has finished within a wizard page?

I have a task in a WizardPageBase that goes to a server for some data, initiated in the constructor as that it should be ready when the user gets to that page (2nd page). However if it hasn't responded in time, then the next button should be disabled, and then when the task is finished and the page is valid, should the button enable.

Or is there a better way of doing this?

Recommend LoadAssembliesOnStartup.Fody in README

In Visual Studio, create a new WPF Application project that does not use LoadAssembliesOnStartup.Fody. Somewhere in the code of the new project, try to resolve IWizardService with the following code snippet:

Type wizardServiceType = typeof(Orc.Wizard.IWizardService);
object wizardService = serviceLocator.ResolveType(wizardServiceType) as Orc.Wizard.IWizardService;

This will fail with a TypeNotRegisteredException. To an experienced Catel developer the reason might be obvious. As a newbie, however, the failure is completely mystifying. After delving deeper into the source code of Orc.Wizard, and then later Catel.Core and Catel.MVVM, the reason becomes clear:

Orc.Wizard.WizardService cannot be instantiated by the service locator because the WizardService constructor requires an IUIVisualizerService object, which the service locator is unable to provide because that service has never been registered.

After the inexperienced Catel newbie adds LoadAssembliesOnStartup.Fody to the project, everything works fine, because the Fody add-in triggers the module initializer in Catel.MVVM, which causes ViewModelServiceHelper.RegisterDefaultViewModelServices() to be called, which in turn registers IUIVisualizerService with the service locator. Neat.

To lower the entry bar for Catel newbies, I suggest that the README is enhanced with instructions to make sure that LoadAssembliesOnStartup.Fody is used. If generous, an explanation might be added so that the intelligent developer learns why he has to do this.

No taskbar icon for an Orc.Wizard application

When running the wizard, there is no taskbar icon for the application. The only way to bring the wizard window to background, once you switched to another window, is with Alt+Tab. How can I add a taskbar icon too?

Below is the code in App.xaml.cs that instantiates and displays the wizard

public partial class App : Application
{
    protected override void OnStartup(StartupEventArgs e)
    {
        ILanguageService languageService = ServiceLocator.Default.ResolveType<ILanguageService>();
        IWizardService wizardService = ServiceLocator.Default.ResolveType<IWizardService>();

        languageService.PreferredCulture = languageService.FallbackCulture = new CultureInfo("en-US");

        base.OnStartup(e);

        StyleHelper.CreateStyleForwardersForDefaultStyles();
        wizardService.ShowWizardAsync<InstallerWizard>();
    }
}

Show wizard with an existing object

Hi, I have a question on how to display a wizard with an existing model object.
It's really great if the Orc.Wizard.Example.NET40 example project includes saving as well as loading an existed model. Thanks!

Alt+F4 calls WizardPageViewModelBase.CancelAsync

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • WPF
  • UWP
  • iOS
  • Android
  • .NET Standard
  • .NET Core

Component

WizardWindow / WizardViewModel

Version of Library

4.2.0 / 4.3.0

Version of OS(s) listed above with issue

win10

Steps to Reproduce

  1. Override the CancelAsync method on any WizardPageViewModel (e.g. SkillsPageViewModel)
  2. Navigate to the target page and press Alt + F4

Expected Behavior

The behavior is identical to the one used for the CancelCommand- that is the WizardPageViewModel.CancelAsync is only called after the user confirms the cancellation (by default).

Actual Behavior

The CancelAsync on the WizardPageViewModel is called before the confirmation dialog is displayed (from the respective CancelAsync method on the WizardViewModel).

wizard with model don`t work

in MyExampleWizard i add new constructor
public MyExampleWizard(ITypeFactory typeFactory, MyModel model)
: base(typeFactory)

I try create wizard with model, but i can`t.
_wizardService.ShowWizardAsync(model);

"Argument 'wizard' cannot be null"

Add TopMost and WindowStartupLocation properties to WizardBase

Summary

Add TopMost and WindowStartupLocation properties to WizardBase;

API Changes

TopMost boolean
WindowStartupLocation see System.Windows.WindowStartupLocation

Intended Use Case

The use case is to make the wizard window as easy to use as possbile for novice users that have trouble locating windows and managing them.

Allow to customize the target for Next / Previous

Currently Orc.Wizard is designed so that the user must step through all wizard pages in a sequential manner. There are use cases, however, that require a more flexible approach, e.g. skip one or more wizard pages based on the user's answers from a previous page. Unless I have overlooked something, this is currently not possible in Orc.Wizard.

This is a feature request to extend Orc.Wizard so that it allows the client code to customize the target for the Next / Previous buttons.

Example Next button is not visible

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • WPF
  • UWP
  • iOS
  • Android
  • .NET Standard
  • .NET Core

Component

What component is this issue occurring in?
Orc.Wizard

Version of Library

4.7.0 ? - I downloaded the source code on 2/13/22.

Version of OS(s) listed above with issue

Windows 10

Steps to Reproduce

  1. Rebuild solution using VS2022
  2. Set Example as Startup Project
  3. Run Example, and select to display Wizard button

Expected Behavior

I expected to see a Wizard with a Next button.

Actual Behavior

The Next button is not displayed.
I am wondering if this is something specific to VS2022 or if this example has not been updated based on enhancements to the design. I am not confident I can apply these classes to my application if I don't have something working to pattern it after.
As a side note there was one compile error complaining that IDispose wasn't being properly handled. I added a using block to fix this.

Your .dependabot/config.yml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yml:

The property '#/update_configs/0/automerged_updates/0' of type object did not match one or more of the required schemas
The property '#/update_configs/0/automerged_updates/1' of type object did not match one or more of the required schemas
The property '#/update_configs/0/automerged_updates/2' of type object did not match one or more of the required schemas
The property '#/update_configs/0/automerged_updates/3' of type object did not match one or more of the required schemas

Please update the config file to conform with Dependabot's specification.

You can mention @dependabot in the comments below to contact the Dependabot team.

Wizard navigation step indicator does not update

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • WPF
  • UWP
  • iOS
  • Android
  • .NET Standard
  • .NET Core

Component

Orc.Wizard

Version of Library

4.8.2

Version of OS(s) listed above with issue

Windows10 21H1 Build 19043.1889

Steps to Reproduce

  1. Display the wizard
  2. User makes a selection in a wizard page then an extra page needs to be added
  3. Add the page using AddPage()
  4. The page is added but the top navigation step indicator does not update.

Expected Behavior

  1. The wizard should update the navigation step indicator

Actual Behavior

The step indicator is not updated
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.