Click here to Skip to main content
12,451,243 members (51,066 online)
Click here to Skip to main content

Stats

63.3K views
4K downloads
86 bookmarked
Posted

Silverlight Menu4U

, 14 Aug 2011 CPOL
A new Silverlight menu with styling and templating.
Menu4UDemo
Assets
Images
Arrow.png
BlackArrow.png
Bob.png
Checked.png
Dumbledore.jpg
Harry.jpg
Hermione.png
Hogwarts.png
Menu4U.png
Minerva.jpg
mnuAddClass.png
mnuAddExistingItem.png
mnuAddNewDataSource.png
mnuAddNewItem.png
mnuBuildSilverlightMenu.png
mnuCallStack.png
mnuCloseAllDocuments.png
mnuCloseSolution.png
mnuCommentSelection.png
mnuConnecttoDatabase.png
mnuCopy.png
mnuCut.png
mnuDatabaseExplorer.png
mnuDelete.png
mnuErrorList.png
mnuExtensionManager.png
mnuFindResults1.png
mnuFormatDocument.png
mnuFullScreen.png
mnuImmediate.png
mnuInsertSnippet.png
mnuLocals.png
mnuManageHelpSettings.png
mnuMSDNForums.png
mnuNewFile.png
mnuNewHorizontalTabGroup.png
mnuNewProject.png
mnuNewVerticalTabGroup.png
mnuNewWebSite.png
mnuNewWindow.png
mnuOpenFile.png
mnuOpenProject.png
mnuOpenWebSite.png
mnuOutput.png
mnuPageSetup.png
mnuPaste.png
mnuPrint.png
mnuPropertiesWindow.png
mnuPropertyPages.png
mnuQuickFind.png
mnuQuickReplace.png
mnuRedo.png
mnuSave.png
mnuSaveAll.png
mnuShowDataSources.png
mnuSilverlightMenuProperties.png
mnuSolutionExplorer.png
mnuSplit.png
mnuStartDebugging.png
mnuStartPage.png
mnuStepInto.png
mnuStepOver.png
mnuTechnicalSupport.png
mnuToolbox.png
mnuUncommentSelection.png
mnuUndo.png
mnuViewHelp.png
mnuWebBrowser.png
Ron.png
Scroll.png
ScrollBody.png
ScrollBottom.png
ScrollTop.png
Separator.png
Silverlight.jpg
Snape.jpg
WhiteArrow.png
Menu4UDemo.csproj.user
Menu4UDemo.suo
Properties
Views
Menu4UDemo.Web
Images
Silverlight.jpg
Menu4UDemo.Web.csproj.user
Properties
Silverlight.Controls
Converters
Properties
Silverlight.Controls.csproj.user
Themes
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Globalization;
using System.Windows.Data;

namespace Silverlight.Controls.Converters
{
    public sealed class BooleanToCollapsedConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return Visibility.Visible;
            }
            else
            {
                var val = System.Convert.ToBoolean(value, CultureInfo.InvariantCulture);

                if (val)
                {
                    return Visibility.Collapsed;
                }
                else
                {
                    return Visibility.Visible;
                }
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author


You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160826.1 | Last Updated 14 Aug 2011
Article Copyright 2011 by Marcelo Ricardo de Oliveira
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid