Alert/Confirm/Prompt not styling Buttons

5 posts, 1 answers
  1. Johannes
    Johannes avatar
    66 posts
    Member since:
    Dec 2012

    Posted 26 Jun 2014 Link to this post

    I have a usual UserControl with a button. I just want so show a RadWindow.Alert. Here's the Code behind:

    public partial class TestView
    {
        public TestView()
        {
            InitializeComponent();
        }
     
        private void TestButton_OnClick(object sender, RoutedEventArgs e)
        {
            RadWindow.Alert(new DialogParameters
                {
                    Content = "Test",
                    ContentStyle = Resources["RadAlertStyle"] as Style,
                    WindowStyle = Resources["RadWindowStyle"] as Style
                });
        }
    }


    This is done as shown in the WPF demos but in my case the buttons on the RadWindow.Alert dialog are not styled. I use Telerik Windows 8 theme. All RadButtons are style correctly in Windows 8 style but not on any of my RadWindow dialogs. What am I missing? Please see attached image.


  2. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    138 posts

    Posted 26 Jun 2014 Link to this post

    Hello Johannes,

    Unfortunately, you do not provide enough information in order for me to investigate the issue. However, we have a full tutorial available on how to accomplish it. This article in the documentation will take you step-by-through styling the RadWindow.

    Regards,
    Lance | Senior Support Specialist
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Johannes
    Johannes avatar
    66 posts
    Member since:
    Dec 2012

    Posted 27 Jun 2014 in reply to Lance | Tech Support Engineer, Sr. Link to this post

    I've tried to run through the tutorial but when copying the template of a RadDataForm I just get an error and Blend only creates an unfinished RadWindow template. However I found out what caused the problem: I had all Windows 8 theme resources inside my TestView.xaml (UserControl.Resources) and now I've moved them to App.xaml (Application.Resources). Now buttons on all RadWindows get also styled in Windows 8 style. So it seems that the Telerik theme resources have to be in App.xaml to be reachable from RadWindow.
  5. Johannes
    Johannes avatar
    66 posts
    Member since:
    Dec 2012

    Posted 27 Jun 2014 Link to this post

    but when copying the template of a RadDataForm


    Of course I meant RadWindow.
  6. Answer
    Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 27 Jun 2014 Link to this post

    Hi Johannes,

    Indeed any styles targeting RadWindow should be placed in App.xaml as the shown RadWindow it is not located in the same visual tree as the MainWindow for example.

    Hope this helps.

    Regards,
    Kalin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top
UI for WPF is Visual Studio 2017 Ready