Change just RadWindow header Foreground and FontWeight

19 posts, 0 answers
  1. Fabiana
    Fabiana avatar
    69 posts
    Member since:
    Oct 2009

    Posted 28 Jul 2010 Link to this post

    Hello Support!

    I created a RadWindow as my code...

    <telerikNavigation:RadWindow x:Class="Abm.Surveys.Creator.Forms.frmEdit"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
               xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
                Width="400" Height="130" Header="Edit" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" BorderThickness="0">

        <Grid x:Name="LayoutRoot">

            <TextBlock Height="23" HorizontalAlignment="Left" Margin="10,12,0,0"  x:Name="txbName" Text="Name:" VerticalAlignment="Top" Width="79" />

            <TextBox Height="23" Margin="0,8,12,0" x:Name="txtName" TabIndex="0" VerticalAlignment="Top" MaxLength="255" HorizontalContentAlignment="Left"  HorizontalAlignment="Right" Width="281" /

            <telerik:RadButton Content="OK" Style="{StaticResource CustomTelerikRadButton}" Height="23" HorizontalAlignment="Right" Margin="218,69,94,0" x:Name="btnOK" VerticalAlignment="Top" Width="75" Click="btnOK_Click" TabIndex="2" Cursor="Hand" DataContext="{Binding}" />
        </Grid>

    </telerikNavigation:RadWindow>




    And I created my Theme too. I modified Window.xaml file, the follow line:    <Style  TargetType="telerikNavigation:RadWindow">

    I set Foreground and FontWeight:

    <Setter Property="Foreground" Value="#FF00335B"></Setter>
    <Setter Property="FontWeight" Value="Bold"></Setter>
       

    The problem is that all control in RadWindow will be with these Foreground and FontWeight. I would like just to set RadWindow header to these FontWeight and Foreground configurations. Is it possible?
    Thanks!



    Window.xaml:

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               
        xmlns:animation="clr-namespace:Telerik.Windows.Controls.Animation;assembly=Telerik.Windows.Controls"
        xmlns:telerikTransitions="clr-namespace:Telerik.Windows.Controls.TransitionEffects;assembly=Telerik.Windows.Controls"
        xmlns:telerikChromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls"


        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
        xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:telerikNavigationPrimitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"
        xmlns:telerikToolBar="clr-namespace:Telerik.Windows.Controls.ToolBar;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
        xmlns:mscorlib="clr-namespace:System;assembly=mscorlib"   
        xmlns:dragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls"
        xmlns:animationNavigation="clr-namespace:Telerik.Windows.Controls.Animation;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:treeView="clr-namespace:Telerik.Windows.Controls.TreeView;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:telerikTabControl="clr-namespace:Telerik.Windows.Controls.TabControl;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:book="clr-namespace:Telerik.Windows.Controls.Book;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:outlookBarPrimitives="clr-namespace:Telerik.Windows.Controls.OutlookBar;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"

    >
        <Thickness x:Key="WindowButtonPadding">4</Thickness>
    <Thickness x:Key="WindowButtonMargin">1 1 0 1</Thickness>
    <CornerRadius x:Key="SplitButton_SpanCornerRadius">1</CornerRadius>
    <LinearGradientBrush x:Key="WindowInnerBorder" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFB7EDFF" Offset="0"/>
        <GradientStop Color="#FF214D71" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="WindowHeaderBackground" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#FFE7F0FC" Offset="0"/>
        <GradientStop Color="#FFB7EDFF" Offset="0"/>
        <GradientStop Color="#FFB7EDFF" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="WindowButtonIconFill" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF3C6AA3" Offset="0"/>
            <GradientStop Color="#FF83A5D2" Offset="1"/>
        </LinearGradientBrush>
    <SolidColorBrush x:Key="WindowButtonIconStroke" Color="#FFFFFFFF" />
    <LinearGradientBrush x:Key="WindowBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFB7EDFF" Offset="0"/>
        <GradientStop Color="#FF214D71" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="WindowOuterBorder" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFB7EDFF" Offset="0"/>
        <GradientStop Color="#FF214D71" Offset="0.98"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="WindowBorderBackground" Color="#FF005092" />
    <LinearGradientBrush x:Key="WindowModalBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#B2153D6E"/>
            <GradientStop Color="#33153D6E" Offset="0.5"/>
            <GradientStop Color="#B2153D6E" Offset="1"/>
        </LinearGradientBrush>
    <SolidColorBrush x:Key="BorderLineOuterColor" Color="Transparent" />
    <SolidColorBrush x:Key="BorderLineInnerColor" Color="Transparent" />

        

        <!-- WindowButtonStyle -->
        <Style x:Key="WindowButtonStyle" TargetType="telerik:RadButton">
            <Setter Property="Padding" Value="{StaticResource WindowButtonPadding}" />
            <Setter Property="Margin" Value="{StaticResource WindowButtonMargin}" />
            <Setter Property="IsTabStop" Value="False" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerik:RadButton">
                        <Grid>
                            <telerikChromes:ButtonChrome  RenderNormal="False" CornerRadius="{StaticResource SplitButton_SpanCornerRadius}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" />
                            <ContentPresenter Margin="{TemplateBinding Padding}" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <!-- WindowResizeThumbStyle -->
        <Style x:Key="WindowResizeThumbStyle" TargetType="Thumb">
            <Setter Property="MinWidth" Value="5" />
            <Setter Property="MinHeight" Value="5" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Thumb">
                        <Rectangle Fill="Transparent" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <!-- RadWindowTemplate -->
        <ControlTemplate x:Key="RadWindowTemplate" TargetType="telerikNavigation:RadWindow">
            <Grid x:Name="LayoutRoot">
               
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal" />
                        <VisualState x:Name="Disabled" />
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                        <VisualState x:Name="Focused" />
                        <VisualState x:Name="Unfocused" />
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="DragStates">
                        <VisualState x:Name="NotDragging" />
                        <VisualState x:Name="Dragging" />
                        <VisualState x:Name="Resizing" />
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="WindowStates">
                        <VisualState x:Name="NormalWindow" />
                        <VisualState x:Name="Maximized">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WindowOuterBorder" Storyboard.TargetProperty="CornerRadius">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WindowInnerBorder" Storyboard.TargetProperty="CornerRadius">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WindowOuterBorder" Storyboard.TargetProperty="BorderThickness">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WindowInnerBorder" Storyboard.TargetProperty="BorderThickness">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentInnerBorder" Storyboard.TargetProperty="BorderThickness">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="0 1 0 0" />
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentOuterBorder" Storyboard.TargetProperty="BorderThickness">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="0 1 0 0" />
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentOuterBorder" Storyboard.TargetProperty="Margin">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderButtons" Storyboard.TargetProperty="Margin">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Shadow" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Minimized">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentOuterBorder" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderButtons" Storyboard.TargetProperty="Margin">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
               
               
                <Border x:Name="Shadow" CornerRadius="10" BorderBrush="#11000000" BorderThickness="1" Margin="-3 -3 -5 -5">
                    <Border CornerRadius="9" BorderBrush="#22000000" BorderThickness="1">
                        <Border CornerRadius="8" BorderBrush="#33000000" BorderThickness="1">
                            <Border CornerRadius="7" BorderBrush="#44000000" BorderThickness="1">
                                <Border CornerRadius="6" BorderBrush="#55000000" BorderThickness="1">
                                    <Border CornerRadius="5" BorderBrush="#66000000" BorderThickness="1">
                                        <Border CornerRadius="4" BorderBrush="#77000000" BorderThickness="1">
                                        </Border>
                                    </Border>
                                </Border>
                            </Border>
                        </Border>
                    </Border>
                </Border>
               
                <Border x:Name="WindowOuterBorder" Grid.RowSpan="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{TemplateBinding BorderBackground}" CornerRadius="5">
                    <Border x:Name="WindowInnerBorder" BorderBrush="{StaticResource WindowInnerBorder}" BorderThickness="0" CornerRadius="4">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>

                            <Grid x:Name="Header" Background="{StaticResource WindowHeaderBackground}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <Thumb x:Name="titleThumb" Grid.ColumnSpan="2" Style="{StaticResource WindowResizeThumbStyle}" />
                               
                                <StackPanel Orientation="Horizontal" Grid.Column="0" Margin="2 0 0 0">
                                    <ContentPresenter x:Name="IconContent"
                                                HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2"
                                                Content="{TemplateBinding Icon}" ContentTemplate="{TemplateBinding IconTemplate}" />

                                    <ContentPresenter x:Name="HeaderContent"
                                            IsHitTestVisible="{TemplateBinding IsHeaderHitTestVisible}"
                                            HorizontalAlignment="Left" VerticalAlignment="Center"
                                            Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"
                                             >
                                    </ContentPresenter>
                                </StackPanel>

                                <Border x:Name="PART_HeaderButtonsBorder" Grid.Column="1">
                                    <StackPanel x:Name="HeaderButtons" Grid.Column="1" Orientation="Horizontal" Margin="0 0 3 0">
                                        <telerik:RadButton x:Name="PART_MinimizeButton" Command="telerik:WindowCommands.Minimize" Style="{StaticResource WindowButtonStyle}">
                                            <Path Fill="{StaticResource WindowButtonIconFill}" Stroke="{StaticResource WindowButtonIconStroke}" Width="14" Height="14" Data="M1.5,7.5 L12.5,7.5 12.5,11.5 1.5,11.5 Z" />
                                        </telerik:RadButton>
                                        <telerik:RadButton x:Name="PART_RestoreButton" Command="telerik:WindowCommands.Restore" Style="{StaticResource WindowButtonStyle}">
                                            <Path Fill="{StaticResource WindowButtonIconFill}" Stroke="{StaticResource WindowButtonIconStroke}" Width="14" Height="14" Data="M0.5,4.5 0.5,11.5 1.5,12.5 8.5,12.5 9.5,11.5 9.5,3.5 1.5,3.5 Z M3.5,6.5 L3.5,9.5 L6.5,9.5 6.5,6.5 Z M3.5,3.5 3.5,1.5 4.5,0.5 11.5,0.5 12.5,1.5 12.5,9.5 11.5,10.5 9.5,10.5 9.5,3.5 Z" />
                                        </telerik:RadButton>
                                        <telerik:RadButton x:Name="PART_MaximizeButton" Command="telerik:WindowCommands.Maximize" Style="{StaticResource WindowButtonStyle}">
                                            <Path Fill="{StaticResource WindowButtonIconFill}" Stroke="{StaticResource WindowButtonIconStroke}" Width="14" Height="14" Data="M1.5,2.5 L12.5,2.5 12.5,11.5 1.5,11.5 Z M4.5,5.5 L9.5,5.5 9.5,8.5 4.5,8.5 Z" />
                                        </telerik:RadButton>
                                        <telerik:RadButton x:Name="PART_CloseButton" Command="telerik:WindowCommands.Close" Style="{StaticResource WindowButtonStyle}">
                                            <Path Fill="{StaticResource WindowButtonIconFill}" Stroke="{StaticResource WindowButtonIconStroke}" Width="14" Height="14" Data="M1.5,3.5 L2.5,2.5 4.5,2.5 6.5,4.5 8.5,2.5 10.5,2.5 11.5,3.5 8.5,6.5 8.5,7.5 11.5,10.5 10.5,11.5 8.5,11.5 6.5,9.5 4.5,11.5 2.5,11.5 1.5,10.5 4.5,7.5 4.5,6.5 z" />
                                        </telerik:RadButton>
                                    </StackPanel>
                                </Border>

                            </Grid>

                            <Border x:Name="ContentOuterBorder" Grid.Row="1" Margin="{TemplateBinding BorderThickness}" BorderThickness="1" BorderBrush="{StaticResource WindowInnerBorder}">
                                <Border x:Name="ContentInnerBorder" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
                                    <ContentPresenter x:Name="ContentElement" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                </Border>
                            </Border>

                        </Grid>
                    </Border>
                </Border>
               
                <Thumb x:Name="W" Style="{StaticResource WindowResizeThumbStyle}" Cursor="SizeWE" HorizontalAlignment="Left" />
                <Thumb x:Name="N" Style="{StaticResource WindowResizeThumbStyle}" Cursor="SizeNS" VerticalAlignment="Top" />
                <Thumb x:Name="E" Style="{StaticResource WindowResizeThumbStyle}" Cursor="SizeWE" HorizontalAlignment="Right" />
                <Thumb x:Name="S" Style="{StaticResource WindowResizeThumbStyle}" Cursor="SizeNS" VerticalAlignment="Bottom" />
                <Thumb x:Name="NW" Style="{StaticResource WindowResizeThumbStyle}" Cursor="SizeNWSE" VerticalAlignment="Top" HorizontalAlignment="Left" />
                <Thumb x:Name="NE" Style="{StaticResource WindowResizeThumbStyle}" Cursor="SizeNESW" VerticalAlignment="Top" HorizontalAlignment="Right" />
                <Thumb x:Name="SE" Style="{StaticResource WindowResizeThumbStyle}" Cursor="SizeNWSE" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
                <Thumb x:Name="SW" Style="{StaticResource WindowResizeThumbStyle}" Cursor="SizeNESW" VerticalAlignment="Bottom" HorizontalAlignment="Left" />
               
            </Grid>
           
        </ControlTemplate>

        <!-- telerikNavigation:RadWindow -->
        <Style  TargetType="telerikNavigation:RadWindow">
        
            <Setter Property="IsTabStop" Value="false" />
           
            <Setter Property="Background" Value="{StaticResource WindowBackground}" />
            <Setter Property="BorderBrush" Value="{StaticResource WindowOuterBorder}" />
            <Setter Property="BorderBackground" Value="{StaticResource WindowBorderBackground}" />
            <Setter Property="ModalBackground" Value="{StaticResource WindowModalBackground}" />
           
            <Setter Property="BorderThickness" Value="0" />
           
            <Setter Property="MinHeight" Value="26" />
            <Setter Property="MinWidth" Value="100" />
           
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="VerticalAlignment" Value="Top" />
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            <Setter Property="VerticalContentAlignment" Value="Stretch" />
           
            <Setter Property="Header" Value="RadWindow" />

            <Setter Property="WindowStartupLocation" Value="Manual" />
            <Setter Property="WindowState" Value="Normal" />

            <Setter Property="Template" Value="{StaticResource RadWindowTemplate}" />

            <Setter Property="Foreground" Value="#FF00335B"></Setter>
            <Setter Property="FontWeight" Value="Bold"></Setter>

            
            <Setter Property="TabNavigation" Value="Cycle" />
           
            <Setter Property="animation:AnimationManager.AnimationSelector">
                <Setter.Value>
                    <animation:AnimationSelector>
                        <animation:AnimationGroup AnimationName="Show">
                            <animation:FadeAnimation Direction="In" TargetElementName="LayoutRoot" >
                                
                                <animation:FadeAnimation.Easing>
                                    <QuarticEase EasingMode="EaseOut" />
                                </animation:FadeAnimation.Easing>
                                
                            </animation:FadeAnimation>
                            <animation:ScaleAnimation Direction="In" TargetElementName="LayoutRoot" MinScale="0.9" >
                                
                                <animation:ScaleAnimation.Easing>
                                    <QuarticEase EasingMode="EaseOut" />
                                </animation:ScaleAnimation.Easing>
                                
                            </animation:ScaleAnimation>
                        </animation:AnimationGroup>
                        <animation:AnimationGroup AnimationName="Hide">
                            <animation:FadeAnimation Direction="Out" TargetElementName="LayoutRoot" >
                                
                                <animation:FadeAnimation.Easing>
                                    <QuarticEase EasingMode="EaseOut" />
                                </animation:FadeAnimation.Easing>
                                
                            </animation:FadeAnimation>
                            <animation:ScaleAnimation Direction="Out" TargetElementName="LayoutRoot" MinScale="0.9">
                                
                                <animation:ScaleAnimation.Easing>
                                    <QuarticEase EasingMode="EaseIn" />
                                </animation:ScaleAnimation.Easing>
                                
                            </animation:ScaleAnimation>
                        </animation:AnimationGroup>
                    </animation:AnimationSelector>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- telerikNavigation:RadPrompt -->
        <Style TargetType="telerikNavigation:RadPrompt" >
            <Setter Property="IsTabStop" Value="false" />
            <Setter Property="Width" Value="350" />
           
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerikNavigation:RadPrompt">
                        <Grid x:Name="LayoutRoot">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Image x:Name="Icon" Width="48" Height="48" VerticalAlignment="Top" Margin="16 8 8 8" Source="/Abm.CustomTheme;component/Themes/Alert_Question.png" />
                           
                            <StackPanel x:Name="PromptContent" Grid.Row="0" Grid.Column="1" >

                                <ScrollViewer  BorderThickness="0" Grid.Row="0" Grid.Column="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Margin="0 0 0 8">
                                    <ContentPresenter x:Name="PromptText" Margin="8 8 8 0" />
                                </ScrollViewer>
                               
                                <TextBox x:Name="PromptTextBox" Margin="8" />
                            </StackPanel>
                           

                            <StackPanel x:Name="DialogButtons" Grid.Row="2" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
                                <telerik:RadButton x:Name="OK" MinWidth="70" Content="OK" Margin="0 10 8 8" />
                                <telerik:RadButton x:Name="Cancel" MinWidth="70" Content="Cancel" Margin="0 10 8 8" />
                            </StackPanel>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- telerikNavigation:RadConfirm -->
        <Style  TargetType="telerikNavigation:RadConfirm">
            <Setter Property="IsTabStop" Value="false" />
            <Setter Property="MinWidth" Value="275" />
            <Setter Property="MaxWidth" Value="500" />
           
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerikNavigation:RadConfirm">
                        <Grid x:Name="LayoutRoot">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Image x:Name="Icon" Width="48" Height="48" VerticalAlignment="Top" Margin="16 8 8 8" Source="/Abm.CustomTheme;component/Themes/Alert_Question.png" />

                            <ScrollViewer  BorderThickness="0" Grid.Row="0" Grid.Column="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Margin="0 0 0 8">
                                <ContentPresenter x:Name="ConfirmText" Margin="8 8 8 0" />
                            </ScrollViewer>

                   
                            <StackPanel x:Name="DialogButtons" Grid.Row="2" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
                                <telerik:RadButton x:Name="OK" MinWidth="70" Content="OK" Margin="0 10 8 8"  />
                                <telerik:RadButton x:Name="Cancel" MinWidth="70" Content="Cancel" Margin="0 10 8 8"  />
                            </StackPanel>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- telerikNavigation:RadAlert -->
        <Style  TargetType="telerikNavigation:RadAlert">
            <Setter Property="IsTabStop" Value="false" />
            <Setter Property="MinWidth" Value="275" />
            <Setter Property="MaxWidth" Value="500" />
           
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerikNavigation:RadAlert">
                        <Grid x:Name="LayoutRoot">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Image x:Name="Icon" Width="48" Height="48" VerticalAlignment="Top" Margin="16 8 8 8" Source="/Abm.CustomTheme;component/Themes/Alert.png"/>
                            
                            <ScrollViewer  BorderThickness="0" Grid.Row="0" Grid.Column="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Margin="0 0 0 8">
                                <ContentPresenter x:Name="AlertText" Margin="8 8 8 0" />
                            </ScrollViewer>

           
                            <telerik:RadButton x:Name="OK" Grid.Row="2" Grid.ColumnSpan="2" MinWidth="70" HorizontalAlignment="Right" Content="OK" Margin="0 10 8 8"  />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
    </ResourceDictionary>






  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 30 Jul 2010 Link to this post

    Hello Fabiana,

     What I could suggest you is to set a TextBlock for Header of the RadWindow control and to set these properties directly to it.

    Hope this helps!

    Kind regards,
    Miroslav Nedyalkov
    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. DevCraft banner
  4. Fabiana
    Fabiana avatar
    69 posts
    Member since:
    Oct 2009

    Posted 30 Jul 2010 Link to this post

    Hi Miroslav,

    Thank you for your attention, but I don´t know how to do it? Do you have some example, please?

    Thanks!
  5. Pana
    Admin
    Pana avatar
    748 posts

    Posted 05 Aug 2010 Link to this post

    Hi Fabiana,

    You can open a rad window and set its header like this:
    private void Button_Click(object sender, RoutedEventArgs e)
    {
        RadWindow rw = new RadWindow();
        rw.Header = new TextBlock() { Text = "Header", FontSize = 16, FontWeight = FontWeights.Bold };
        rw.ShowDialog();
    }

    In XAML you can set the header like this:
    <telerik:RadWindow>
                <telerik:RadWindow.Header>
                    <TextBlock Text="Boldme" FontWeight="Bold" FontSize="16" />
                </telerik:RadWindow.Header>
            </telerik:RadWindow>

    but we do not encourage putting your windows directly in xaml.

    All the best,
    Panayot
    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. ss
    ss avatar
    37 posts
    Member since:
    Nov 2010

    Posted 08 Jun 2011 Link to this post

    HI Miroslav Nedyalkov ,

    i am using radwindow as a usercontrol in this case how to change the textblock text as per current screen title?

    and can you help me on heder template for rad window header.
  7. Pana
    Admin
    Pana avatar
    748 posts

    Posted 08 Jun 2011 Link to this post

    Hi,

    Here you are. The project shows how you can open custom rad window pretty much as new UserControls are created. It also sets the Header and defines HeaderTemplate.

    Best wishes,
    Pana
    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
  8. ss
    ss avatar
    37 posts
    Member since:
    Nov 2010

    Posted 08 Jun 2011 Link to this post

    Hi pana,

    Thanks for your responce.

    But the solution which you have given is not my exact problem clearance suggestion.

    actually i am creating the radwindow by click on button.at that time i need to asign the colourfull text to the header.

    can you suggest me in that point of view.

    at present i have tried with xmlredaer with data template and with textblock from codebehind(after botton clcik new radwindow created time before reach show process.) .

    exact case

    Radwindow

     

     

    radwindow= new Radwindow ();

     

    radwindow.Header =

     

    "Header" ;

    here the header i need to make it as colurfull.i mean background and font size.

     



    thnaks advance.
  9. Pana
    Admin
    Pana avatar
    748 posts

    Posted 08 Jun 2011 Link to this post

    Hi,

    Add this in the App.xaml's reasources:

    <

     

     

    DataTemplate x:Name="RedHeaderTemplate">
        
    <TextBlock Text="{Binding}" Foreground="Red" FontSize="16" FontWeight="Bold" />
    </
    DataTemplate>

     


    Easy:

     

     

    RadWindow rw = new RadWindow();
    rw.Header =
    "Hello window!";
    rw.HeaderTemplate =
    Application.Current.Resources["RedHeaderTemplate"] as DataTemplate;
    rw.Show();


    Kind regards,
    Pana
    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
  10. ss
    ss avatar
    37 posts
    Member since:
    Nov 2010

    Posted 08 Jun 2011 Link to this post

    Hi pana,

    its  wokring fine.

    thank you
  11. ss
    ss avatar
    37 posts
    Member since:
    Nov 2010

    Posted 09 Jun 2011 Link to this post

    Hi Pana,

    I have one more query .

    how to use the radwindow as messagebox with Ok and cancel button.and after button click i need to respond as per buttens.

    i have seen only the samples with radwindow.alert().
    there its coming only ok button.

    please help me on this.
  12. Pana
    Admin
    Pana avatar
    748 posts

    Posted 09 Jun 2011 Link to this post

    Hi,

    RadWindow has Alert (OK window button) as well as Prompt (with input TextBox) and the one you need - Confirm (with Yes and No).

    Kind regards,
    Pana
    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
  13. ss
    ss avatar
    37 posts
    Member since:
    Nov 2010

    Posted 09 Jun 2011 Link to this post

    ok thanks.

    and how to use the radwindow.confirm and radwindo.alert as a usercontrols to use in mnay cases by just passting the content.

    and how to chnage the icon in radwindow.confirm and radwindow.alert in simple way.
  14. Pana
    Admin
    Pana avatar
    748 posts

    Posted 15 Jun 2011 Link to this post

    Hello,

    You can get the XAML from the RadControls installation folder. For example on my computer it is located here:
    C:\Program Files (x86)\Telerik\RadControls for Silverlight Q1 2011 SP1\Themes\OfficeBlack\Themes\Office\Black\Window.xaml

    It has style for the RadConfirm, RadAlert and RadPrompt. You can move the desired style in your app xaml and modify the control template inside. The dialog parameters which can be passed in the RadWindow.Confirm for example has a ContentStyle property which you can set to the modified style.

    I am attaching both a project that demonstrates that and all styles for the RadWindow (the window.xaml I have mentioned)

    Regards,
    Pana
    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
  15. ss
    ss avatar
    37 posts
    Member since:
    Nov 2010

    Posted 17 Jun 2011 Link to this post

    ok.Thank you.

    But my scnario is.i have a class with name of Deletewindow.

    public

    partial class DeleteWindow : RadWindow

     {

    public DeleteWindow()

    {

    base.Header = "Delete";

    }

    }
    and below style i ma using. 

    <Style TargetType="telerikNavigation:RadConfirm" x:Key="ConfirmStyle">

    <Setter Property="IsTabStop" Value="false" />

    <Setter Property="MinWidth" Value="275" />

    <Setter Property="MaxWidth" Value="500" />

    <Setter Property="Background" Value="Red" />

    <Setter Property="Template">  

    <Setter.Value>

    <ControlTemplate TargetType="telerikNavigation:RadConfirm">  

    <Grid x:Name="LayoutRoot">  

    <Grid.RowDefinitions>

    <RowDefinition Height="*" /> 

    <RowDefinition Height="Auto" />  

    <RowDefinition Height="Auto" />  

    </Grid.RowDefinitions>  

    <Grid.ColumnDefinitions

    <ColumnDefinition Width="Auto" /> 

    <ColumnDefinition Width="*" />  

    </Grid.ColumnDefinitions>  

    <Image x:Name="Icon" Width="48" Height="48" VerticalAlignment="Top" Margin="16 8 8 8" Stretch="None"  

    Source="/SunixSilver;component/Images/question.png"/>  

    <TextBlock x:Name="ConfirmText" Grid.Row="0" Grid.Column="1" Margin="8 8 8 0" FontSize="12" TextWrapping="Wrap" Text="{TemplateBinding Content}"/>  

    <Border x:Name="HorizontalRule" Grid.Row="1" Grid.ColumnSpan="2" BorderThickness="0 0 0 1" Height="2" Background="{StaticResource BorderLineOuterColor}"  

    BorderBrush="{StaticResource BorderLineInnerColor}" VerticalAlignment="Top" />  

    <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Right"> 

    <telerik:RadButton x:Name="OK" MinWidth="70" HorizontalAlignment="Right" Content="OK" Margin="0 10 8 8"/>  

    <telerik:RadButton x:Name="Cancel" MinWidth="70" HorizontalAlignment="Right" Content="Cancel" Margin="0 10 8 8"/>  

    </StackPanel>  

    </Grid>  

    </ControlTemplate>  

    </Setter.Value
    </Setter>  

    </Style>

     

    instead of calling the stle in every where i can assign this style in deletewindow class.and then i can use just deletwindow in my required places. like below

    DeleteWindow .Confirm(new DialogParameters  

    Content = "required message"
    }

    the all style and header should be asisgn in deletewindow class itslef.

    can you suggest me in this point of view.

    but in your suggested sample the style is need to set in every where.pleas help me in  my case.

  16. Pana
    Admin
    Pana avatar
    748 posts

    Posted 17 Jun 2011 Link to this post

    Hello,

    Do you want to style all Confirm, Alert and Prompt windows in your application or you will have different styles for different instances? If you are about to use the same style for all Confirm dialogs you could create an implicit style (a style with TargetType and no x:Key in the app.xaml) for your application and it will apply without any code behind.

    Best wishes,
    Pana
    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
  17. ss
    ss avatar
    37 posts
    Member since:
    Nov 2010

    Posted 17 Jun 2011 Link to this post

    i want different style for different things(confirm,alert).
    but content is always diffreent for every scanario.

    but style and header should be same for.e.g for delete window header is delete.and style is confirm style.in delet window i am using another icon.
    and alert window hedaer is alert but style is alert style.and in alert window i need to show another icon.
  18. Pana
    Admin
    Pana avatar
    748 posts

    Posted 20 Jun 2011 Link to this post

    Hello,

    You do can create your own control but it will have to extend RadWindow and you will have to implement some custom logic yourself as well as move some XAML code in it. Refer to the attached window to see how you can define RadWindow as CustomControl add ControlTemplate with TemplateParts (buttons) and handle code for them in code behind. You will have to merge the desired addings for RadWindow with the ControlTemplate of the new 'confirm-delete' window however once ready you will be able to reuse it completely without assigning Styles.

    Regards,
    Pana
    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
  19. ss
    ss avatar
    37 posts
    Member since:
    Nov 2010

    Posted 20 Jun 2011 Link to this post

    Thank you.i will check the sample and let you know.
  20. ss
    ss avatar
    37 posts
    Member since:
    Nov 2010

    Posted 21 Jun 2011 Link to this post

    its working fine
Back to Top
DevCraft banner