Click here to Skip to main content
15,894,201 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Vb.net 2008 ( visual studio 2008) Pin
Mark Salsbery19-Jun-09 7:28
Mark Salsbery19-Jun-09 7:28 
GeneralRe: Vb.net 2008 ( visual studio 2008) Pin
Rits11038919-Jun-09 18:30
Rits11038919-Jun-09 18:30 
QuestionHow to copy a UI element into another UI Element Pin
Nekkantidivya16-Jun-09 23:35
Nekkantidivya16-Jun-09 23:35 
AnswerRe: How to copy a UI element into another UI Element Pin
ABitSmart17-Jun-09 2:54
ABitSmart17-Jun-09 2:54 
AnswerRe: How to copy a UI element into another UI Element Pin
#realJSOP17-Jun-09 8:09
mve#realJSOP17-Jun-09 8:09 
QuestionWPF TabContol problem Pin
Jacobus0116-Jun-09 22:36
Jacobus0116-Jun-09 22:36 
AnswerRe: WPF TabContol problem Pin
ABitSmart17-Jun-09 2:57
ABitSmart17-Jun-09 2:57 
AnswerRe: WPF TabContol problem Pin
#realJSOP17-Jun-09 5:37
mve#realJSOP17-Jun-09 5:37 
I created a new TabItem class, like so:

public class UDPTabItem : TabItem
{
    public bool           IsActive { get; set; }

    //--------------------------------------------------------------------------------
    //--------------------------------------------------------------------------------
    // Create a custom routed event by first registering a RoutedEventID.  This event
    // uses the bubbling routing strategy
    public static readonly RoutedEvent ActivateEvent = EventManager.RegisterRoutedEvent("Activate",
                                           RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(UDPTabItem));
    // Provide CLR accessors for the events
    public event RoutedEventHandler Activate
    {
        add    { AddHandler(ActivateEvent, value);    }
        remove { RemoveHandler(ActivateEvent, value); }
    }
    // These methods raise the events
    private void RaiseActivateEvent()
    {
        RoutedEventArgs eventArgs = new RoutedEventArgs(UDPTabItem.ActivateEvent);
        RaiseEvent(eventArgs);
    }


    //--------------------------------------------------------------------------------
    //--------------------------------------------------------------------------------
    public static readonly RoutedEvent DeactivateEvent = EventManager.RegisterRoutedEvent("Deactivate",
                              RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(UDPTabItem));
    public event RoutedEventHandler Deactivate
    {
        add    { AddHandler(DeactivateEvent, value);    }
        remove { RemoveHandler(DeactivateEvent, value); }
    }
    private void RaiseDeactivateEvent()
    {
        RoutedEventArgs eventArgs = new RoutedEventArgs(UDPTabItem.DeactivateEvent);
        RaiseEvent(eventArgs);
    }


    //--------------------------------------------------------------------------------
    /// <summary>
    ///
    /// </summary>
    public UDPTabItem()
    {
        this.IsActive = false;
    }

    //--------------------------------------------------------------------------------
    /// <summary>
    ///
    /// </summary>
    /// <param name="activate"></param>
    public void ActivateTab(bool activate)
    {
        IsActive = activate;
        if (this.IsActive)
        {
            RaiseActivateEvent();
        }
        else
        {
            RaiseDeactivateEvent();
        }
    }

    //--------------------------------------------------------------------------------
    /// <summary>
    ///
    /// </summary>
    /// <param name="e"></param>
    protected override void OnSelected(RoutedEventArgs e)
    {
        ActivateTab(true);
        base.OnSelected(e);
    }

    //--------------------------------------------------------------------------------
    /// <summary>
    ///
    /// </summary>
    /// <param name="e"></param>
    protected override void OnUnselected(RoutedEventArgs e)
    {
        ActivateTab(false);
        base.OnUnselected(e);
    }

}


You may need to massage it since I had to cut out some stuff for use here.


"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


GeneralRe: WPF TabContol problem Pin
Jacobus0117-Jun-09 20:38
Jacobus0117-Jun-09 20:38 
GeneralRe: WPF TabContol problem Pin
#realJSOP17-Jun-09 23:13
mve#realJSOP17-Jun-09 23:13 
Questionhow to use the same file in two project in visual studio Pin
bigkingjiang16-Jun-09 21:43
bigkingjiang16-Jun-09 21:43 
AnswerRe: how to use the same file in two project in visual studio - Link it Pin
ProtoBytes19-Jun-09 3:50
ProtoBytes19-Jun-09 3:50 
QuestionFrozen Property After Animating [SOLVED] Pin
#realJSOP15-Jun-09 9:26
mve#realJSOP15-Jun-09 9:26 
QuestionUpdate Databindings to Object on assignment to new Object Pin
Dan Payment15-Jun-09 7:59
Dan Payment15-Jun-09 7:59 
AnswerRe: Update Databindings to Object on assignment to new Object Pin
Mark Salsbery15-Jun-09 8:17
Mark Salsbery15-Jun-09 8:17 
GeneralRe: Update Databindings to Object on assignment to new Object Pin
Dan Payment15-Jun-09 9:44
Dan Payment15-Jun-09 9:44 
Questionfence-sitting : SilverLight vs. WPF : one year out ... ? Pin
BillWoodruff15-Jun-09 7:47
professionalBillWoodruff15-Jun-09 7:47 
AnswerRe: fence-sitting : SilverLight vs. WPF : one year out ... ? Pin
Mark Salsbery15-Jun-09 8:13
Mark Salsbery15-Jun-09 8:13 
GeneralRe: fence-sitting : SilverLight vs. WPF : one year out ... ? Pin
BillWoodruff15-Jun-09 9:17
professionalBillWoodruff15-Jun-09 9:17 
QuestionWPF listbox scroolbar width Pin
peterotoole15-Jun-09 4:52
peterotoole15-Jun-09 4:52 
AnswerRe: WPF listbox scroolbar width Pin
Pete O'Hanlon15-Jun-09 5:01
mvePete O'Hanlon15-Jun-09 5:01 
GeneralRe: WPF listbox scroolbar width Pin
#realJSOP17-Jun-09 5:41
mve#realJSOP17-Jun-09 5:41 
QuestionConsume huge excel sheets by WCF Services Pin
Vipul Mehta15-Jun-09 4:26
Vipul Mehta15-Jun-09 4:26 
AnswerRe: Consume huge excel sheets by WCF Services Pin
RugbyLeague15-Jun-09 10:22
RugbyLeague15-Jun-09 10:22 
QuestionGray focus comes on treeview Pin
Ravi Mori15-Jun-09 3:02
Ravi Mori15-Jun-09 3:02 

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.