3636using Windows . UI . Xaml . Hosting ;
3737using Windows . UI . Xaml . Input ;
3838using Windows . UI . Xaml . Media ;
39+ using Windows . UI . Xaml . Media . Animation ;
3940
4041namespace Telegram . Controls
4142{
@@ -48,7 +49,7 @@ public ProfileHeader()
4849 InitializeComponent ( ) ;
4950 DescriptionLabel . AddHandler ( ContextRequestedEvent , new TypedEventHandler < UIElement , ContextRequestedEventArgs > ( About_ContextRequested ) , true ) ;
5051
51- HeaderRoot . CreateInsetClip ( ) ;
52+ // HeaderRoot.CreateInsetClip();
5253
5354 ActualThemeChanged += OnActualThemeChanged ;
5455 SizeChanged += OnSizeChanged ;
@@ -71,6 +72,33 @@ private void OnSizeChanged(object sender, SizeChangedEventArgs e)
7172 }
7273 }
7374
75+ public void AnimateEntrance ( )
76+ {
77+ var service = ConnectedAnimationService . GetForCurrentView ( ) ;
78+
79+ void Start ( UIElement element , string key )
80+ {
81+ var animation = service . GetAnimation ( key ) ;
82+ if ( animation != null )
83+ {
84+ animation . Configuration = new BasicConnectedAnimationConfiguration ( ) ;
85+ animation . TryStart ( element ) ;
86+ }
87+ }
88+
89+ Start ( HeaderPhoto , "Photo" ) ;
90+ Start ( TitleRoot , "Title" ) ;
91+ Start ( SubtitleRoot , "Subtitle" ) ;
92+ }
93+
94+ public void PrepareExit ( )
95+ {
96+ var service = ConnectedAnimationService . GetForCurrentView ( ) ;
97+ service . PrepareToAnimate ( "Photo" , HeaderPhoto ) ;
98+ service . PrepareToAnimate ( "Title" , TitleRoot ) ;
99+ service . PrepareToAnimate ( "Subtitle" , SubtitleRoot ) ;
100+ }
101+
74102 public CompositionPropertySet Properties { get ; }
75103
76104 public double OccludedHeight => ViewModel . IsSavedMessages ? 0 : HeaderRoot . ActualHeight - 48 ;
0 commit comments