Confirm Window Custom style

7 posts, 0 answers
  1. javier
    javier avatar
    13 posts
    Member since:
    Mar 2011

    Posted 19 Apr 2011 Link to this post

    Hi,
    Can you make me an example for a confirm window that have biger buttons and without the header and the close button?
    Thanks!

  2. Dani
    Admin
    Dani avatar
    848 posts

    Posted 20 Apr 2011 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. javier
    javier avatar
    13 posts
    Member since:
    Mar 2011

    Posted 20 Apr 2011 Link to this post

    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,
  5. Dani
    Admin
    Dani avatar
    848 posts

    Posted 21 Apr 2011 Link to this post

    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
  6. javier
    javier avatar
    13 posts
    Member since:
    Mar 2011

    Posted 28 Apr 2011 Link to this post

    thanks
  7. Dorin
    Dorin avatar
    3 posts
    Member since:
    Jun 2012

    Posted 26 Jun 2012 Link to this post

    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?


  8. Dani
    Admin
    Dani avatar
    848 posts

    Posted 28 Jun 2012 Link to this post

    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 >>
Back to Top
UI for WPF is Visual Studio 2017 Ready