This commit is contained in:
dan_clark@outlook.com
2022-03-23 15:44:32 +00:00
commit 2ac0e3ed26
129 changed files with 4197 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
<xamlhost:XamlApplication
x:Class="TheXamlGuy.TaskbarGroup.Flyout.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
xmlns:xamlhost="using:Microsoft.Toolkit.Win32.UI.XamlHost">
<Application.Resources>
<controls:XamlControlsResources />
</Application.Resources>
</xamlhost:XamlApplication>
@@ -0,0 +1,20 @@
using Microsoft.Toolkit.Win32.UI.XamlHost;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
namespace TheXamlGuy.TaskbarGroup.Flyout
{
public sealed partial class App : XamlApplication
{
public App()
{
Initialize();
}
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
(Window.Current as object as IWindowPrivate).TransparentBackground = true;
base.OnLaunched(args);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

@@ -0,0 +1,77 @@
using System;
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media.Animation;
namespace TheXamlGuy.TaskbarGroup.Flyout.Controls
{
public class TaskbarButtonFlyout : ContentControl
{
public static readonly DependencyProperty TemplateSettingsProperty =
DependencyProperty.Register(nameof(TemplateSettings),
typeof(TaskbarButtonFlyoutTemplateSettings), typeof(TaskbarButtonFlyout),
new PropertyMetadata(null));
private UIElement child;
private Border container;
public TaskbarButtonFlyout()
{
DefaultStyleKey = typeof(TaskbarButtonFlyout);
TemplateSettings = new TaskbarButtonFlyoutTemplateSettings();
}
public event EventHandler<object> Closed;
public event EventHandler<object> Opened;
public TaskbarButtonFlyoutTemplateSettings TemplateSettings
{
get => (TaskbarButtonFlyoutTemplateSettings)GetValue(TemplateSettingsProperty);
set => SetValue(TemplateSettingsProperty, value);
}
public bool IsOpen { get; private set; }
public void Close()
{
if(container is not null)
{
container.Child = null;
}
}
protected override void OnApplyTemplate()
{
container = GetTemplateChild("Container") as Border;
if (container != null)
{
child = container.Child;
container.Child = null;
}
}
public void ShowAt(TaskbarButtonFlyoutPlacement taskbarPlacement)
{
VisualStateManager.GoToState(this, "DefaultPlacement", true);
child.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
var width = child.DesiredSize.Width - 1;
var height = child.DesiredSize.Height - 1;
TemplateSettings.SetValue(TaskbarButtonFlyoutTemplateSettings.HeightProperty, height);
TemplateSettings.SetValue(TaskbarButtonFlyoutTemplateSettings.WidthProperty, width);
TemplateSettings.SetValue(TaskbarButtonFlyoutTemplateSettings.NegativeHeightProperty, -height);
TemplateSettings.SetValue(TaskbarButtonFlyoutTemplateSettings.NegativeWidthProperty, -width);
VisualStateManager.GoToState(this, $"{taskbarPlacement}Placement", true);
container.Child = child;
}
}
}
@@ -0,0 +1,115 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:TheXamlGuy.TaskbarGroup.Flyout.Controls">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<AcrylicBrush
x:Key="AcrylicBackgroundFillColorBrush"
BackgroundSource="HostBackdrop"
FallbackColor="#2C2C2C"
TintColor="#2C2C2C"
TintOpacity="0.8" />
<StaticResource x:Key="TaskbarButtonFlyoutBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush" />
<StaticResource x:Key="TaskbarButtonFlyoutBackgroundBrush" ResourceKey="AcrylicBackgroundFillColorBrush" />
<Thickness x:Key="TaskbarButtonFlyoutBorderWidth">1</Thickness>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<AcrylicBrush
x:Key="AcrylicBackgroundFillColorBrush"
BackgroundSource="HostBackdrop"
FallbackColor="#F9F9F9"
TintColor="#FCFCFC"
TintOpacity="0.8" />
<StaticResource x:Key="TaskbarButtonFlyoutBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush" />
<StaticResource x:Key="TaskbarButtonFlyoutBackgroundBrush" ResourceKey="AcrylicBackgroundFillColorBrush" />
<Thickness x:Key="TaskbarButtonFlyoutBorderWidth">1</Thickness>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<AcrylicBrush
x:Key="NotificationFlyoutPresenterBackgroundAccentBrush"
BackgroundSource="HostBackdrop"
FallbackColor="{ThemeResource SystemAccentColorDark1}"
TintColor="{ThemeResource SystemAccentColorDark1}"
TintOpacity="0.8" />
<Style TargetType="controls:TaskbarButtonFlyout">
<Setter Property="BorderThickness" Value="{ThemeResource TaskbarButtonFlyoutBorderWidth}" />
<Setter Property="BorderBrush" Value="{ThemeResource TaskbarButtonFlyoutBorderBrush}" />
<Setter Property="Background" Value="{ThemeResource TaskbarButtonFlyoutBackgroundBrush}" />
<Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:TaskbarButtonFlyout">
<Border x:Name="Container" Margin="{TemplateBinding Margin}">
<Grid x:Name="LayoutRoot">
<Border
x:Name="BackgroundElement"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{TemplateBinding Background}"
BackgroundSizing="OuterBorderEdge"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Border.Transitions>
<TransitionCollection>
<EntranceThemeTransition x:Name="EntranceThemeTransition" />
</TransitionCollection>
</Border.Transitions>
<Grid>
<ContentControl
x:Name="ContentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}" />
</Grid>
</Border>
</Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="PlacementStates">
<VisualState x:Name="DefaultPlacement" />
<VisualState x:Name="BottomPlacement">
<VisualState.Setters>
<Setter Target="EntranceThemeTransition.FromHorizontalOffset" Value="0" />
<Setter Target="EntranceThemeTransition.FromVerticalOffset" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.Height}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="TopPlacement">
<VisualState.Setters>
<Setter Target="EntranceThemeTransition.FromHorizontalOffset" Value="0" />
<Setter Target="EntranceThemeTransition.FromVerticalOffset" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.NegativeHeight}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="LeftPlacement">
<VisualState.Setters>
<Setter Target="EntranceThemeTransition.FromHorizontalOffset" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.NegativeWidth}" />
<Setter Target="EntranceThemeTransition.FromVerticalOffset" Value="0" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="RightPlacement">
<VisualState.Setters>
<Setter Target="EntranceThemeTransition.FromHorizontalOffset" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.Width}" />
<Setter Target="EntranceThemeTransition.FromVerticalOffset" Value="0" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ThemeStates">
<VisualState x:Name="DefaultTheme" />
<VisualState x:Name="ColorPrevalenceTheme">
<VisualState.Setters>
<Setter Target="BackgroundElement.Background" Value="{ThemeResource TaskbarButtonFlyoutPresenterBackgroundBrush}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
@@ -0,0 +1,10 @@
namespace TheXamlGuy.TaskbarGroup.Flyout.Controls
{
public enum TaskbarButtonFlyoutPlacement
{
Left,
Top,
Right,
Bottom,
}
}
@@ -0,0 +1,50 @@
using Windows.UI.Xaml;
namespace TheXamlGuy.TaskbarGroup.Flyout.Controls
{
public class TaskbarButtonFlyoutTemplateSettings : DependencyObject
{
public static readonly DependencyProperty HeightProperty =
DependencyProperty.Register(nameof(Height),
typeof(double), typeof(TaskbarButtonFlyoutTemplateSettings),
new PropertyMetadata(0d));
public static readonly DependencyProperty NegativeHeightProperty =
DependencyProperty.Register(nameof(NegativeHeight),
typeof(double), typeof(TaskbarButtonFlyoutTemplateSettings),
new PropertyMetadata(0d));
public static readonly DependencyProperty NegativeWidthProperty =
DependencyProperty.Register(nameof(NegativeWidth),
typeof(double), typeof(TaskbarButtonFlyoutTemplateSettings),
new PropertyMetadata(0d));
public static readonly DependencyProperty WidthProperty =
DependencyProperty.Register(nameof(Width),
typeof(double), typeof(TaskbarButtonFlyoutTemplateSettings),
new PropertyMetadata(0d));
public double Height
{
get => (double)GetValue(HeightProperty);
set => SetValue(HeightProperty, value);
}
public double NegativeHeight
{
get => (double)GetValue(NegativeHeightProperty);
set => SetValue(NegativeHeightProperty, value);
}
public double NegativeWidth
{
get => (double)GetValue(NegativeWidthProperty);
set => SetValue(NegativeWidthProperty, value);
}
public double Width
{
get => (double)GetValue(WidthProperty);
set => SetValue(WidthProperty, value);
}
}
}
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">
<Identity
Name="0abc410a-f3f8-42ba-8eba-1fc1f13f5548"
Publisher="CN=Daniel Clark"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="0abc410a-f3f8-42ba-8eba-1fc1f13f5548" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>TheXamlGuy.TaskbarGroup.Flyout</DisplayName>
<PublisherDisplayName>Daniel Clark</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="TheXamlGuy.TaskbarGroup.Flyout.App">
<uap:VisualElements
DisplayName="TheXamlGuy.TaskbarGroup.Flyout"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="TheXamlGuy.TaskbarGroup.Flyout"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>
@@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TheXamlGuy.TaskbarGroup.Flyout")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TheXamlGuy.TaskbarGroup.Flyout")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
@@ -0,0 +1,31 @@
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.
Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919
To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Serialize="All" />
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
<!-- Add your application specific runtime directives here. -->
</Application>
</Directives>
@@ -0,0 +1,159 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{4B56828E-30D0-4EAF-89BC-480480989E6C}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TheXamlGuy.TaskbarGroup.Flyout</RootNamespace>
<AssemblyName>TheXamlGuy.TaskbarGroup.Flyout</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.19041.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\TaskbarButtonFlyoutPlacement.cs" />
<Compile Include="Controls\TaskbarButtonFlyoutTemplateSettings.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Controls\TaskbarButtonFlyout.cs" />
<Compile Include="Views\TaskbarButtonGroupItemViewModel.cs" />
<Compile Include="Views\TaskbarButtonGroupView.xaml.cs">
<DependentUpon>TaskbarButtonGroupView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\TaskbarButtonGroupViewModel.cs" />
<Compile Include="Views\TaskbarButtonView.xaml.cs">
<DependentUpon>TaskbarButtonView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\TaskbarButtonViewModel.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.12</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Win32.UI.XamlApplication">
<Version>6.1.3</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.8.0-prerelease.220118001</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Page Include="Controls\TaskbarButtonFlyout.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Generic.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\TaskbarButtonGroupView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\TaskbarButtonView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TheXamlGuy.TaskbarGroup.Core\TheXamlGuy.TaskbarGroup.Core.csproj">
<Project>{40D170F4-F8C1-4FAE-8A22-A22BF096BBEF}</Project>
<Name>TheXamlGuy.TaskbarGroup.Core</Name>
</ProjectReference>
<ProjectReference Include="..\TheXamlGuy.TaskbarGroup.Flyout.Foundation\TheXamlGuy.TaskbarGroup.Flyout.Foundation.csproj">
<Project>{35b035a4-e21b-4379-936b-6deda31af860}</Project>
<Name>TheXamlGuy.TaskbarGroup.Flyout.Foundation</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"></Target><Target Name="AfterBuild"></Target>
-->
</Project>
@@ -0,0 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Controls/TaskbarButtonFlyout.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
@@ -0,0 +1,15 @@
using TheXamlGuy.TaskbarGroup.Core;
namespace TheXamlGuy.TaskbarGroup.Flyout
{
public class TaskbarButtonGroupItemViewModel : ObservableViewModel
{
public TaskbarButtonGroupItemViewModel(IMessenger messenger,
IServiceFactory serviceFactory,
IDisposer disposer) : base(messenger, serviceFactory, disposer)
{
}
public string Name { get; set; }
}
}
@@ -0,0 +1,34 @@
<UserControl
x:Class="TheXamlGuy.TaskbarGroup.Flyout.TaskbarButtonGroupView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
AllowDrop="True">
<StackPanel>
<TextBox HorizontalAlignment="Stretch" Text="{x:Bind ViewModel.Name, Mode=TwoWay}" />
<GridView
x:Name="GridView"
IsItemClickEnabled="True"
ItemsSource="{x:Bind ViewModel}"
SelectionMode="None">
<GridView.ItemContainerStyle>
<Style TargetType="GridViewItem">
<Setter Property="Margin" Value="0" />
</Style>
</GridView.ItemContainerStyle>
<GridView.ItemTemplate>
<DataTemplate>
<Border
Width="94"
Height="84"
Background="Transparent" />
</DataTemplate>
</GridView.ItemTemplate>
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid MaximumRowsOrColumns="2" Orientation="Horizontal" />
</ItemsPanelTemplate>
</GridView.ItemsPanel>
</GridView>
</StackPanel>
</UserControl>
@@ -0,0 +1,16 @@
using TheXamlGuy.TaskbarGroup.Core;
using TheXamlGuy.TaskbarGroup.Flyout.Foundation;
namespace TheXamlGuy.TaskbarGroup.Flyout
{
public sealed partial class TaskbarButtonGroupView : IBindViewModel<TaskbarButtonGroupViewModel>
{
public TaskbarButtonGroupView()
{
InitializeComponent();
this.Bind();
}
public TaskbarButtonGroupViewModel ViewModel { get; set; }
}
}
@@ -0,0 +1,23 @@
using CommunityToolkit.Mvvm.ComponentModel;
using TheXamlGuy.TaskbarGroup.Core;
namespace TheXamlGuy.TaskbarGroup.Flyout
{
public partial class TaskbarButtonGroupViewModel : ObservableCollectionViewModel<TaskbarButtonGroupItemViewModel>
{
public TaskbarButtonGroupViewModel(IMessenger messenger,
IServiceFactory serviceFactory,
IDisposer disposer) : base(messenger, serviceFactory, disposer)
{
Register<FileDropped>(OnFileDropped);
}
[ObservableProperty]
private string name = "hello";
private void OnFileDropped(FileDropped args)
{
Add();
}
}
}
@@ -0,0 +1,13 @@
<UserControl
x:Class="TheXamlGuy.TaskbarGroup.Flyout.TaskbarButtonView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Border>
<ContentControl
Margin="12"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
Content="{x:Bind ViewModel.TaskbarButtonGroupViewModel}"
ContentTemplateSelector="{x:Bind ViewModel.TemplateSelector}" />
</Border>
</UserControl>
@@ -0,0 +1,14 @@
using TheXamlGuy.TaskbarGroup.Core;
namespace TheXamlGuy.TaskbarGroup.Flyout
{
public sealed partial class TaskbarButtonView : IBindViewModel<TaskbarButtonViewModel>
{
public TaskbarButtonView()
{
InitializeComponent();
}
public TaskbarButtonViewModel ViewModel { get; set; }
}
}
@@ -0,0 +1,22 @@
using TheXamlGuy.TaskbarGroup.Core;
using TheXamlGuy.TaskbarGroup.Flyout.Foundation;
namespace TheXamlGuy.TaskbarGroup.Flyout
{
public class TaskbarButtonViewModel : ObservableViewModel
{
public TaskbarButtonViewModel(IMessenger messenger,
IServiceFactory serviceFactory,
IDisposer disposer,
TemplateSelector templateSelector,
TaskbarButtonGroupViewModel taskbarButtonGroupViewModel) : base(messenger, serviceFactory, disposer)
{
TemplateSelector = templateSelector;
TaskbarButtonGroupViewModel = taskbarButtonGroupViewModel;
}
public TemplateSelector TemplateSelector { get; }
public TaskbarButtonGroupViewModel TaskbarButtonGroupViewModel { get; }
}
}