requirement to change the image of the radbutton to different image on 'Hover' operation

1 posts, 0 answers
  1. Srinivas
    Srinivas avatar
    32 posts
    Member since:
    Aug 2010

    Posted 20 Sep 2010 Link to this post



    Hello Telerik,
    I am developing a customcontrol for radbutton .


    I have a requirement to change the image of the radbutton to different image on 'Hover' operation.

    public

     

     

    class TngButton : TngBaseTemplateControl

     

    {

     


     

     

    static TngButton()

     

    {

    DefaultStyleKeyProperty.OverrideMetadata(

     

    typeof(TngButton), new FrameworkPropertyMetadata(typeof(TngButton)));

     

    }

    #endregion

     

     

    public override void OnApplyTemplate()

     

    {

     

     

    base.OnApplyTemplate();

     

     

     

    RadButton btn = this.Template.FindName("PART_BaseControl", this) as RadButton;

     

     

     

    ContentPresenter content = this.Template.FindName("PART_ContentControl", this) as ContentPresenter;

     

     

     

    btn.Hover+=new EventHandler<Telerik.Windows.RadRoutedEventArgs>(btn_Hover);

     

     

    }

     

     

     

    void btn_Hover(object sender, EventArgs e)

     

    {

     

     

     

    // code to change the image at the hover .

     

     

     

     

    }


    i want to have two properties like 'originalimage' and 'hoverimage" which can be changed on mover hover action
    can you help me in how to setting the logic for this ?

    regards,
    Srinivas

Back to Top