Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .csharpierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.csproj
*.xaml
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PackageVersion Include="AwesomeAssertions" Version="9.3.0" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="FlaUI.Core" Version="5.0.0" />
<PackageVersion Include="FlaUI.UIA3" Version="5.0.0" />
<PackageVersion Include="Lepo.i18n" Version="2.0.0" />
<PackageVersion Include="Lepo.i18n.DependencyInjection" Version="2.0.0" />
Expand Down
22 changes: 20 additions & 2 deletions Wpf.Ui.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32407.343
# Visual Studio Version 18
VisualStudioVersion = 18.0.11201.2 d18.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{21DB16AA-40BB-428B-AFE8-DEF4E3F0DC49}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -61,6 +61,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wpf.Ui.Demo.SetResources.Si
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wpf.Ui.Gallery.IntegrationTests", "tests\Wpf.Ui.Gallery.IntegrationTests\Wpf.Ui.Gallery.IntegrationTests.csproj", "{A396F1D6-55CF-493E-B541-A50B8F29395A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wpf.Ui.FlaUI", "src\Wpf.Ui.FlaUI\Wpf.Ui.FlaUI.csproj", "{3E29F5F8-8310-45F4-A648-8F44F32B6472}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -371,6 +373,22 @@ Global
{A396F1D6-55CF-493E-B541-A50B8F29395A}.Release|x64.Build.0 = Release|Any CPU
{A396F1D6-55CF-493E-B541-A50B8F29395A}.Release|x86.ActiveCfg = Release|Any CPU
{A396F1D6-55CF-493E-B541-A50B8F29395A}.Release|x86.Build.0 = Release|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Debug|arm64.ActiveCfg = Debug|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Debug|arm64.Build.0 = Debug|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Debug|x64.ActiveCfg = Debug|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Debug|x64.Build.0 = Debug|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Debug|x86.ActiveCfg = Debug|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Debug|x86.Build.0 = Debug|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Release|Any CPU.Build.0 = Release|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Release|arm64.ActiveCfg = Release|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Release|arm64.Build.0 = Release|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Release|x64.ActiveCfg = Release|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Release|x64.Build.0 = Release|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Release|x86.ActiveCfg = Release|Any CPU
{3E29F5F8-8310-45F4-A648-8F44F32B6472}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
// This Source Code Form is subject to the terms of the MIT License.
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.

using System.Collections.Generic;
using System.Linq;
using FlaUI.Core;
using FlaUI.Core.Exceptions;
using FlaUI.Core.Input;
using FlaUI.Core.Patterns;
using FlaUI.Core.WindowsAPI;
namespace Wpf.Ui.FlaUI;

namespace Wpf.Ui.Gallery.IntegrationTests.Fixtures;

/// <summary>Class to interact with a <see cref="Wpf.Ui.Controls.AutoSuggestBox"/> element.</summary>
/// <summary>
/// Class to interact with a WPF UI AutoSuggestBox element.
/// </summary>
public class AutoSuggestBox(FrameworkAutomationElementBase frameworkAutomationElement)
: AutomationElement(frameworkAutomationElement)
{
Expand Down
13 changes: 13 additions & 0 deletions src/Wpf.Ui.FlaUI/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.

global using System.Collections.Generic;
global using System.Linq;
global using FlaUI.Core;
global using FlaUI.Core.AutomationElements;
global using FlaUI.Core.Exceptions;
global using FlaUI.Core.Input;
global using FlaUI.Core.Patterns;
global using FlaUI.Core.WindowsAPI;
30 changes: 30 additions & 0 deletions src/Wpf.Ui.FlaUI/Wpf.Ui.FlaUI.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PackageId>WPF-UI.FlaUI</PackageId>
<TargetFrameworks>net9.0-windows;net8.0-windows;net481;</TargetFrameworks>
<Description>FlaUI automation library integration for WPF UI library.</Description>
<CommonTags>$(CommonTags);syntax;highlight;flaui;fla;ui;ua3;ua2;ui;automation</CommonTags>
<UseWPF>true</UseWPF>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="FlaUI.Core" />
<PackageReference Include="PolySharp">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>build; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="WpfAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
60 changes: 32 additions & 28 deletions src/Wpf.Ui.Gallery/App.xaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
<Application
x:Class="Wpf.Ui.Gallery.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:helpers="clr-namespace:Wpf.Ui.Gallery.Helpers"
xmlns:local="clr-namespace:Wpf.Ui.Gallery"
xmlns:syntax="http://schemas.lepo.co/wpfui/2022/xaml/syntax"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
DispatcherUnhandledException="OnDispatcherUnhandledException"
Exit="OnExit"
Startup="OnStartup"
>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Light" />
<ui:ControlsDictionary />
<syntax:SyntaxHighlightDictionary />
<ResourceDictionary Source="Controls/GalleryNavigationPresenter.xaml" />
<ResourceDictionary Source="Controls/ControlExample.xaml" />
<ResourceDictionary Source="Controls/TypographyControl.xaml" />
<ResourceDictionary Source="Controls/PageControlDocumentation.xaml" />
</ResourceDictionary.MergedDictionaries>
<helpers:EnumToBooleanConverter x:Key="EnumToBooleanConverter" />
<helpers:ThemeToIndexConverter x:Key="ThemeToIndexConverter" />
<helpers:PaneDisplayModeToIndexConverter x:Key="PaneDisplayModeToIndexConverter" />
</ResourceDictionary>
</Application.Resources>
<Application
x:Class="Wpf.Ui.Gallery.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:helpers="clr-namespace:Wpf.Ui.Gallery.Helpers"
xmlns:local="clr-namespace:Wpf.Ui.Gallery"
xmlns:syntax="http://schemas.lepo.co/wpfui/2022/xaml/syntax"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
DispatcherUnhandledException="OnDispatcherUnhandledException"
Exit="OnExit"
Startup="OnStartup">
<Application.Resources>
<ResourceDictionary>

<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Light" />
<ui:ControlsDictionary />

<syntax:SyntaxHighlightDictionary />

<ResourceDictionary Source="Controls/GalleryNavigationPresenter.xaml" />
<ResourceDictionary Source="Controls/ControlExample.xaml" />
<ResourceDictionary Source="Controls/TypographyControl.xaml" />
<ResourceDictionary Source="Controls/PageControlDocumentation.xaml" />
</ResourceDictionary.MergedDictionaries>

<helpers:EnumToBooleanConverter x:Key="EnumToBooleanConverter" />
<helpers:ThemeToIndexConverter x:Key="ThemeToIndexConverter" />
<helpers:PaneDisplayModeToIndexConverter x:Key="PaneDisplayModeToIndexConverter" />

</ResourceDictionary>
</Application.Resources>
</Application>
194 changes: 103 additions & 91 deletions src/Wpf.Ui.Gallery/Controls/ControlExample.xaml
Original file line number Diff line number Diff line change
@@ -1,92 +1,104 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Wpf.Ui.Gallery.Controls"
xmlns:helpers="clr-namespace:Wpf.Ui.Gallery.Helpers"
xmlns:syntax="http://schemas.lepo.co/wpfui/2022/xaml/syntax"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
>
<helpers:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
<Style TargetType="{x:Type controls:ControlExample}">
<Setter Property="Focusable" Value="False" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:ControlExample}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ui:TextBlock
Grid.Row="0"
Margin="0,0,0,10"
FontTypography="BodyStrong"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{TemplateBinding HeaderText}"
Visibility="{TemplateBinding HeaderText,
Converter={StaticResource NullToVisibilityConverter}}"
/>
<Border
Grid.Row="1"
Padding="16"
Background="{ui:ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ui:ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="1,1,1,0"
CornerRadius="8,8,0,0"
>
<ContentPresenter Content="{TemplateBinding ExampleContent}" />
</Border>
<ui:CardExpander Grid.Row="2" CornerRadius="0,0,8,8" Header="Source code">
<StackPanel>
<StackPanel x:Name="XamlCodeBlock">
<ui:TextBlock
Margin="0,0,0,5"
FontTypography="BodyStrong"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="XAML"
/>
<syntax:CodeBlock
Padding="0"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0"
Content="{TemplateBinding XamlCode}"
/>
</StackPanel>
<Border x:Name="Border" Margin="0,20" BorderThickness="1" Visibility="Visible" />
<StackPanel x:Name="CsharpCodeBlock">
<ui:TextBlock
Margin="0,0,0,5"
FontTypography="BodyStrong"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="C#"
/>
<syntax:CodeBlock
Padding="0"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0"
Content="{TemplateBinding CsharpCode}"
/>
</StackPanel>
</StackPanel>
</ui:CardExpander>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="XamlCode" Value="{x:Null}">
<Setter TargetName="XamlCodeBlock" Property="Visibility" Value="Collapsed" />
<Setter TargetName="Border" Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="CsharpCode" Value="{x:Null}">
<Setter TargetName="CsharpCodeBlock" Property="Visibility" Value="Collapsed" />
<Setter TargetName="Border" Property="Visibility" Value="Collapsed" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Wpf.Ui.Gallery.Controls"
xmlns:helpers="clr-namespace:Wpf.Ui.Gallery.Helpers"
xmlns:syntax="http://schemas.lepo.co/wpfui/2022/xaml/syntax"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">

<helpers:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />

<Style TargetType="{x:Type controls:ControlExample}">
<Setter Property="Focusable" Value="False" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:ControlExample}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<ui:TextBlock
Grid.Row="0"
Margin="0,0,0,10"
FontTypography="BodyStrong"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{TemplateBinding HeaderText}"
Visibility="{TemplateBinding HeaderText,
Converter={StaticResource NullToVisibilityConverter}}" />

<Border
Grid.Row="1"
Padding="16"
Background="{ui:ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ui:ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="1,1,1,0"
CornerRadius="8,8,0,0">
<ContentPresenter Content="{TemplateBinding ExampleContent}" />
</Border>

<ui:CardExpander
Grid.Row="2"
CornerRadius="0,0,8,8"
Header="Source code">
<StackPanel>
<StackPanel x:Name="XamlCodeBlock">
<ui:TextBlock
Margin="0,0,0,5"
FontTypography="BodyStrong"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="XAML" />

<syntax:CodeBlock
Padding="0"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0"
Content="{TemplateBinding XamlCode}" />
</StackPanel>

<Border
x:Name="Border"
Margin="0,20"
BorderThickness="1"
Visibility="Visible" />

<StackPanel x:Name="CsharpCodeBlock">
<ui:TextBlock
Margin="0,0,0,5"
FontTypography="BodyStrong"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="C#" />

<syntax:CodeBlock
Padding="0"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0"
Content="{TemplateBinding CsharpCode}" />
</StackPanel>
</StackPanel>
</ui:CardExpander>
</Grid>

<ControlTemplate.Triggers>
<Trigger Property="XamlCode" Value="{x:Null}">
<Setter TargetName="XamlCodeBlock" Property="Visibility" Value="Collapsed" />
<Setter TargetName="Border" Property="Visibility" Value="Collapsed" />
</Trigger>

<Trigger Property="CsharpCode" Value="{x:Null}">
<Setter TargetName="CsharpCodeBlock" Property="Visibility" Value="Collapsed" />
<Setter TargetName="Border" Property="Visibility" Value="Collapsed" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

</ResourceDictionary>
Loading
Loading