Git Product home page Git Product logo

flashmessage's Introduction

WPF FlashMessage

This is custom control that provides a way to alert users whether an operation was successfully completed or not. Why use MessageBox when you have the powerfull WPF in your hands?

The Motivation

Aren't you tired of all the MessageBoxes on your applications? Isn't there a better way to alert users whether an operation was successfully completed? For years I used MessageBox or a static label in WinForms applications, and they came with me when I started to migrate to WPF.

However, WPF is so much more powerfull than that, and I thought why not create something different? Because let's face it, using MessageBox is like using javascript alert function in a web page, don't you think?. So it is settle, we need something new, but what? Well, once I was a [Rails] (http://rubyonrails.org/) developer and Rails has a interesting [flash message system] (http://guides.rubyonrails.org/action_controller_overview.html#the-flash), so I thought of creating a control that acts slightly similar.

How does it work?

So, let's see how the control works. It has two mainly properties: MessageType and Message.

MessageType whether a Error, Success or Notice. These influence which style the control uses.

Message it's the message itself. As soon as this property is changed, the FlashMessage fades in automatically.

FadesOutAutomatically besides clicking on the close button, you can configure whether it fades out automatically.

FadeOutTime it specifies how much time the FlashMessage waits to fades out after it fades in;

A Glimpse

Glimpse

Usage

Add a reference of FlashMessage.dll to your project.

Add the namespace to your Window:

xmlns:flash="clr-namespace:FlashMessage;assembly=FlashMessage"

Add the control wherever you like:

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="27"/>
    </Grid.RowDefinitions>

    <flash:FlashMessage Grid.Row="0" Grid.Column="0" Message="Successfully saved." MessageType="Success"/>

    <!--Others controls-->
</Grid>

flashmessage's People

Contributors

jobadiniz avatar

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.