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

Notification counter MetroWindow.RightWindowCommands #1804

Closed
JobaDiniz opened this issue Feb 16, 2015 · 9 comments
Closed

Notification counter MetroWindow.RightWindowCommands #1804

JobaDiniz opened this issue Feb 16, 2015 · 9 comments

Comments

@JobaDiniz
Copy link

Hi, I've added a toggle button that act like a notification center (much like facebook) in RightWindowCommands:

capture

But now I want to show how many notifications are unread... I'd like to show in the top right corner of the "globe" button. Any ideas?

@bigworld12
Copy link
Contributor

yes there is an easy idea
1 - get how many notifications
2 - name the "image" control of the "globe" button any name : like globeImg
3 -you have two ways
3-1 create a new image and write text to it
3-2 adding a textblock ABOVE the image and write how many notifications you want using codebehind

@JobaDiniz
Copy link
Author

Sorry for not being specific. I want ideas of how to implement the UI part. Code behind I already implemented hehe.

Here is the current code (I use icons, not image):

<ToggleButton>
  <Rectangle Fill="White">
        <Rectangle.OpacityMask>
            <VisualBrush Visual="{StaticResource appbar_globe}" Stretch="Fill" />
        </Rectangle.OpacityMask>
    </Rectangle>
</ToggleButton>

I'll try the TextBlock suggestion. Thanks.

@ghost
Copy link

ghost commented Feb 20, 2015

Hello @JobaDiniz,

My notification badge design uses a combination of the vector bell with two borders that have a corner radius of 50 to give this appearance. I have a centered TextBlock inside the second border bound to the unread notification count.

notification_bell_design

I hope this helps.

@JobaDiniz
Copy link
Author

This icon is what I wanted hehe... I even opened a suggestion issue (Templarian/WindowsIcons#208) for it.

Your vector is really nice, however, if I understood right, when there is no notification, the red circle will be shown with "0" inside it. That's not what I want.

Thanks for sharing, though 👍

@ghost
Copy link

ghost commented Feb 20, 2015

Thank you for the kind words. Actually no, when there are no unread notifications, a visibility binding causes the borders to go away, leaving only the bell.

@JobaDiniz
Copy link
Author

Awesome. Would you mind to share code?

@ghost
Copy link

ghost commented Feb 20, 2015

Absolutely, I'll pull it out of my project to post an isolated example and share the link here.

@ghost
Copy link

ghost commented Feb 20, 2015

I've created a repository for you to check out here. I hope this helps :)

@JobaDiniz
Copy link
Author

thanks! I'll check it out later

On Fri Feb 20 2015 at 12:55:51 PM Justin Horner notifications@github.com
wrote:

I've created a repository for you to check out here
https://github.com/justinhhorner/wpf-notificationbadge. I hope this
helps :)


Reply to this email directly or view it on GitHub
#1804 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants