Git Product home page Git Product logo

wpf.notifications's People

Contributors

aleksandardev avatar amkuchta avatar deadpikle avatar umutcomlekci 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wpf.notifications's Issues

change progressbar value

hi how i can update my progressbar value?
i have this but i cant update value after that.

.WithOverlay(new ProgressBar
               {
                   VerticalAlignment = VerticalAlignment.Bottom,
                   HorizontalAlignment = HorizontalAlignment.Stretch,
                   Height = 3,
                   BorderThickness = new Thickness(0),
                   Foreground = new SolidColorBrush(Color.FromArgb(128, 255, 255, 255)),
                   Background = Brushes.Transparent,
                   IsIndeterminate = false,
                   IsHitTestVisible = false,
                   Value = 25
               })

API: `DismissDelayed` extension

NotificationMessageBuilder.DismissNotificationMessageButton needs to be refactored to NotificationMessageBuilder.DismissNotificationMessage

Implement following builder methods:

public static NotificationMessageBuilder Delayed(
        this NotificationMessageBuilder.DismissNotificationMessage dismiss,
        long delayMilliseconds,
        Action<INotificationMessage> callback = null)

public static NotificationMessageBuilder Delayed(
        this NotificationMessageBuilder.DismissNotificationMessage dismiss,
        TimeSpan delay,
        Action<INotificationMessage> callback = null)

Delay is required (no default), callback is optional.

Use case:

var builder = this.Manager
    .CreateMessage()
    .Accent("#E0A030")
    .Background("#333")
    .HasBadge("Warn")
    .HasMessage("Failed to retrieve data.")
    .WithButton("Try again", button => { })
    .Dismiss().Delayed(5000);

Should still support Dismiss().WithButton() API for backward-compatibility.

NotificationMessageContainer not initializing with existing messages when new context is set

Reported in #14

Yeah, it's a bug. Since you're doing CreateMessage call from VM constructor, the message container in the view isn't yet bound to the manager.

NotificationMessageContainer only listens for OnMessageQueued and that's not triggered when you give it a manager with message already in queue.

Here after attaching event handlers, ManagerOnOnMessageDismissed should be called for all existing messages and ManagerOnOnMessageQueued for each message from the new manager.

Could this be it? Can you test this by not calling CreateMessage from constructor but for example on view Loaded?

notification dont close

hi i use version 1.4.1 but when i use animate(true) my notification dont close. dissmisWithButton and DissmisWithDelay both not work.
it work if i use animate(false)

Change text color

How can I change the text color?
It's all okay when the colors are darker, but if I want to replace them, white background lets say?

Header foreground not set by SetForeground method call

this.NotificationsManager
      .CreateMessage()
      .Accent("#F19021")
      .Background(SupervisorPalette.Palette.AlternativeColor.ToString())
      .Foreground(SupervisorPalette.Palette.MarkerColor.ToString())
      .Animates(true)
      .AnimationInDuration(0.4)
      .AnimationOutDuration(0.1)
      .HasBadge("Info")
      .HasMessage("Update will be installed on next application restart.")
      .Dismiss().WithButton("Update now", UpdateNowCallback)
      .Dismiss().WithButton("Later", button => { })
      .Queue();

image

notification dont close after click

hi i want after user clicked on button notification close but dont work can you help?

var builder = this.Manager
                 .CreateMessage()
                .Accent(AppVariable.RED)
                .Background(AppVariable.BGBLACK)
                .HasBadge("هشدار")
                .HasHeader(string.Format("آیا برای حذف {1} {0} اطمینان دارید؟", SchoolName, Type))
                .WithButton("بله", button =>
                {
                switch (Type)
                {
                    case "مدرسه":
                        //AddSchool.main.tabc.SelectedIndex = 0;
                        break;

                    case "دانش آموز":
                        AddStudent.main.deleteStudent();
                        break;
                    case "کاربر":
                        //AddStudent.main.tabc.SelectedIndex = 0;
                        break;
                }
                })
                .Dismiss().WithButton("خیر", button => { });
           builder.Queue();

when i click on "بله" button after doing some work notification dont close automaticly

Manager Queue enumeration

Would be great if we could enumerate the manager queue, checking if it contains a specific message and close / get messages by code.

[Enhancement] Icon / Image Area

While the badges are useful, users may also want to include some sort of icon or image alongside or instead of the badge to denote the control's meaning (e.g. an exclamation point instead of "Warning" text). My proposed solution is to include a ContentControl that sits to the left of the badge in an Auto-sixing column that would allow users to insert a graphic (e.g. and icon or perhaps a logged-in user image).

If it's agreed upon, I will mock it up and submit a PR for approval.

Notifications for a dynamically generated UserControl Window

Hello,
I'm currently developing an application that monitors vital data. I want to use your notification to inform users about connection losses from the monitor. The application consists of a MainWindow with UserControls, arranged in a grid. Each one of these UserControl-Windows should receive a NotificationMessageManager in order to have error messages on top of each window.
Unbenannt
Unbenannt1
As you can see it works for one UserControl. My question is if there is a way to get this working for all UserControl-Windows.
As far as I understood I need to somehow dynamically generate NotificationMessageManagers in my MainWindow, as they have to be instantiated there as it seems. The NotificationMessageManagers must then be binded dynamically which can't be in XAML.

I'm really thankful for any advice because I'm pretty new to C# and stuck on this issue for quite a while!
Thanks a lot!

Cannot launch notification from ViewModel

Synopsis

This may be related to #1 , but I am having issues with getting a notification to launch using an MVVM pattern. Relevant code is below; if you'd like to take a look at the application yourself, please feel free to clone from here - if you run into any issues getting the application to start, let me know, you may need to work some magic to get the application to run in Visual Studio.

View (/View/UI/DevWindow.xaml)

...
<!--Namespace/DataContext declaration-->
xmlns:Notifications="clr-namespace:Enterwell.Clients.Wpf.Notifications.Controls;assembly=Enterwell.Clients.Wpf.Notifications"
DataContext="{Binding Main, Source={StaticResource Locator}}"
...
<!--NotificationMessageContainer is placed within a Grid-->
<Notifications:NotificationMessageContainer 
    Background="{DynamicResource WindowBackgroundBrush}"
    Foreground="{DynamicResource LabelTextBrush}"
    Manager="{Binding NotificationMessageManager}" />
...

ViewModel (/ViewModel/MainViewModel.cs)

// Instantiate NotificationMessageManager, which the View is bound to above
public INotificationMessageManager NotificationMessageManager { get; } = new NotificationMessageManager();
...
// Create the message in the constructor
public MainViewModel()
{
    try
    {
        NotificationMessageManager.CreateMessage()
            .Accent("#1751C3")
            .Animates(true)
            .AnimationInDuration(0.75)
            .AnimationOutDuration(2)
            .HasBadge("Info")
            .HasMessage("Please ingest the latest STIG Compilation Library on the settings page.")
            .Dismiss().WithButton("Dismiss", button => { })
            .Queue();
    }
    catch (Exception exception)
    {
        log.Error(string.Format("Unable to instantiate MainViewModel."));
        log.Debug("Exception details:", exception);
    }
}
...

Debugging

Running through a quick debug, NotificationMessageManager is properly instantiated and the message is created and associated to it. Similarly, looking at the visual tree, the NotificationMessageContainer exists, but is empty. Finally, no error messages are generated and logged, and my output window isn't throwing anything concerning this control, so I have nothing to suggest that anything is failing.

Thanks in advance! I love the way this looks, so I am really hoping to be able to utilize the control. However, I am following a strict "no code behind" policy, which I would rather not violate.

Error while installing the package from nuget.

PM> Install-Package Enterwell.Clients.Wpf.Notifications
Installing 'Enterwell.Clients.Wpf.Notifications 1.0.0'.
Successfully installed 'Enterwell.Clients.Wpf.Notifications 1.0.0'.
Adding 'Enterwell.Clients.Wpf.Notifications 1.0.0' to UINotifications.
Uninstalling 'Enterwell.Clients.Wpf.Notifications 1.0.0'.
Successfully uninstalled 'Enterwell.Clients.Wpf.Notifications 1.0.0'.
Install failed. Rolling back...
Install-Package : Could not install package 'Enterwell.Clients.Wpf.Notifications 1.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references
or content files that are compatible with that framework. For more information, contact the package author.
At line:1 char:1

  • Install-Package Enterwell.Clients.Wpf.Notifications
  •   + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
      + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
    

dont work with MVVM

i have a MVVM Project when i use this.DataContext = this;
my MVVM Command not work.
gif

[Enhancement] Additional Content Area

While .WithOverlay(...) allows the use of custom content that overlaps the existing items in the control, adding content onto the bottom of the control becomes significantly more tricky. My recent use case is that I attempted to add a CheckBox to the bottom of the control, and it ended up overlapping the Message to the point of not being readable.

My suggested solution (which I am willing to implement) is to create a RowDefinition at the bottom of the control with Height="Auto" that houses a ContentControl. This would allow users to implement whatever content they like within it via the use of a call such as .WithAdditionalContent(...).

Thoughts?

Make it disapear after n seconds?

Is it possible to make it disappear after n seconds, implement like a small timer instead of just clicking buttons?
Let's say I get a notification and if I don't click it for 5 seconds it automatically disappears...

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.