Coder Social home page Coder Social logo

schdck / simpledialogs Goto Github PK

View Code? Open in Web Editor NEW
27.0 3.0 1.0 2.5 MB

:speech_balloon: A simple framework to help displaying dialogs on a WPF app

License: MIT License

C# 100.00%
wpf dialogs dialog message messages c-sharp netframework net-framework ui xaml

simpledialogs's People

Contributors

schdck 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

Watchers

 avatar  avatar  avatar

Forkers

punker76

simpledialogs's Issues

Dialog not showing when the first DialogContainer is not yet created

When trying to show a dialog before the first DialogContainer is created, there's no one subscribed to DialogManager, so it sillently fails (no exception is thrown, because it is configured to just return null).

I think this behavior is very confusing and should be changed. Right now, I think the possibilities are:

  • Option A: Throw an exception instead of just returning null (this could be usefull when the user forgot to create a DialogContainer, but would make the process of showing a dialog before the window was created very painful¹)
  • Option B: Add the shown dialog to the Stack and display it as soon as someone subscribe

In case we choose Option B, something to keep in mind is: what Task to return from ShowDialogAsync/ShowDialogForResult? Since the Stack is implemented on the DialogContainer and there's none, another Stack would need to be implemented on the DialogManager.

¹ Imagine a scenario where the application loads some data on startup and it fails. So you catch the exception and try to display a dialog with it, but your window is not yet initialized (because your application is just starting up). As I see, if we were to thrown an Exception, user would need to either move the load data code to after the Window is initialized and the DialogContainer is created (which can be good sometimes, but is not something I want to force on users) or just show the dialog after the DialogContainer is created (which is almost the same thing as Option A, but done in the the end-user code instead of here)

Better MVVM compatibility

Since the BaseDialog is an WPF component, it would be nice if there was a way of launching a dialog from a ViewModel without referencing it directly.

This way the user would not be bothered by having to call the BaseDialog() constructor from a STA thread, etc.

Wildcard character for Password input ?

Hi,

Well done for your awesome work !
Is there a way or input property to set wildcard character when typing password on the input dialog ?

Best regards,
Clem

Drop support for ContentControl & Panel as DialogContainer

I realised (and am very disappointed with myself for not doing so earlier) that getting the content out of the ContentControl and adding it to a brand-new Grid (or even another ContentControl) is not a really good idea and can cause a lot of unwanted behavior (think of e.g. ContentTemplate property) and the cost-benefit of implementing something to prevent such behaviors is not worth it. The same applies to adding a child to an Panel that is not a Grid without any row or column definitions.

I am not sure yet, but I think the best move is to create a control to host the dialogs.. So that's probably what's going to happen by the next release.

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.