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
using Windows.UI.ViewManagement; | |
using Windows.Graphics.Display; | |
using Windows.Foundation; | |
var bounds = ApplicationView.GetForCurrentView().VisibleBounds; | |
var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel; | |
var size = new Size(bounds.Width*scaleFactor, bounds.Height*scaleFactor); |
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
// ParallaxImage is an Image Control | |
// ParallaxCanvas (Canvas type) is ParallaxImag's parent | |
_backgroundVisual = ElementCompositionPreview.GetElementVisual(ParallaxImage); | |
_backgroundCompositor = _backgroundVisual.Compositor; | |
var color = new Windows.UI.Color() { | |
A = 0, | |
B = 250, | |
R = 50, | |
G = 90 |
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
<Grid> | |
<!-- Setting the parallax image inside a canvas allows the image to be larger than the screen --> | |
<Canvas x:Name="ParallaxCanvas"> | |
<!-- The image we will animate --> | |
<Image x:Name="ParallaxImage" | |
Opacity="0" | |
ImageOpened="ParallaxImage_ImageOpened" | |
Loaded="ParallaxImage_Loaded"/> | |
</Canvas> | |
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
using Windows.UI.Composition; | |
using Windows.UI.Xaml.Controls; | |
using Windows.UI.Xaml.Hosting; | |
private Visual _backgroundVisual; | |
private Compositor _backgroundCompositor; | |
private ScrollViewer _ListQuotesScrollViewer; | |
private CompositionPropertySet _ListQuotesScrollerPropertySet; | |
// Fire when the Image control is loaded |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Windows.Foundation; | |
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Controls; | |
using Windows.UI.Xaml.Controls.Primitives; | |
using Windows.UI.Xaml.Media; |
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
using Windows.UI.Composition; | |
using Windows.UI.Xaml.Controls; | |
using Windows.UI.Xaml.Hosting; | |
private Visual _backgroundVisual; | |
private Compositor _backgroundCompositor; | |
private ScrollViewer _ListQuotesScrollViewer; | |
private CompositionPropertySet _ListQuotesScrollerPropertySet; | |
// Fire when the Image control is loaded |
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
using Windows.UI.Core; | |
// This sample code shows how to perform | |
// a navigation back on backspace key or escape key | |
// but the code can be adapted to any scenario | |
// involving keyboard event triggering an action | |
namespace app.Views { | |
public sealed partial class MainPage : Page { |
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
<SemanticZoom x:Name="SemanticZoomAuthors" IsZoomOutButtonEnabled="True" ScrollViewer.ZoomMode="Enabled"> | |
<SemanticZoom.ZoomedOutView> | |
<GridView x:Name="AuthorsKeys" | |
SelectionMode="None" | |
HorizontalAlignment="Center" | |
Padding="30"> | |
<GridView.ItemTemplate> | |
<DataTemplate> | |
<TextBlock Text="{Binding Group.Key}" Width="50" FontSize="46" Margin="20" Foreground="{ThemeResource SystemControlHighlightAccentBrush}"/> | |
</DataTemplate> |
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 code works with SemanticZoom.xaml gist | |
// It show you how to bind data to a CollectionViewSource | |
// in order to use a SemanticView control | |
// NOTE: Author is a custom model I created in my code | |
// See the model definition here | |
// https://github.com/rootasjey/citations365/blob/master/Citations%20365/Citations%20365/Models/Author.cs | |
private void BindCollectionToView() { | |
// 1.You need a data list |
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
public async void RegisterBackgroundTask(string taskName, string entryPoint) { | |
// If the task is already registered, don't registered it again | |
foreach (var task in BackgroundTaskRegistration.AllTasks) { | |
if (task.Value.Name == taskName) { | |
return; | |
} | |
} | |
BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync(); | |
if (status == BackgroundAccessStatus.DeniedBySystemPolicy || |