Changing a RadConfirm/Alert/Prompt Window Border

7 posts, 1 answers
  1. Vic
    Vic avatar
    40 posts
    Member since:
    Mar 2009

    Posted 10 Jul 2009 Link to this post

    Hello,

     

    Only looking to change the border color of a RadConfirm/Alert/Prompt, am assuming that these controls inherit from a RadWindow and their styles too, I am just having problems exposing the BorderBrush/Color to them.

     

    Any help is much appreciated!

     


    Thanks

  2. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 15 Jul 2009 Link to this post

    Hi Vic,

    Yes, you are correct the modal windows inherit its style from the RadWindow control template. If you change edit the brushes that construct the border of RadWindow you will have the borders changed. What are the problems you have in changing the colors of these brushes? Thank you for contacting us and we look forward to receiving your feedback.

    Sincerely yours,
    Hristo Borisov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Vic
    Vic avatar
    40 posts
    Member since:
    Mar 2009

    Posted 15 Jul 2009 Link to this post

    Hi Hristo,

     

    Thanks for replying, I still don't see how I can do this.. The DialogParameters struct doesn't have such a field, the

    RadWindow class exposes BorderBackgroundProperty, BorderBrushProperty, BorderThicknessProperty but all are readonly fields.

    Below is the actual implementation.

    Any ideas?

    Thanks,
    Vic 

     public static void ConfirmDialog(string message, string header, EventHandler<WindowClosedEventArgs> DialogClosedHandler)  
            {  
                DialogParameters dlg = new DialogParameters();  
                dlg.Content = message;  
                //dlg.ModalBackground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(70, 0, 0, 255));  
                dlg.ModalBackground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0));  
                dlg.IconContent = null;  
                dlg.Closed = DialogClosedHandler;  
                dlg.Header = header;  
                dlg.CancelButtonContent = "No";  
                dlg.OkButtonContent = "Yes";  
                RadWindow.Confirm(dlg);  
                  
            } 
  5. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 15 Jul 2009 Link to this post

    Hello Vic,

    I meant to say changing the theme of the RadWindow. You should edit on of the RadWindow built-in themes which also will be reflected in the modal dialogs. Currently, there is no way you can directly change the theme of a single modal dialog. We are working on improving our theming mechanism in order to support better and easier skinning. To learn how to change the built-in themes please check this article. Please contact us if you have any further questions.

    Regards,
    Hristo Borisov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Vic
    Vic avatar
    40 posts
    Member since:
    Mar 2009

    Posted 15 Jul 2009 Link to this post

    Hi Hristo,

    Think I am getting close but it still doesn't work, below are the steps I took.

    I extracted 2 xaml files from the "Red" themes source and added them to a shared component we use

    Telerik.Windows.Themes.Default_Red\Themes\Common.xaml

    Telerik.Windows.Themes.Default_Red\Themes\Window.xaml

    In Window.xaml I modified the Telerik:ResourceDictionary Source prop to point to my copy of Common.xaml

    In Common.Xaml I modified the RadWindow_OuterBorder and RadWindow_OuterBackground to different colors..

    Applied it to the Theme prop as such:

      public static void ConfirmDialog(string message, string header, EventHandler<WindowClosedEventArgs> DialogClosedHandler)  
            {  
                DialogParameters dlg = new DialogParameters();  
                dlg.Content = message;  
                //dlg.ModalBackground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(70, 0, 0, 255));  
                dlg.ModalBackground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0));  
                dlg.IconContent = null;  
                dlg.Closed = DialogClosedHandler;  
                dlg.Header = header;  
                dlg.CancelButtonContent = "No";  
                dlg.OkButtonContent = "Yes";  
                dlg.Theme = new Theme(new Uri("/Silverlight.Shared;component/Themes/Telerik/Window.xaml", UriKind.Relative));  
     
                 
                RadWindow.Confirm(dlg);  
            } 

    In the documentation you gave me it says I should call "StyleManager.SetTheme(<Window>, customTheme); " after I set the style.

    But I cannot because the RadWindow.Confirm is a staic method.

    Have any ideas what I am doing wrong?

    Thanks again!

  7. Answer
    Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 21 Jul 2009 Link to this post

    Hi Vic,

    I have tried the case and it seems that we have a bug in the Theme property of the modal windows. We will work to resolve this issue before our service pack release. Please excuse us for this inconvenience.

    Sincerely yours,
    Hristo Borisov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. Vic
    Vic avatar
    40 posts
    Member since:
    Mar 2009

    Posted 21 Jul 2009 Link to this post

    Thanks for the reply, anxiously awaiting the fix :)

Back to Top
DevCraft banner