Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
Q

quetzilla

@quetzilla
About
Posts
6
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Custom Binding Extension -- how to access source object.?
    Q quetzilla

    For anyone interested, the answer turned out to be to hook into the DataContextChanged event of the targeted UI element (button1.DataContextChanged in this case).

    WPF wpf csharp tutorial question wcf

  • Custom Binding Extension -- how to access source object.?
    Q quetzilla

    Using this excellent article[^] I am trying to set up a custom binding extension. The issue is that when the binding finds the source object, I need to do some stuff to the source object, but I don't know where to put that code. For example, I have the following class:

    class MyObject {
    public string Value { get; set; }
    }

    and some XAML in MainWindow.xaml:

    <Button Content="{my:CustomBinding Value}">

    And set the data context in code:

    public MainWindow()
    {
    InitializeComponent();
    this.DataContext = MyObject;
    }

    That much works, the Value string gets displayed on the button. But what I need to do is write code in the CustomBinding class that operates on MyObject as soon as possible, which means I need to resolve MyObject from the BindingExpression. What I've figured out so far is that when the CustomBinding instance is created, it doesn't actually find the MyObject.Value because it needs to find the data context first in order to resolve the BindingExpression, so it doesn't actually find MyObject until the MainWindow gets laid out on screen. So my question is, what code do I write in the CustomBindingExtension class so that it runs when the WPF layout system decides to resolve the BindingExpression to find MyObject?

    WPF wpf csharp tutorial question wcf

  • Change content in MainWindow / Navigation
    Q quetzilla

    There's no way to do it in XAML only without using a markup extension library. This seems like a basic M-V-whatever issue.

    WPF wpf csharp css help tutorial

  • Intellisense for Attached Property values?
    Q quetzilla

    I found it, it's AttachedPropertyBrowsableForChildren: http://msdn.microsoft.com/en-us/library/system.windows.attachedpropertybrowsableforchildrenattribute.aspx[^] Will be nice to have that working now!

    WCF and WF tutorial question visual-studio wpf algorithms

  • Intellisense for Attached Property values?
    Q quetzilla

    I tried creating an enum type for an attached property, but the enum names didn't show up in the xaml editor, and entering them manually results in an error message saying 'Cannot convert "foo" to string'. Maybe I will try using Reflector to figure it out.

    WCF and WF tutorial question visual-studio wpf algorithms

  • Intellisense for Attached Property values?
    Q quetzilla

    A lot of the articles on attached properties use DockPanel.Dock as an example, yet DockPanel.Dock does something that I haven't seen explained in all my searching so far: In the XAML editor, there is an intellisense dropdown that displays the four possible options (Top, Left, etc). I've been searching high and low but I can't figure out how to set up my property to display a set of options like that in intellisense. Obviously it's not absolutely required for my current project, but I'd really like to know how to get those to show up. Do I need some kind of converter, and if so how do I link that to the property?

    WCF and WF tutorial question visual-studio wpf algorithms
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups