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

Confirm Window Custom style

6 Answers 466 Views
Window
This is a migrated thread and some comments may be shown as answers.
javier
Top achievements
Rank 1
javier asked on 19 Apr 2011, 07:51 PM
Hi,
Can you make me an example for a confirm window that have biger buttons and without the header and the close button?
Thanks!

6 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 20 Apr 2011, 09:03 AM
Hello Javier,

You can easily customize the RadConfirm dialog using Expression Blend. You need the RadConfirmStyle and RadWindowStyle.

Follow these steps:

- Drag a RadWindow onto the design area in Expression Blend
- Generate the template for RadWindow by right-clicking on the control > Edit Template > Edit a Copy
- Make your customizations upon that template (removing window elements, changing colors, etc.)
- You do not need the window now, you can delete it

- Drag a dummy RadConfirm control onto the design area
- Generate its template
- Make your customizations upon the template (bigger buttons, etc.)
- You can delete the RadConfirm control

Use both of the generated style when you create your instance of RadConfirm dialog in a similar manner:

private void Window_Loaded(object sender, RoutedEventArgs e)
       {
           RadWindow.Confirm(new DialogParameters()
           {
               Content = "Save changes?",
               WindowStyle = Application.Current.Resources["RadWindowStyle"] as Style,
               ContentStyle = Application.Current.Resources["RadConfirmStyle"] as Style,
           });
       }

I hope this helps. If you need assistance on accomplishing this task, please let me know.


All the best,
Dani
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
0
javier
Top achievements
Rank 1
answered on 20 Apr 2011, 01:08 PM
Sorry but i don't use expression blend and i can't use it (work policy), so I work directly with the xaml file in the visual studio 2010 and it's a little complicated to generate the style without visualy see it.
It is common to see in the forums custom solutions that people from support reply to some specific needs (great work by the way)
so i imagine that you can send me an simple solution with a custom template that have something like i need, so i can modified the values to achieve my task.
excuse me if thats no possible.

thank you and greetings,
0
Dani
Telerik team
answered on 21 Apr 2011, 08:14 AM
Hello Javier,

I prepared a sample as per the guidelines posted in my first reply. Attached you can find a customized RadConfirm dialog with hidden header and borders. You can apply your own customizations on the two styles you will find in App.xaml.

I hope this will be helpful.

All the best,
Dani
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
0
javier
Top achievements
Rank 1
answered on 28 Apr 2011, 01:25 PM
thanks
0
Dorin
Top achievements
Rank 1
answered on 26 Jun 2012, 08:06 AM
And how can we change the width inside the radwindow in order that the content to be stretched to the radwindow. In this moment it seems to be centered.  I hope you understand what i want to achieve. Thank you !

All i changed in your code was:
 - added a textblock (with width=700) on the content property instead of "Save changes?";
 - added <Setter Property="Width" Value="1200"/> to the RadWindowStyle in app.xaml

Now the content of radwindow is centered ( the horizontalScrollBar appears), and i want to stretch it to the radwindow width.



----------------------------------------
I did find the solution eventually. I just added <Setter Property="MaxWidth" Value="9000"/> to the RadWindowStyle in app.xaml.
Cant explain why it works now.... Wasn't that property Auto? Shouldn't that work without the maxwidth?


0
Dani
Telerik team
answered on 28 Jun 2012, 11:17 AM
Hello Dorin,

It is the MinWidth and MaxWidth properties of the RadConfirmStyle that prevent it from stretching. If your RadWindow is 1200px in Width, you can change MinWidth in RadConfirmStyle to 1100, for example, and remove the MaxWidth Setter.

Also, when using a TextBlock as content for the dialog, if you do not wish the horizontal ScrollBar to appear, you have to let the TextBlock wrap. To allow text-wrapping you have to set a fixed width to the TextBlock. For example, 1000px.

So all it takes is just to keep the MinWidth and the TextBlock width in accordance with the RadWindow width.

Hope this helps.

All the best,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Window
Asked by
javier
Top achievements
Rank 1
Answers by
Dani
Telerik team
javier
Top achievements
Rank 1
Dorin
Top achievements
Rank 1
Share this question
or