-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from microsoft/niels9001/homepage-tweaks
[HomePage] Adding scrolling and visual improvements
- Loading branch information
Showing
14 changed files
with
198 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Microsoft.UI; | ||
using Microsoft.UI.Composition; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Media; | ||
|
||
namespace AIDevGallery.Controls; | ||
|
||
internal partial class AmbLight : XamlLight | ||
{ | ||
private static readonly string Id = typeof(AmbLight).FullName!; | ||
|
||
protected override void OnConnected(UIElement newElement) | ||
{ | ||
Compositor compositor = CompositionTarget.GetCompositorForCurrentThread(); | ||
|
||
// Create AmbientLight and set its properties | ||
AmbientLight ambientLight = compositor.CreateAmbientLight(); | ||
ambientLight.Color = Colors.White; | ||
|
||
// Associate CompositionLight with XamlLight | ||
CompositionLight = ambientLight; | ||
|
||
// Add UIElement to the Light's Targets | ||
AddTargetElement(GetId(), newElement); | ||
} | ||
|
||
protected override void OnDisconnected(UIElement oldElement) | ||
{ | ||
// Dispose Light when it is removed from the tree | ||
RemoveTargetElement(GetId(), oldElement); | ||
CompositionLight.Dispose(); | ||
} | ||
|
||
protected override string GetId() | ||
{ | ||
return Id; | ||
} | ||
} |
Oops, something went wrong.