Windows Vista Forums

<EventTrigger RoutedEvent="Button.Click">

  1. #1


    Horst Klein Guest

    <EventTrigger RoutedEvent="Button.Click">

    I have an idea, but I dont know how to realise it in XAML.
    The online dokumentation gives not really an anser to my problem.

    So, what will I do?

    I try to call a custom Class, Property or Methode (with whatever it works)
    with an Trigger (EventTrigger, ActionTrigger or whatever it works)

    <Button x:Name="MyButton" Content="Button">
    <Button.Triggers>
    <EventTrigger RoutedEvent="Button.Click">
    <UseMyClass>

    </UseMyClass>
    </EventTrigger>
    </Button.Triggers>
    </Button>

    How can I do that?

    Thanks for support.
    Horst

      My System SpecsSystem Spec

  2. #2


    Keith Patrick Guest

    Re: <EventTrigger RoutedEvent="Button.Click">

    You can call a custom property with:
    <Setter PropertyName="" Value=""/>

    There is a whole family of XSetter's

    Not sure about methods, and classes are not executable per se unless you
    count a main() method, in which case you wouldn't have to support "class
    execution" anyway since method execution would cover it via the main().



      My System SpecsSystem Spec

  3. #3


    thelemmings@gmail.com Guest

    Re: <EventTrigger RoutedEvent="Button.Click">

    Why not try something simple like:
    <Button x:Name="MyButton" Content="Button" Click="MyOnClickMethod" />

    With an implemention of MyOnClickMethod in your code behind:
    void Click="MyOnClickMethod"(object sender, RoutedEventArgs rea)
    {
    // Do your stuff
    }

    Luc

    Horst Klein wrote:
    > I have an idea, but I dont know how to realise it in XAML.
    > The online dokumentation gives not really an anser to my problem.
    >
    > So, what will I do?
    >
    > I try to call a custom Class, Property or Methode (with whatever it works)
    > with an Trigger (EventTrigger, ActionTrigger or whatever it works)
    >
    > <Button x:Name="MyButton" Content="Button">
    > <Button.Triggers>
    > <EventTrigger RoutedEvent="Button.Click">
    > <UseMyClass>
    >
    > </UseMyClass>
    > </EventTrigger>
    > </Button.Triggers>
    > </Button>
    >
    > How can I do that?
    >
    > Thanks for support.
    > Horst



      My System SpecsSystem Spec

  4. #4


    Horst Klein Guest

    Re: <EventTrigger RoutedEvent="Button.Click">

    This way I can't go, because I use loose-XAMLs.
    And code behinde is not usable for our Application!
    Horst



      My System SpecsSystem Spec

<EventTrigger RoutedEvent="Button.Click">

Similar Threads
Thread Forum
"right click-send to-documents";one button
I want to be able to click one of the alternative buttons on my mouse and have it perform the function of right clicking, then scrolling to send to,...
General Discussion
"right click" and "open" on an icon does not start the program!
The subject says it all. I right click on an icon, choose "open", and nothing happens. But if I double click, it starts right up. Any ideas? Is...
Vista General
Adressbook under "To:/Cc:" is not the same as under the button "Contacts".
Hello, Having just upgraded to Vista, I found it very "disturbing" to work with my original Addressbook from Outlook Express which I just...
Vista mail
3xQ - "New Folder" button?, "- Shortcut" suffix, Preview bug?
Vista HP 1. Is there any way to restore/create a New Folder button for Explorer windows... (why on earth did they take it away???) 2. How can...
Vista file management
The "X" Button. ~The Huge {Close} Button~
I have one simple question.. And it's about the design. We all know that Windows Vista has good looks. My big problem seems to be that I don't...
Vista General
Start Menu - when I click on the "pictures" button nothing happens
On the right panel of the start menu when I click on the pictures button nothing happens. When I look at the pictures button "properties" there is...
Vista file management
Custom RoutedEvent in EventTrigger of CustomControl Style.
I have a custom control with a RoutedEvent and try to wire it to the generic.xaml style. public class ClassShape : Control { public static...
Avalon