This is a migrated thread and some comments may be shown as answers.

Button in Header from code

1 Answer 45 Views
Window
This is a migrated thread and some comments may be shown as answers.
Gary Blakely
Top achievements
Rank 1
Gary Blakely asked on 17 Oct 2010, 08:41 PM
I'm trying to put a button in a radwindow that I create on the fly from code.  But it's not working.  the button is "born dead".  When I click on it I don't even see the visual effect of the click.  Nor does it execute the click event.  My code is as follows.  What is wrong?
Thanks, Gary

           Image BigImage = new Image();
           bmp.SetSource(new System.IO.MemoryStream(myPictureAndNotesClass.Picture));
           BigImage.Source = bmp;
           ToolTipService.SetToolTip(BigImage, myPictureAndNotesClass.Notes);
           RadWindow BigPicWindow = new RadWindow();
           StackPanel mysp = new StackPanel();
           mysp.Orientation = Orientation.Horizontal;
           Button fsbutton = new Button();
           fsbutton.Click += new RoutedEventHandler(fsbutton_Click);
           fsbutton.Content = "Full Screen";
           TextBlock textblock = new TextBlock() { Text = "     " +  myPictureAndNotesClass.Notes };
           mysp.Children.Add(fsbutton);
           mysp.Children.Add(textblock);
           BigPicWindow.Header = mysp;
           BigPicWindow.Content = BigImage;
           BigPicWindow.Show();

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 18 Oct 2010, 10:01 AM
Hello Gary,

Thank you for contacting us.

To make it work you will have to set the IsHeaderHitTestVisible property of the RadWindow to True. In that way the Button in the Header will become clickable.

Hope this information is helpful. Please let us know if you have any other questions.

Regards,
Konstantina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Window
Asked by
Gary Blakely
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or