Skip to content

Commit b790742

Browse files
committed
Proof of concept
1 parent dae0415 commit b790742

File tree

87 files changed

+13003
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+13003
-0
lines changed

BuildApp.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rmdir /s /q bin\Build\Diffuse
2+
dotnet publish -c Release /p:PublishProfile=SelfContained

DiffuseApp.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.0.11222.15 d18.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiffuseApp", "DiffuseApp\DiffuseApp.csproj", "{6B186ECB-FAF6-8CD8-DB1C-5B1BFC2AD4E7}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{6B186ECB-FAF6-8CD8-DB1C-5B1BFC2AD4E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{6B186ECB-FAF6-8CD8-DB1C-5B1BFC2AD4E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{6B186ECB-FAF6-8CD8-DB1C-5B1BFC2AD4E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{6B186ECB-FAF6-8CD8-DB1C-5B1BFC2AD4E7}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {F08E78DF-2CC0-406C-9061-4263139673CA}
24+
EndGlobalSection
25+
EndGlobal

DiffuseApp/App.xaml

Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
<Application x:Class="Diffuse.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:System="clr-namespace:System;assembly=mscorlib"
5+
xmlns:local="clr-namespace:Diffuse"
6+
xmlns:CoreCommon="clr-namespace:TensorStack.Common;assembly=TensorStack.Common"
7+
xmlns:CommonControls="clr-namespace:TensorStack.WPF.Controls;assembly=TensorStack.WPF"
8+
xmlns:PythonOptions="clr-namespace:TensorStack.Python.Common;assembly=TensorStack.Python"
9+
xmlns:Common="clr-namespace:Diffuse.Common"
10+
ShutdownMode="OnMainWindowClose">
11+
<Application.Resources>
12+
13+
14+
<ResourceDictionary>
15+
16+
<!--TensorStack.WPF-->
17+
<ResourceDictionary.MergedDictionaries>
18+
<ResourceDictionary Source="pack://application:,,,/TensorStack.WPF;component/ThemeDefault.xaml" />
19+
</ResourceDictionary.MergedDictionaries>
20+
21+
<!--Fonts-->
22+
<FontFamily x:Key="FontAwesomeBrands">pack://application:,,,/Diffuse;component/Fonts/Brands-Regular-400.otf#Font Awesome 6 Brands Regular</FontFamily>
23+
<FontFamily x:Key="FontAwesomeDuotone">pack://application:,,,/Diffuse;component/Fonts/Duotone-Solid-900.otf#Font Awesome 6 Duotone Solid</FontFamily>
24+
<FontFamily x:Key="FontAwesomeLight">pack://application:,,,/Diffuse;component/Fonts/Light-300.otf#Font Awesome 6 Pro Light</FontFamily>
25+
<FontFamily x:Key="FontAwesomeRegular">pack://application:,,,/Diffuse;component/Fonts/Regular-400.otf#Font Awesome 6 Pro Regular</FontFamily>
26+
<FontFamily x:Key="FontAwesomeSolid">pack://application:,,,/Diffuse;component/Fonts/Solid-900.otf#Font Awesome 6 Pro Solid</FontFamily>
27+
<FontFamily x:Key="FontAwesomeThin">pack://application:,,,/Diffuse;component/Fonts/Thin-100.otf#Font Awesome 6 Pro Thin</FontFamily>
28+
<FontFamily x:Key="FontAwesomeSharpLight">pack://application:,,,/Diffuse;component/Fonts/Sharp-Light-300.otf#Font Awesome 6 Sharp Light</FontFamily>
29+
<FontFamily x:Key="FontAwesomeSharpRegular">pack://application:,,,/Diffuse;component/Fonts/Sharp-Regular-400.otf#Font Awesome 6 Sharp Regular</FontFamily>
30+
<FontFamily x:Key="FontAwesomeSharpSolid">pack://application:,,,/Diffuse;component/Fonts/Sharp-Solid-900.otf#Font Awesome 6 Sharp Solid</FontFamily>
31+
<FontFamily x:Key="FontAwesomeSharpThin">pack://application:,,,/Diffuse;component/Fonts/Sharp-Thin-100.otf#Font Awesome 6 Sharp Thin</FontFamily>
32+
33+
34+
<Color x:Key="Accent1">#ff5a7fa7</Color>
35+
<Color x:Key="Accent2">#ff5a7fa7</Color>
36+
<SolidColorBrush x:Key="AccentColour1" Color="#ffc5744a" />
37+
<SolidColorBrush x:Key="AccentColour2" Color="#ffc5a343" />
38+
39+
<!--TabControl-->
40+
<SolidColorBrush x:Key="TabItemBorderSelected" Color="#ffc5744a"/>
41+
42+
<!--ProgressBar-->
43+
<LinearGradientBrush x:Key="ProgressBarProgress" EndPoint="0,1" StartPoint="0,0">
44+
<GradientStop Color="#ffc5a343" Offset="0.0"/>
45+
<GradientStop Color="#ffc5744a" Offset="1.0"/>
46+
</LinearGradientBrush>
47+
48+
<!--Button-->
49+
<SolidColorBrush x:Key="ButtonBorderPressed" Color="#ffc5744a"/>
50+
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="#80c5744a"/>
51+
<SolidColorBrush x:Key="ButtonBorderMouseOver" Color="#ffc5744a"/>
52+
53+
<!--ComboBox-->
54+
<SolidColorBrush x:Key="ComboBoxBorderMouseOver" Color="#ffc5744a"/>
55+
<SolidColorBrush x:Key="ComboBoxBorderPressed" Color="#80c5744a"/>
56+
57+
<!--ComboBoxItem-->
58+
<SolidColorBrush x:Key="ComboBoxItemBorderMouseOver" Color="#ffc5744a"/>
59+
<SolidColorBrush x:Key="ComboBoxItemBorderPressed" Color="#ffc5744a"/>
60+
<SolidColorBrush x:Key="ComboBoxItemBackgroundPressed" Color="#ffc5744a"/>
61+
<SolidColorBrush x:Key="ComboBoxItemBorderHover" Color="#ffc5744a"/>
62+
<SolidColorBrush x:Key="ComboBoxItemBorderSelected" Color="#ffc5744a"/>
63+
<SolidColorBrush x:Key="ComboBoxItemBorderSelectedHover" Color="#ffc5744a"/>
64+
<SolidColorBrush x:Key="ComboBoxItemBorderFocus" Color="#ffc5744a"/>
65+
<SolidColorBrush x:Key="ComboBoxItemBorderHoverFocus" Color="#ffc5744a"/>
66+
67+
<!--Slider-->
68+
<SolidColorBrush x:Key="SliderThumbBorderMouseOver" Color="#ffc5744a"/>
69+
<SolidColorBrush x:Key="SliderThumbBorderPressed" Color="#ffc5744a"/>
70+
71+
<!--CheckBox-->
72+
<SolidColorBrush x:Key="CheckBoxGlyph" Color="#ffc5744a"/>
73+
<SolidColorBrush x:Key="CheckBoxGlyphMouseOver" Color="#ffc5744a"/>
74+
<SolidColorBrush x:Key="CheckBoxGlyphPressed" Color="#ffc5744a"/>
75+
76+
<!--TextBox-->
77+
<SolidColorBrush x:Key="ControlPrimaryColourBorderBrush" Color="#ffc5744a"/>
78+
79+
80+
<!--Diffuse-->
81+
82+
<ObjectDataProvider x:Key="NormalizationType" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
83+
<ObjectDataProvider.MethodParameters>
84+
<x:Type TypeName="CoreCommon:Normalization"/>
85+
</ObjectDataProvider.MethodParameters>
86+
</ObjectDataProvider>
87+
88+
<ObjectDataProvider x:Key="ExtractorType" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
89+
<ObjectDataProvider.MethodParameters>
90+
<x:Type TypeName="Common:ExtractorType"/>
91+
</ObjectDataProvider.MethodParameters>
92+
</ObjectDataProvider>
93+
94+
<ObjectDataProvider x:Key="MemoryMode" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
95+
<ObjectDataProvider.MethodParameters>
96+
<x:Type TypeName="Common:MemoryMode"/>
97+
</ObjectDataProvider.MethodParameters>
98+
</ObjectDataProvider>
99+
100+
<ObjectDataProvider x:Key="DataType" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
101+
<ObjectDataProvider.MethodParameters>
102+
<x:Type TypeName="PythonOptions:DataType"/>
103+
</ObjectDataProvider.MethodParameters>
104+
</ObjectDataProvider>
105+
106+
<ObjectDataProvider x:Key="SchedulerType" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
107+
<ObjectDataProvider.MethodParameters>
108+
<x:Type TypeName="PythonOptions:SchedulerType"/>
109+
</ObjectDataProvider.MethodParameters>
110+
</ObjectDataProvider>
111+
112+
113+
<Style x:Key="ImageDropZoneStyle" TargetType="{x:Type Border}">
114+
<Setter Property="AllowDrop" Value="False"/>
115+
<Setter Property="BorderBrush" Value="Transparent"/>
116+
<Setter Property="BorderThickness" Value="1"/>
117+
<Style.Triggers>
118+
<MultiDataTrigger>
119+
<MultiDataTrigger.Conditions>
120+
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="True" />
121+
<Condition Binding="{Binding IsDragDrop, RelativeSource={RelativeSource AncestorType=CommonControls:ViewControl}}" Value="True" />
122+
<Condition Binding="{Binding DragDropType, RelativeSource={RelativeSource AncestorType=CommonControls:ViewControl}}" Value="Image" />
123+
</MultiDataTrigger.Conditions>
124+
<MultiDataTrigger.Setters>
125+
<Setter Property="AllowDrop" Value="True"/>
126+
<Setter Property="BorderBrush" Value="{StaticResource AccentColour2}"/>
127+
</MultiDataTrigger.Setters>
128+
</MultiDataTrigger>
129+
</Style.Triggers>
130+
</Style>
131+
132+
133+
<Style x:Key="VideoDropZoneStyle" TargetType="{x:Type Border}">
134+
<Setter Property="AllowDrop" Value="False"/>
135+
<Setter Property="BorderBrush" Value="Transparent"/>
136+
<Setter Property="BorderThickness" Value="1"/>
137+
<Style.Triggers>
138+
<MultiDataTrigger>
139+
<MultiDataTrigger.Conditions>
140+
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="True" />
141+
<Condition Binding="{Binding IsDragDrop, RelativeSource={RelativeSource AncestorType=CommonControls:ViewControl}}" Value="True" />
142+
<Condition Binding="{Binding DragDropType, RelativeSource={RelativeSource AncestorType=CommonControls:ViewControl}}" Value="Video" />
143+
</MultiDataTrigger.Conditions>
144+
<MultiDataTrigger.Setters>
145+
<Setter Property="AllowDrop" Value="True"/>
146+
<Setter Property="BorderBrush" Value="{StaticResource AccentColour2}"/>
147+
</MultiDataTrigger.Setters>
148+
</MultiDataTrigger>
149+
</Style.Triggers>
150+
</Style>
151+
152+
153+
<Style x:Key="ToggleButtonBasic" TargetType="{x:Type ToggleButton}">
154+
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
155+
<Setter Property="Background" Value="{StaticResource ComboBoxBackground}"/>
156+
<Setter Property="BorderBrush" Value="{StaticResource ComboBoxBorder}"/>
157+
<Setter Property="Foreground" Value="{StaticResource ButtonForeground}"/>
158+
<Setter Property="BorderThickness" Value="0"/>
159+
<Setter Property="HorizontalContentAlignment" Value="Center"/>
160+
<Setter Property="VerticalContentAlignment" Value="Center"/>
161+
<Setter Property="Padding" Value="1"/>
162+
<Setter Property="Template">
163+
<Setter.Value>
164+
<ControlTemplate TargetType="{x:Type ToggleButton}">
165+
<Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" SnapsToDevicePixels="true">
166+
<ContentPresenter x:Name="contentPresenter" Opacity="0.7" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
167+
</Border>
168+
<ControlTemplate.Triggers>
169+
<Trigger Property="Button.IsDefaulted" Value="true">
170+
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonBorderDefault}"/>
171+
</Trigger>
172+
<Trigger Property="IsMouseOver" Value="true">
173+
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonBorderMouseOver}"/>
174+
<Setter Property="ContentPresenter.Opacity" TargetName="contentPresenter" Value="1"/>
175+
</Trigger>
176+
177+
<Trigger Property="IsEnabled" Value="false">
178+
<Setter Property="Opacity" Value="0.3" />
179+
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonBorderDisabled}"/>
180+
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource ButtonForegroundDisabled}"/>
181+
</Trigger>
182+
<Trigger Property="IsChecked" Value="false">
183+
<Setter Property="ContentPresenter.Opacity" TargetName="contentPresenter" Value="1"/>
184+
</Trigger>
185+
</ControlTemplate.Triggers>
186+
</ControlTemplate>
187+
</Setter.Value>
188+
</Setter>
189+
</Style>
190+
191+
192+
<Style x:Key="TransparentListBoxItem" TargetType="ListBoxItem">
193+
<Setter Property="Padding" Value="0"/>
194+
<Setter Property="Margin" Value="0"/>
195+
<Setter Property="Background" Value="Transparent"/>
196+
<Setter Property="BorderThickness" Value="0"/>
197+
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
198+
<Setter Property="Template">
199+
<Setter.Value>
200+
<ControlTemplate TargetType="ListBoxItem">
201+
<Border x:Name="Bd" Background="Transparent" BorderThickness="0" Padding="{TemplateBinding Padding}">
202+
<ContentPresenter />
203+
</Border>
204+
<ControlTemplate.Triggers>
205+
<Trigger Property="IsSelected" Value="True">
206+
<Setter TargetName="Bd" Property="Background" Value="Transparent"/>
207+
</Trigger>
208+
<Trigger Property="IsMouseOver" Value="True">
209+
<Setter TargetName="Bd" Property="Background" Value="Transparent"/>
210+
</Trigger>
211+
<Trigger Property="IsEnabled" Value="False">
212+
<Setter Property="Opacity" Value="0.6"/>
213+
</Trigger>
214+
</ControlTemplate.Triggers>
215+
</ControlTemplate>
216+
</Setter.Value>
217+
</Setter>
218+
</Style>
219+
220+
<Style x:Key="MenuIconButton" TargetType="CommonControls:IconButton">
221+
<Setter Property="Orientation" Value="Horizontal"/>
222+
<Setter Property="Placement" Value="Bottom"/>
223+
<Setter Property="FontSize" Value="14"/>
224+
<Setter Property="IconSize" Value="17"/>
225+
<Setter Property="IconStyle" Value="Solid"/>
226+
<Setter Property="IconColor" Value="{StaticResource AccentColour2}"/>
227+
</Style>
228+
229+
<Style x:Key="SubmenuIconButton" TargetType="CommonControls:IconButton">
230+
<Setter Property="Height" Value="70"/>
231+
<Setter Property="Width" Value="120"/>
232+
<Setter Property="LineHeight" Value="14"/>
233+
<Setter Property="Orientation" Value="Vertical"/>
234+
<Setter Property="Placement" Value="Right"/>
235+
<Setter Property="FontSize" Value="12"/>
236+
<Setter Property="IconSize" Value="20"/>
237+
<Setter Property="IconStyle" Value="Solid"/>
238+
<Setter Property="IconColor" Value="{StaticResource AccentColour2}"/>
239+
</Style>
240+
241+
242+
243+
244+
245+
246+
</ResourceDictionary>
247+
248+
249+
</Application.Resources>
250+
</Application>

0 commit comments

Comments
 (0)