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

Stopping Window animation

14 Answers 247 Views
Window
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 20 Mar 2012, 04:17 PM
Hi,

I have an application with multiple RadWindow and RadWindow.Alert. Some of them are in my project and the orther are in other project (DLL) associated to my application. I like to know how I can disable RadWindow/RadWindow.Alert animation for all my application and related DLL's?

PS: Are the persistence can take care of it if I disable the animation???

Thank's

14 Answers, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 23 Mar 2012, 09:48 AM
Hi Oliver,

To disable the animations of the RadWindow control you need just to set the AnimationManager.AnimationSelector attached property to the RadWindow to null. This will stop the animations of the RadWindow control.

Could you please give us more information on what properties do you want to save/restore? We have a persistence framework that you can try for this. You can find online examples here.

All the best,
Alex Fidanov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Oliver
Top achievements
Rank 1
answered on 23 Mar 2012, 02:17 PM
Hi,

I include my custom style file which contain the AnimationSelctor to null and the beginning of my xaml form file, I persist the whole dialog by setting a PersistenceManager.StorageId in teh RadWindow tag and on the Loaded event, I load the persistence. It's look like the animation still there.

PS: Can you tell me if it's possible to disabled all telerik controls animation?

Neuron-CustomStyles.xaml
----------------------------------

<ResourceDictionary
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">

    <Style TargetType="TextBox" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Office_BlueTheme, ElementType=TextBox}}" />
    <Style TargetType="CheckBox" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Office_BlueTheme, ElementType=CheckBox}}" />
    <Style TargetType="RadioButton" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Office_BlueTheme, ElementType=RadioButton}}" />
    <Style TargetType="ListBox" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Office_BlueTheme, ElementType=ListBox}}" />

    <Style TargetType="StatusBar">
        <Setter Property="Background" Value="#F1F5FB"/>
    </Style>

    <Style TargetType="GridSplitter">
        <Setter Property="Background" Value="#F1F5FB"/>
    </Style>

    <Style TargetType="{x:Type telerik:RadGridView}">
        <Setter Property="AlternationCount" Value="2"/>
        <Setter Property="GridLinesVisibility" Value="Vertical"/>
    </Style>

    <Style TargetType="telerik:RadWindow">       
        <Setter Property="telerik:AnimationManager.AnimationSelector" Value="{x:Null}" />
    </Style>
   
    <!--<Style TargetType="{x:Type telerik:GridViewGroupRow}">
        <Setter Property="ShowHeaderAggregates" Value="False"/>
    </Style>-->
   
    <!--<Style TargetType="{x:Type telerik:RadGridViewCell}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:RadGridViewCell}">
                    <Border Padding="4">
                        <ContentPresenter />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>-->

    <!--<Style TargetType="DataGridCell">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGridCell">
                    <Border Padding="15">
                        <ContentPresenter />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>-->

</ResourceDictionary>


BillingForm.xaml (just de beginning of the file)
---------------------------------------------------------
<telerik:RadWindow x:Class="com.christiegrp.Neuron.ClientApplication.BillingForm"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"       
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"       
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    xmlns:self="clr-namespace:com.christiegrp.Neuron.ClientApplication"   
    xmlns:helper="clr-namespace:com.christiegrp.Neuron.ClientApplication;assembly=ClientHelper"       
    xmlns:BillingModule="clr-namespace:com.christiegrp.Neuron.ClientApplication.LocalResources"
    Name="Me" PreviewClosed="Me_PreviewClosed" Loaded="Me_Loaded" SizeToContent="False"
    telerik:PersistenceManager.StorageId="BillingModule.BillingForm" Closed="Me_Closed" WindowStateChanged="Me_WindowStateChanged">
   
    <telerik:RadWindow.IconTemplate>
        <DataTemplate>
            <Image Source="Resources/BillingModule.png" Height="24" Width="24" Stretch="Fill" Margin="0 0 3 0" />
        </DataTemplate>       
    </telerik:RadWindow.IconTemplate>
   
    <telerik:RadWindow.Resources>       
        <ResourceDictionary>           
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="BillingForm-Fr-Res.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/Resources;component/Neuron-CustomStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>           
        </ResourceDictionary>       
    </telerik:RadWindow.Resources>
    
 
Thank's

0
Alex Fidanov
Telerik team
answered on 28 Mar 2012, 11:55 AM
Hello,

If you are using a style to set the animation selector, then why would you need to persist that property? As long as the style is applied, then the window should not have animations. Moreover, the style is merged in the RadWindow's dictionary, so it will be equivallent to setting the this property locally on the window itself.

All the best,
Alex Fidanov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Oliver
Top achievements
Rank 1
answered on 28 Mar 2012, 04:24 PM
Hi Alex,

I'm using a style for different things including to disable window animation but it's look like my RadWindow still having animation.
If I remove the AnimationSelector from my style, all RadWindow show/close operations have the same animation style.

Thank's
0
Ivo
Telerik team
answered on 03 Apr 2012, 05:10 PM
Hi Oliver,

You have to set the style to the class that derives from RadWindow and not to the RadWindow itself - into your case this is BillingForm. In WPF implicit styles do not apply to the ancestors of the TargetType and that is why the animation is still there.
<Style TargetType="local:BillingForm">       
        <Setter Property="telerik:AnimationManager.AnimationSelector" Value="{x:Null}" />
</Style>

Regards, Ivo
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Oliver
Top achievements
Rank 1
answered on 04 Apr 2012, 03:33 AM
Hi Ivo,

when I did what you told me to do, I had the following error message: Error 1 Type 'BillingForm' was not found. D:\Developpement\GestX.Courant\RisGC\Client\BillingModule\BillingForm.xaml 31 13 BillingModule

I'm I missing something???

PS: Here is my piece of code (without the style you told me to add, no compilation problem)

Thank's

<telerik:RadWindow x:Class="com.christiegrp.Neuron.ClientApplication.BillingForm"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls.Navigation;assembly=Telerik.Windows.Controls.Navigation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"       
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"       
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    xmlns:self="clr-namespace:com.christiegrp.Neuron.ClientApplication"   
    xmlns:helper="clr-namespace:com.christiegrp.Neuron.ClientApplication;assembly=ClientHelper"       
    xmlns:BillingModule="clr-namespace:com.christiegrp.Neuron.ClientApplication.LocalResources"
    Name="Me" PreviewClosed="Me_PreviewClosed" Loaded="Me_Loaded" SizeToContent="False"
    Closed="Me_Closed" WindowStateChanged="Me_WindowStateChanged" telerikNavigation:RadWindowInteropHelper.AllowTransparency="False">
   
    <telerik:RadWindow.IconTemplate>
        <DataTemplate>
            <Image Source="Resources/BillingModule.png" Height="24" Width="24" Stretch="Fill" Margin="0 0 3 0" />
        </DataTemplate>       
    </telerik:RadWindow.IconTemplate>

   
    <telerik:RadWindow.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="BillingForm-Fr-Res.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/Resources;component/Neuron-CustomStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>

    <Style TargetType="local:BillingForm">
        <Setter Property="telerik:AnimationManager.AnimationSelector" Value="{x:Null}" />
    </Style>

        </ResourceDictionary>
    </telerik:RadWindow.Resources>

0
Ivo
Telerik team
answered on 04 Apr 2012, 12:34 PM
Hi Oliver,

When I wrote "local:BillingForm" I meant to apply an implicit style to the BillingForm control instead of the RadWindow. You will have to define a XAML namespace that contains the BillingForm control into your ResourceDictionary. It will be something like:
xmlns:local="clr-namespace:com.christiegrp.Neuron.ClientApplication"   

I hope this helps you.

Regards, Ivo
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Oliver
Top achievements
Rank 1
answered on 04 Apr 2012, 02:43 PM
Hi Ivo,

since I add the suggested line, I have the following problem:

Error 1 Value 'telerik:AnimationManager.AnimationSelector' cannot be assigned to property 'Property'. The type initializer for 'com.christiegrp.Neuron.ClientApplication.BillingForm' threw an exception. D:\Developpement\GestX.Courant\RisGC\Client\BillingModule\BillingForm.xaml 29 25 BillingModule

Failed to instantiate type Telerik.Windows.Controls.Design.Common.MetadataRegistrationBase during IRegisterMetadata load for metadata assembly Telerik.Windows.Controls.VisualStudio.Design, Version=2011.3.1220.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.Failed to instantiate type Telerik.Windows.Controls.Design.Common.MetadataRegistrationBase during IRegisterMetadata load for metadata assembly Telerik.Windows.Controls.Input.VisualStudio.Design, Version=2011.3.1220.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.Failed to instantiate type Telerik.Windows.Controls.Design.Common.MetadataRegistrationBase during IRegisterMetadata load for metadata assembly Telerik.Windows.Controls.Navigation.VisualStudio.Design, Version=2011.3.1220.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.Failed to instantiate type Telerik.Windows.Controls.Design.Common.MetadataRegistrationBase during IRegisterMetadata load for metadata assembly Telerik.Windows.Controls.RichTextBoxUI.VisualStudio.Design, Version=2011.3.1220.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.Failed to instantiate type Telerik.Windows.Controls.Design.Common.MetadataRegistrationBase during IRegisterMetadata load for metadata assembly Telerik.Windows.Documents.VisualStudio.Design, Version=2011.3.1220.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.Failed to instantiate type Telerik.Windows.Controls.Design.Common.MetadataRegistrationBase during IRegisterMetadata load for metadata assembly Telerik.Windows.Controls.VisualStudio.Design, Version=2011.3.1220.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.Failed to instantiate type Telerik.Windows.Controls.Design.Common.MetadataRegistrationBase during IRegisterMetadata load for metadata assembly Telerik.Windows.Controls.Docking.VisualStudio.Design, Version=2011.3.1220.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.Failed to instantiate type Telerik.Windows.Controls.Design.Common.MetadataRegistrationBase during IRegisterMetadata load for metadata assembly Telerik.Windows.Controls.Navigation.VisualStudio.Design, Version=2011.3.1220.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.Failed to instantiate type Telerik.Windows.Controls.Design.Common.MetadataRegistrationBase during IRegisterMetadata load for metadata assembly Telerik.Windows.Controls.Input.VisualStudio.Design, Version=2011.3.1220.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.Failed to instantiate type Telerik.Windows.Controls.Design.Common.MetadataRegistrationBase during IRegisterMetadata load for metadata assembly Telerik.Windows.Controls.ScheduleView.VisualStudio.Design, Version=2011.3.1220.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.Failed to instantiate type Telerik.Windows.Controls.Design.Common.MetadataRegistrationBase during IRegisterMetadata load for metadata assembly Telerik.Windows.Documents.VisualStudio.Design, Version=2011.3.1220.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.


I tried to implement the samething in another RadWindow and I receive the following error message:

Error 5 '/Telerik.Windows.Controls.Navigation;component/Themes/GenericOfficeBlack.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. '/Telerik.Windows.Controls.Navigation;component/themes/office/black/TabControl.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Exception of type 'System.OutOfMemoryException' was thrown.  Error at object 'System.Windows.ResourceDictionary' in markup file 'Telerik.Windows.Controls.Navigation;component/Themes/GenericOfficeBlack.xaml'.  Error at object 'System.Windows.ResourceDictionary'. D:\Developpement\GestX.Courant\RisGC\Client\BillingModule\CancelableBatches.xaml 1 1 BillingModule

Thank's


0
Oliver
Top achievements
Rank 1
answered on 04 Apr 2012, 04:14 PM
Hi Ivo,

and if I want to remove tghe animation of: RadWIndow.Alert, RadWindow.Confirm and RadWindow.Prompt
what should I do???

PS: If I apply those settings, all child controls of the RadWindow will be affected (including any usercontrol) embeded in my RadWindow ?

Thank's
0
Ivo
Telerik team
answered on 05 Apr 2012, 12:18 PM
Hi Oliver,

Applying this style removes only the RadWindow's animation. To remove the RadWIndow.Alert, RadWindow.Confirm and RadWindow.Prompt you will have to return the code that you had before. Here is sample code from an application where I removed the animation from RadWindow.Alert, RadWindow.Confirm, RadWindow.Prompt and my custom RadWindow defined in XAML.
<Application x:Class="WpfWindows.App"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:local="clr-namespace:WpfWindows"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
         
        <!--This removes the RadWindow.Alert, RadWindow.Confirm, RadWindow.Prompt animations-->
        <Style TargetType="telerik:RadWindow">
            <Setter Property="telerik:AnimationManager.AnimationSelector" Value="{x:Null}" />
        </Style>
         
         
        <!--This removes the MyWindow animation-->
        <Style TargetType="local:MyWindow">
            <Setter Property="telerik:AnimationManager.AnimationSelector" Value="{x:Null}" />
        </Style>
 
    </Application.Resources>
</Application>

You can find the application attached.

Kind regards, Ivo
the Telerik team

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

0
Oliver
Top achievements
Rank 1
answered on 05 Apr 2012, 08:31 PM
Thank's Ivo for your quick answer,

as I specified in my last reply: "PS: If I apply those settings, all child controls of the RadWindow will be affected (including any usercontrol) embeded in my RadWindow ?"

Thank's
0
Ivo
Telerik team
answered on 06 Apr 2012, 09:34 AM
Hi Oliver,

No, applying these style removes only the RadWindow's animation and not the animation of its children. You will have to remove each control's animation individually.

Greetings, Ivo
the Telerik team

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

0
Oliver
Top achievements
Rank 1
answered on 09 Apr 2012, 06:19 PM
Hi,

ok nice, and disabling animation of RadWindow.Alert/Prompt/Dialogfrom code-behind, how I can acheive this?

Thank's
0
Ivo
Telerik team
answered on 10 Apr 2012, 08:15 AM
Hi Oliver,

You can disable the animation by registering an application style applied to all RadWindows. Here is sample code:
public partial class App : Application
{
    protected override void OnStartup(StartupEventArgs e)
    {
        base.OnStartup(e);
 
        Style radWindowStyle = new Style(typeof(RadWindow));
        radWindowStyle.Setters.Add(new Setter(AnimationManager.AnimationSelectorProperty, null));
        Resources.Add(typeof(RadWindow), radWindowStyle);
    }
}

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
Oliver
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Oliver
Top achievements
Rank 1
Ivo
Telerik team
Share this question
or