Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6988271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:03:27+00:00 2026-05-27T19:03:27+00:00

I am trying to do things the .net way and declare my menu items

  • 0

I am trying to do things the .net way and declare my menu items for my context menu like a good citizen in xaml :).

I have a listbox that contains a bunch of list items based of ItemsSource.

QUESTION: How can I dynamically set the visibility of a particular menu item based off a function to be defined in the Page class?

I could just data bind this to a property in my DataContext class, but there are a few things that are more ui-specific that it really should not know about, so I’d like to keep it clean.

Can I somehow bind the visibility to a function in the page class and pass it the data context and have it return the appropriate visibility value required? Or is there another way?

Thanks!
swine

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:03:28+00:00Added an answer on May 27, 2026 at 7:03 pm

    Bindings are useful because the UI updates whenever the bound value changes. Since a function doesn’t update, even if you could bind to a function, the UI would never change. The UI would also never know when to call the bound function.

    Why don’t you just bind to a bool DataProperty and then use the function to update the bool. If you explain more of what you are trying to do, then I can give you a more detailed solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm fairly new to ASP.NET and trying to learn how things are done. I
I am trying to make an ASP.NET MVC 3 app in which I have
I'm trying to do the following: We have an outlook plugin, written in .NET
I'm trying to work out the best way to assemble the navigation menu of
hey there - I'm trying to use asp.net mvc for some things as usual,
I'm trying to make a Windows app that checks some things in the background,
I'm trying to do things the DDD (domain driven design) way. And boy do
I have a .net based asmx service and I trying to find out details
I am trying to develop a .NET 3.5 service application that uses: WCF for
I'm using VB.net so keep that in mind. I'm trying to create a program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.