Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions AppControl Manager/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
x:Class="AppControlManager.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:media="using:CommunityToolkit.WinUI.Media"
xmlns:CCToolKit="using:CommonCore.ToolKits"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:customUI="using:AppControlManager.CustomUIElements">
<Application.Resources>
<ResourceDictionary>
Expand All @@ -13,6 +11,7 @@
<ResourceDictionary Source="ms-appx:///CustomUIElements/HomePageCarousel/OpacityMask.xaml" />
<ResourceDictionary Source="ms-appx:///CustomUIElements/HomePageCarousel/HeaderTile.xaml" />
<ResourceDictionary Source="ms-appx:///CustomUIElements/SegmentedStyles.xaml" />
<ResourceDictionary Source="ms-appx:///CustomUIElements/SettingsControls.xaml" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
Expand Down Expand Up @@ -105,7 +104,7 @@
</Setter>
</Style>

<media:AttachedCardShadow x:Key="BorderShadow" Offset="0" Color="Violet" BlurRadius="10" Opacity="50" CornerRadius="18" />
<CCToolKit:AttachedCardShadow x:Key="BorderShadow" Offset="0" Color="Violet" BlurRadius="10" Opacity="50" CornerRadius="18" />

<!-- Ensure the custom button maintains the regular button styles -->
<Style TargetType="customUI:ButtonV2" BasedOn="{StaticResource DefaultButtonStyle}" />
Expand All @@ -125,7 +124,7 @@


<!-- The styles of the Wrap Panel which is at the top of almost every page -->
<Style x:Key="PageHeaderWrapPanelStyle" TargetType="controls:WrapPanel">
<Style x:Key="PageHeaderWrapPanelStyle" TargetType="CCToolKit:WrapPanel">
<Setter Property="Grid.Row" Value="0"/>
<Setter Property="VerticalSpacing" Value="4"/>
<Setter Property="HorizontalSpacing" Value="4"/>
Expand All @@ -134,7 +133,7 @@
</Style>

<!-- The styles of the Wrap Panel that is inside the Expander for the toolbar of the page -->
<Style x:Key="UnifiedToolbarStyle" TargetType="controls:WrapPanel">
<Style x:Key="UnifiedToolbarStyle" TargetType="CCToolKit:WrapPanel">
<Setter Property="Padding" Value="6"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
Expand Down
4 changes: 3 additions & 1 deletion AppControl Manager/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ internal App()
Logger.Write(string.Format(Atlas.GetStr("AppStartupMessage"), Environment.Version));

// https://github.com/microsoft/WindowsAppSDK/blob/main/specs/VersionInfo/VersionInfo.md
Logger.Write($"Built with Windows App SDK: {ReleaseInfo.AsString} - Runtime Info: {RuntimeInfo.AsString}");
// This line would require us to add "Microsoft.WindowsAppSDK.Runtime" NuGet package as dependency which would add an extra 20MB size to the whole package.
// See issue: https://github.com/microsoft/WindowsAppSDK/issues/6387
// Logger.Write($"Built with Windows App SDK: {ReleaseInfo.AsString} - Runtime Info: {RuntimeInfo.AsString}");

try
{
Expand Down
21 changes: 2 additions & 19 deletions AppControl Manager/AppControl Manager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -194,40 +194,23 @@
<ItemGroup>

<!-- Main Packages - Without these packages, there will be compilation errors related to missing types -->
<PackageReference Include="CommunityToolkit.WinUI.Animations" Version="8.2.251219" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.251219" />
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.2.251219" />
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.4.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.83.3" />
<PackageReference Include="Microsoft.Identity.Client.Broker" Version="4.83.3" />
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.83.3" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.3.0-prerelease.251115.2" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.260317003" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="10.0.5" />
<PackageReference Include="Microsoft.WindowsAppSDK.WinUI" Version="1.8.260224000" />
<PackageReference Include="System.Diagnostics.EventLog" Version="10.0.5" />

<!-- Transitive Packages - Without these packages, there will not be compilation error related to missing types -->
<PackageReference Include="CommunityToolkit.WinUI.Triggers" Version="8.2.251219" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.251219" />
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.2.251219" />
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.2.251219" />
<PackageReference Include="CommunityToolkit.Common" Version="8.4.2" />
<PackageReference Include="Microsoft.IdentityModel.Abstractions" Version="8.17.0" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3856.49" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.28000.1721" />
<PackageReference Include="runtime.win-arm64.Microsoft.DotNet.ILCompiler" Version="10.0.5" />
<PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler" Version="10.0.5" />
<PackageReference Include="Microsoft.Identity.Client.NativeInterop" Version="0.20.4" />
<PackageReference Include="Microsoft.WindowsAppSDK.AI" Version="1.8.53" />
<PackageReference Include="Microsoft.WindowsAppSDK.Base" Version="1.8.251216001" />
<PackageReference Include="Microsoft.WindowsAppSDK.DWrite" Version="1.8.25122902" />
<PackageReference Include="Microsoft.WindowsAppSDK.Foundation" Version="1.8.260222000" />
<PackageReference Include="Microsoft.WindowsAppSDK.InteractiveExperiences" Version="1.8.260125001" />
<PackageReference Include="Microsoft.WindowsAppSDK.Runtime" Version="1.8.260317003" />
<PackageReference Include="Microsoft.WindowsAppSDK.Widgets" Version="1.8.251231004" />
<PackageReference Include="Microsoft.WindowsAppSDK.WinUI" Version="1.8.260224000" />
<PackageReference Include="Microsoft.WindowsAppSDK.ML" Version="1.8.2141" />
<PackageReference Include="System.Numerics.Tensors" Version="10.0.5" />
<PackageReference Include="Microsoft.WindowsAppSDK.InteractiveExperiences" Version="1.8.260125001" />
Comment thread
HotCakeX marked this conversation as resolved.
<PackageReference Include="Microsoft.Windows.SDK.BuildTools.MSIX" Version="1.7.260316102">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

using System.Threading;
using System.Threading.Tasks;
using CommunityToolkit.WinUI;
using CommunityToolkit.WinUI.Media;
using CommonCore.ToolKits;
using Microsoft.UI.Dispatching;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
Expand Down
3 changes: 1 addition & 2 deletions AppControl Manager/CustomUIElements/ButtonV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// See here for more information: https://github.com/HotCakeX/Harden-Windows-Security/blob/main/LICENSE
//

using CommunityToolkit.WinUI;
using CommunityToolkit.WinUI.Media;
using CommonCore.ToolKits;
using Microsoft.UI.Dispatching;
using Microsoft.UI.Input;
using Microsoft.UI.Xaml;
Expand Down
3 changes: 1 addition & 2 deletions AppControl Manager/CustomUIElements/ContentDialogV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
//

using System.Threading.Tasks;
using CommunityToolkit.WinUI;
using CommunityToolkit.WinUI.Media;
using CommonCore.ToolKits;
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AppControlManager.CustomUIElements"
xmlns:customUI="using:AppControlManager.CustomUIElements"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:CCToolKit="using:CommonCore.ToolKits"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
x:Uid="CustomPatternBasedFilePathsDialog"
IsPrimaryButtonEnabled="False"
Expand All @@ -19,7 +19,7 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<controls:WrapPanel Orientation="Vertical" Margin="0,0,0,15" Grid.Row="0" HorizontalSpacing="10" VerticalSpacing="10">
<CCToolKit:WrapPanel Orientation="Vertical" Margin="0,0,0,15" Grid.Row="0" HorizontalSpacing="10" VerticalSpacing="10">

<TextBlock IsTextSelectionEnabled="True" TextWrapping="Wrap" VerticalAlignment="Top" x:Uid="CustomPatternBasedFilePathsDialogTopTextBlock" />

Expand All @@ -34,7 +34,7 @@
</HyperlinkButton.ContentTemplate>
</HyperlinkButton>

</controls:WrapPanel>
</CCToolKit:WrapPanel>

<ListView x:Name="CustomPatternBasedFilePathListView"
Grid.Row="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:customUI="using:AppControlManager.CustomUIElements"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:CCToolKit="using:CommonCore.ToolKits"
DefaultButton="Close"
IsEnabled="{x:Bind AreElementsEnabled, Mode=OneWay}"
x:Uid="CustomPoliciesLibraryCacheLocationManagerDialog">
Expand Down Expand Up @@ -35,7 +35,7 @@
Text="{x:Bind AppSettings.CustomSidebarPoliciesLibraryCacheLocation, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center" />

<controls:WrapPanel Orientation="Horizontal"
<CCToolKit:WrapPanel Orientation="Horizontal"
HorizontalAlignment="Center"
HorizontalSpacing="10"
VerticalSpacing="10">
Expand Down Expand Up @@ -85,7 +85,7 @@
</Button.ContentTemplate>
</Button>

</controls:WrapPanel>
</CCToolKit:WrapPanel>

</StackPanel>

Expand Down
25 changes: 12 additions & 13 deletions AppControl Manager/CustomUIElements/GraphAuthPanel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
x:Class="AppControlManager.CustomUIElements.GraphAuthPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:animatedvisuals="using:AnimatedVisuals"
xmlns:MSGraph="using:CommonCore.MicrosoftGraph"
xmlns:CCToolKit="using:CommonCore.ToolKits"
Expand Down Expand Up @@ -103,17 +102,17 @@
</CCToolKit:SegmentedItem>
</CCToolKit:Segmented>

<controls:SwitchPresenter Value="{x:Bind ((CCToolKit:SegmentedItem)segmentedControl1.SelectedItem).Tag, Mode=OneWay}" HorizontalAlignment="Center" VerticalAlignment="Center">
<CCToolKit:SwitchPresenter TargetValue="{x:Bind ((CCToolKit:SegmentedItem)segmentedControl1.SelectedItem).Tag, Mode=OneWay}" HorizontalAlignment="Center" VerticalAlignment="Center">

<controls:Case Value="Active">
<CCToolKit:Case TargetValue="Active">
<StackPanel Style="{StaticResource PanelStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal" Spacing="10" Padding="10">

<controls:WrapPanel Orientation="Vertical" VerticalSpacing="5" HorizontalSpacing="10" HorizontalAlignment="Center">
<CCToolKit:WrapPanel Orientation="Vertical" VerticalSpacing="5" HorizontalSpacing="10" HorizontalAlignment="Center">

<controls:WrapPanel.Resources>
<CCToolKit:WrapPanel.Resources>
<ResourceDictionary
Source="ms-appx:///Microsoft.UI.Xaml/DensityStyles/Compact.xaml"/>
</controls:WrapPanel.Resources>
</CCToolKit:WrapPanel.Resources>

<TextBlock x:Uid="CurrentlyInUseAccountDetailsTextBlock"
Margin="0,0,0,5"
Expand All @@ -126,13 +125,13 @@
<TextBox IsReadOnly="True" x:Uid="CurrentActiveAccountPermissions" Text="{x:Bind Host.AuthCompanionCLS.CurrentActiveAccountPermissions, Mode=OneWay}" Margin="0,5,0,0" HorizontalAlignment="Center" Width="470"/>
<TextBox IsReadOnly="True" x:Uid="CurrentActiveAccountEnvironment" Text="{x:Bind Host.AuthCompanionCLS.CurrentActiveAccountEnvironment, Mode=OneWay}" Margin="0,5,0,0" HorizontalAlignment="Center" Width="470"/>

</controls:WrapPanel>
</CCToolKit:WrapPanel>

</StackPanel>

</controls:Case>
</CCToolKit:Case>

<controls:Case Value="Authentication">
<CCToolKit:Case TargetValue="Authentication">
<StackPanel Style="{StaticResource PanelStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Vertical" Spacing="10" Padding="10">

<StackPanel Orientation="Horizontal" Spacing="10" HorizontalAlignment="Center">
Expand Down Expand Up @@ -271,9 +270,9 @@
</Border>

</StackPanel>
</controls:Case>
</CCToolKit:Case>

<controls:Case Value="SignedIn">
<CCToolKit:Case TargetValue="SignedIn">

<StackPanel Style="{StaticResource PanelStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Vertical" Spacing="5" Padding="3">

Expand Down Expand Up @@ -380,8 +379,8 @@

</StackPanel>

</controls:Case>
</controls:SwitchPresenter>
</CCToolKit:Case>
</CCToolKit:SwitchPresenter>

</StackPanel>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@
// SOFTWARE
//

using CommunityToolkit.WinUI.Animations;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Animation;
using Microsoft.UI.Xaml.Media.Imaging;

namespace AppControlManager.CustomUIElements.HomePageCarousel;

internal sealed partial class AnimatedImage : UserControl
{
private AnimationSet? selectAnimation;
private Storyboard? selectAnimation;

private static readonly DependencyProperty ImageUrlProperty = DependencyProperty.Register(
nameof(ImageUrl),
Expand All @@ -71,23 +71,45 @@ public Uri ImageUrl

private void AnimatedImage_Unloaded(object sender, RoutedEventArgs e)
{
selectAnimation?.Completed -= SelectAnimation_Completed;
selectAnimation = null;
if (selectAnimation is not null)
{
selectAnimation.Completed -= SelectAnimation_Completed;
selectAnimation.Stop();
selectAnimation = null;
}
}

private void IsImageChanged(Uri oldValue, Uri newValue)
{
BottomImage.Source = new BitmapImage(ImageUrl);
BottomImage.Opacity = 1;

selectAnimation?.Completed -= SelectAnimation_Completed;
if (selectAnimation is not null)
{
selectAnimation.Completed -= SelectAnimation_Completed;
selectAnimation.Stop();
}

selectAnimation = new Storyboard();

// Using a DoubleAnimation targeting the XAML Opacity property so the BackdropBrush
// correctly invalidates and blurs every frame.
DoubleAnimation opacityAnimation = new()
{
From = 1.0,
To = 0.0,
Duration = new Duration(TimeSpan.FromMilliseconds(800))
};

Storyboard.SetTarget(opacityAnimation, TopImage);
Storyboard.SetTargetProperty(opacityAnimation, "Opacity");
selectAnimation.Children.Add(opacityAnimation);

selectAnimation = [new OpacityAnimation() { From = 1, To = 0, Duration = TimeSpan.FromMilliseconds(800) }];
selectAnimation.Completed += SelectAnimation_Completed;
selectAnimation.Start(TopImage);
selectAnimation.Begin();
}

private void SelectAnimation_Completed(object? sender, EventArgs e)
private void SelectAnimation_Completed(object? sender, object e)
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AppControlManager.CustomUIElements.HomePageCarousel"
xmlns:media="using:CommunityToolkit.WinUI.Media"
xmlns:common="using:CommonCore.ToolKits"
Loaded="{x:Bind UserControl_Loaded}"
Unloaded="{x:Bind UserControl_Unloaded}">
<UserControl.Resources>
Expand Down Expand Up @@ -129,11 +129,11 @@
Height="400"
ImageUrl="ms-appx:///Assets/TileImages/BackgroundBlur.png"
Visibility="Visible">
<media:UIElementExtensions.VisualFactory>
<media:PipelineVisualFactory>
<media:BlurEffect Amount="100.0" />
</media:PipelineVisualFactory>
</media:UIElementExtensions.VisualFactory>
<common:UIElementExtensions.VisualFactory>
<common:PipelineVisualFactory>
<common:BlurEffect Amount="100.0" />
</common:PipelineVisualFactory>
</common:UIElementExtensions.VisualFactory>
</local:AnimatedImage>
</local:OpacityMaskView>

Expand Down Expand Up @@ -287,4 +287,4 @@
</Grid>
</StackPanel>
</Grid>
</UserControl>
</UserControl>
Loading
Loading