Skip to content

Commit

Permalink
ButtonsOnTitleBarSample
Browse files Browse the repository at this point in the history
  • Loading branch information
NotYoojun committed Oct 1, 2024
1 parent 65fa2a8 commit e3e0500
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 1 deletion.
25 changes: 24 additions & 1 deletion iNKORE.UI.WPF.Modern.sln
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NavigationViewExample", "sa
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acrylic10Example", "samples\Acrylic10Example\Acrylic10Example.csproj", "{84C80EA6-0F9C-49CF-AB66-5696CC888CA7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SettingsNavigationTest", "samples\SettingsNavigationTest\SettingsNavigationTest.csproj", "{AF682B4E-6A51-474A-8D80-0738A94C72FA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SettingsNavigationTest", "samples\SettingsNavigationTest\SettingsNavigationTest.csproj", "{AF682B4E-6A51-474A-8D80-0738A94C72FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ButtonsOnTitlebar", "samples\ButtonsOnTitlebar\ButtonsOnTitlebar.csproj", "{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -371,6 +373,26 @@ Global
{AF682B4E-6A51-474A-8D80-0738A94C72FA}.Release|x64.Build.0 = Release|Any CPU
{AF682B4E-6A51-474A-8D80-0738A94C72FA}.Release|x86.ActiveCfg = Release|Any CPU
{AF682B4E-6A51-474A-8D80-0738A94C72FA}.Release|x86.Build.0 = Release|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Debug|ARM.ActiveCfg = Debug|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Debug|ARM.Build.0 = Debug|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Debug|ARM64.Build.0 = Debug|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Debug|x64.ActiveCfg = Debug|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Debug|x64.Build.0 = Debug|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Debug|x86.ActiveCfg = Debug|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Debug|x86.Build.0 = Debug|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Release|Any CPU.Build.0 = Release|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Release|ARM.ActiveCfg = Release|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Release|ARM.Build.0 = Release|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Release|ARM64.ActiveCfg = Release|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Release|ARM64.Build.0 = Release|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Release|x64.ActiveCfg = Release|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Release|x64.Build.0 = Release|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Release|x86.ActiveCfg = Release|Any CPU
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -390,6 +412,7 @@ Global
{F9951C10-6C42-4E5F-BAB2-381C17D4DE35} = {A96F98E9-18B5-4863-8F28-9B7BDF70A128}
{84C80EA6-0F9C-49CF-AB66-5696CC888CA7} = {A96F98E9-18B5-4863-8F28-9B7BDF70A128}
{AF682B4E-6A51-474A-8D80-0738A94C72FA} = {A96F98E9-18B5-4863-8F28-9B7BDF70A128}
{B7A35355-ED5B-494C-9BB8-6EBA1155E60E} = {A96F98E9-18B5-4863-8F28-9B7BDF70A128}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6251E140-0FAA-4DE9-B245-1C5BE188E578}
Expand Down
14 changes: 14 additions & 0 deletions samples/ButtonsOnTitlebar/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Application x:Class="ButtonsOnTitlebar.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemeResources/>
<ui:XamlControlsResources/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
14 changes: 14 additions & 0 deletions samples/ButtonsOnTitlebar/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Configuration;
using System.Data;
using System.Windows;

namespace ButtonsOnTitlebar
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}

}
10 changes: 10 additions & 0 deletions samples/ButtonsOnTitlebar/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
15 changes: 15 additions & 0 deletions samples/ButtonsOnTitlebar/ButtonsOnTitlebar.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows10.0.18362.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="iNKORE.UI.WPF.Modern" Version="0.9.30" />
</ItemGroup>

</Project>
63 changes: 63 additions & 0 deletions samples/ButtonsOnTitlebar/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<Window x:Class="ButtonsOnTitlebar.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:local="clr-namespace:ButtonsOnTitlebar" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800"
WindowStartupLocation="CenterScreen"
ui:WindowHelper.UseModernWindowStyle="True" ui:WindowHelper.SystemBackdropType="Tabbed"
ui:TitleBar.ExtendViewIntoTitleBar="True">
<FrameworkElement.Resources>

<Style TargetType="ui:TitleBarButton">
<Setter Property="IsActive" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Path=IsActive}"/>
</Style>

</FrameworkElement.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>

<Border x:Name="Border_TitleBarRoot"
Height="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Path=(ui:TitleBar.Height)}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>

<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Path=Title}"
VerticalAlignment="Center" Margin="12,0,0,0" FontSize="12"/>

<!--Right Inset-->
<Rectangle Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Path=(ui:TitleBar.SystemOverlayRightInset)}"
Grid.Column="2"/>

<!--Right Buttons-->
<ikw:SimpleStackPanel x:Name="StackPanel_RightButtons"
Orientation="Horizontal" Grid.Column="1" Spacing="5">

<Button x:Name="Button_0" FontSize="12" Padding="8,4"
WindowChrome.IsHitTestVisibleInChrome="True">
Hello
</Button>
<ui:TitleBarButton x:Name="TitleBarButton_1">
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.ChromeFullScreen}" FontSize="10"/>
</ui:TitleBarButton>

</ikw:SimpleStackPanel>
</Grid>
</Border>

<Border x:Name="Border_MainArea" Grid.Row="1"
Background="{DynamicResource {x:Static ui:ThemeKeys.ApplicationPageBackgroundThemeBrushKey}}">

</Border>
</Grid>
</Window>
24 changes: 24 additions & 0 deletions samples/ButtonsOnTitlebar/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ButtonsOnTitlebar
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}

0 comments on commit e3e0500

Please sign in to comment.