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 8198415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:56:48+00:00 2026-06-07T05:56:48+00:00

I have created a class like public class ContextMenuSetting { public bool ContextMenuAllowed {

  • 0

I have created a class like

public class ContextMenuSetting {
    public bool ContextMenuAllowed { get; set; }
    public string GridKey { get; set; }
}

And a AttachedProperty like:

public static readonly DependencyProperty ContextMenuSettingsProperty = DependencyProperty.RegisterAttached("ContextMenuSettings", typeof(ContextMenuSetting), typeof(BarItemLink), null);

public static void SetContextMenuSettings(this BarItemLink target, ContextMenuSetting contextMenuSetting) {
    target.SetValue(ContextMenuSettingsProperty, contextMenuSetting);
}

public static ContextMenuSetting GetContextMenuSettings(this DependencyObject target) {
    return (ContextMenuSetting)target.GetValue(ContextMenuSettingsProperty);
}

I have now the following use of BarItemLink in xaml:

<dxb:BarItemLink BarItemName="newActivity"  />

Can somebody help me, how I can set now a Value for the AttachedProperty ContextMenuSettings for BarButtonLink?

edit – update solution:

With Charleh’s help, i have found the solution:

<dxb:BarItemLink BarItemName="newActivity">
   <pcce:BarItemLinkExtensions.ContextMenuSettings >
       <pcce:ContextMenuSettings ContextMenuAllowed="True" GridKey="hallo"/>
   </pcce:BarItemLinkExtensions.ContextMenuSettings>
</dxb:BarItemLink>
  • 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-06-07T05:56:49+00:00Added an answer on June 7, 2026 at 5:56 am

    Have you included the ContextMenuSetting classes namespace in the XAML?

    xmlns:ctxmenu="SomeNameSpace"
    
    <dxb:BarItemLink BarItemName="blah" ctxmenu:ContextMenuSetting.ContextMenuSettings="blah" />
    

    Edit: if you want to set a custom type you can use either a TypeConverter (if you want to enter a string value) or use the extended syntax

    <dxb:BarItemLink BarItemName="blah">
       <ctxMenu:ContextMenuSetting.ContextMenuSettings SomeProperty="SomeValue" />
    </dxb:BarItemLink>
    

    Or TypeConverter if you want to do this:

    <dxb:BarItemLink BarItemName="blah" ctxmenu:ContextMenuSetting.ContextMenuSettings="blah" />
    

    Which will interpret the string value “blah” and use a TypeConverter to create the proper type in code

    http://msdn.microsoft.com/en-us/library/aa970913.aspx

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

Sidebar

Related Questions

I have created my own Attached Property like this: public static class LabelExtension {
Say I have a structure like: class SomeObject Public Name as String Public Created
I have a db that is created like this... public class DataBaseManager extends SQLiteOpenHelper{
I have created an OrderFormViewModel which looks something like public class OrderFormViewModel { public
I have created a type like this: TypeBuilder tb = moduleBuilder.DefineType(myname, TypeAttributes.Class | TypeAttributes.Public,
I have created a class student with three properties like this public class Student
I have created a class Person that looks like this: public class Person {
I'm learning EF4.1 against the northwind database. I have created a POCO class like
I have created a dictionary in Class A and would like to return the
I have an instance of the Popen class created through subprocess.Popen. I would like

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.