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

About RadWindow.Alert FontFamily

1 Answer 46 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kelley Wong
Top achievements
Rank 1
Kelley Wong asked on 24 Sep 2011, 12:32 PM
using version 2011.1.0419 ,when i set the usercontrol's fontfamily ,the fontfamily of the RadWindow.Alert() is the same as that set in the usercontrol .
today i update to version 2011.2.0920 , the fontfamily set in the usercontrol is not usefull to RadWindow.Alert() !

the same problem is also in the RadChart Control


public partial class Login : UserControl
 {
        public Login()
        {
            InitializeComponent();
 
            FontFamily = new System.Windows.Media.FontFamily(BSC.Resources.CommonResource.ResourceManager.GetString("FontFamilyString", System.Threading.Thread.CurrentThread.CurrentUICulture));
 
           CheckState();
        }
 
 
       internal void CheckState()
      {
             RadWindow.Alert("Pass!");
      }
}

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivo
Telerik team
answered on 29 Sep 2011, 07:58 AM
Hello Kelley,

Introducing Q2 version of RadControls for Silverlight there were major changes in RadWindow control. We moved the RadWindow's popups out of the VisualTree, because placing it into the VisualTree was a work-around intended for internal use only which we don't need anymore.

That's why your code is not working properly now. I would suggest you use the DialogParameters parameter of RadWindow.Alert(). Here is sample code:
var dialogParameters = new DialogParameters();
dialogParameters.WindowStyle = new System.Windows.Style(typeof(RadWindow));
var setter = new Setter(RadWindow.FontFamilyProperty, this.FontFamily);
dialogParameters.WindowStyle.Setters.Add(setter);
dialogParameters.Content = "Pass!";
 
RadWindow.Alert(dialogParameters);

or using static defined style in XAML:
var dialogParameters = new DialogParameters();
var style = App.Current.Resources["RadWindowStyle"] as Style;
dialogParameters.WindowStyle = style;
dialogParameters.Content = "Pass!";
 
RadWindow.Alert(dialogParameters);

Hope this helps.

All the best,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Window
Asked by
Kelley Wong
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or