Click here to Skip to main content
15,913,944 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Listbox items - how to "owner draw" Pin
#realJSOP24-Mar-09 2:55
professional#realJSOP24-Mar-09 2:55 
GeneralRe: Listbox items - how to "owner draw" Pin
Pete O'Hanlon24-Mar-09 3:24
mvePete O'Hanlon24-Mar-09 3:24 
GeneralRe: Listbox items - how to "owner draw" Pin
#realJSOP24-Mar-09 3:56
professional#realJSOP24-Mar-09 3:56 
GeneralRe: Listbox items - how to "owner draw" Pin
Pete O'Hanlon24-Mar-09 5:37
mvePete O'Hanlon24-Mar-09 5:37 
GeneralRe: Listbox items - how to "owner draw" [modified] Pin
#realJSOP24-Mar-09 10:01
professional#realJSOP24-Mar-09 10:01 
GeneralRe: Listbox items - how to "owner draw" Pin
Pete O'Hanlon24-Mar-09 11:20
mvePete O'Hanlon24-Mar-09 11:20 
GeneralRe: Listbox items - how to "owner draw" Pin
#realJSOP25-Mar-09 3:29
professional#realJSOP25-Mar-09 3:29 
GeneralRe: Listbox items - how to "owner draw" Pin
Pete O'Hanlon25-Mar-09 3:44
mvePete O'Hanlon25-Mar-09 3:44 
GeneralRe: Listbox items - how to "owner draw" Pin
RugbyLeague30-Mar-09 3:51
RugbyLeague30-Mar-09 3:51 
QuestionLoad project into canvas Pin
emptythetill23-Mar-09 10:55
emptythetill23-Mar-09 10:55 
AnswerRe: Load project into canvas Pin
Christian Graus23-Mar-09 15:21
protectorChristian Graus23-Mar-09 15:21 
GeneralRe: Load project into canvas Pin
emptythetill24-Mar-09 7:41
emptythetill24-Mar-09 7:41 
QuestionDrag drop preview Pin
anishkannan23-Mar-09 0:54
anishkannan23-Mar-09 0:54 
AnswerRe: Drag drop preview [modified] Pin
sivaddrahcir23-Mar-09 11:45
sivaddrahcir23-Mar-09 11:45 
QuestionDownloading file from server Pin
sumit703422-Mar-09 23:50
sumit703422-Mar-09 23:50 
AnswerRe: Downloading file from server Pin
Mark Salsbery23-Mar-09 9:51
Mark Salsbery23-Mar-09 9:51 
GeneralRe: Downloading file from server Pin
sumit703423-Mar-09 18:59
sumit703423-Mar-09 18:59 
AnswerRe: Downloading file from server Pin
Braulio Dez1-Apr-09 5:58
Braulio Dez1-Apr-09 5:58 
QuestionRoutedEvent compare to event? Pin
mildred-frontfree22-Mar-09 23:34
mildred-frontfree22-Mar-09 23:34 
AnswerRe: RoutedEvent compare to event? Pin
ABitSmart23-Mar-09 0:04
ABitSmart23-Mar-09 0:04 
GeneralRe: RoutedEvent compare to event? Pin
mildred-frontfree23-Mar-09 0:24
mildred-frontfree23-Mar-09 0:24 
Well, let me explain myself a little bit clear. On msdn there is a example like this.


<br />
public class MyButtonSimple: Button<br />
{<br />
    // Create a custom routed event by first registering a RoutedEventID<br />
    // This event uses the bubbling routing strategy<br />
    public static readonly RoutedEvent TapEvent = EventManager.RegisterRoutedEvent(<br />
        "Tap", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MyButtonSimple));<br />
<br />
    // Provide CLR accessors for the event<br />
    public event RoutedEventHandler Tap<br />
    {<br />
            add { AddHandler(TapEvent, value); } <br />
            remove { RemoveHandler(TapEvent, value); }<br />
    }<br />
<br />
    // This method raises the Tap event<br />
    void RaiseTapEvent()<br />
    {<br />
            RoutedEventArgs newEventArgs = new RoutedEventArgs(MyButtonSimple.TapEvent);<br />
            RaiseEvent(newEventArgs);<br />
    }<br />
    // For demonstration purposes we raise the event when the MyButtonSimple is clicked<br />
    protected override void OnClick()<br />
    {<br />
        RaiseTapEvent();<br />
    }<br />
<br />
}<br />
<br />
<br />


But, from my point of view, I could although done it this way
<br />
public delegate void DelegateClickEventHandler();<br />
public event DelegateClickEventHandler DelegateClickEvent;<br />
<br />
protected ovveride void OnClick()<br />
{<br />
   if(DelegateClickEvent!=null)<br />
   {<br />
       DelegateClickEvent();<br />
   }<br />
}<br />

And I could use this event in XAML either. So i am a little confused.
GeneralRe: RoutedEvent compare to event? Pin
Pete O'Hanlon23-Mar-09 1:00
mvePete O'Hanlon23-Mar-09 1:00 
GeneralRe: RoutedEvent compare to event? Pin
ABitSmart23-Mar-09 1:29
ABitSmart23-Mar-09 1:29 
GeneralRe: RoutedEvent compare to event? Pin
Pete O'Hanlon23-Mar-09 2:50
mvePete O'Hanlon23-Mar-09 2:50 
GeneralRe: RoutedEvent compare to event? Pin
ABitSmart23-Mar-09 2:56
ABitSmart23-Mar-09 2:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.