Add project files.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<fluent:ContentDialog
|
||||
x:Class="Builder.AddPageView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:fluent="using:FluentAvalonia.UI.Controls"
|
||||
xmlns:ui="clr-namespace:TheXamlGuy.UI.Avalonia;assembly=TheXamlGuy.UI.Avalonia"
|
||||
Title="Add Page"
|
||||
CloseButtonText="Cancel"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonClick="{ui:Invoke Add}"
|
||||
PrimaryButtonText="Add">
|
||||
<TextBox
|
||||
Width="500"
|
||||
Text="{Binding Name}"
|
||||
Watermark="Enter page name" />
|
||||
</fluent:ContentDialog>
|
||||
@@ -0,0 +1,17 @@
|
||||
using Avalonia.Styling;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using PropertyChanged;
|
||||
using System;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class AddPageView : ContentDialog, IStyleable
|
||||
{
|
||||
public AddPageView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
Type IStyleable.StyleKey => typeof(ContentDialog);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Builder.LifeCycles;
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
public class AddPageViewModel : ObservableViewModel
|
||||
{
|
||||
public AddPageViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public string? Name { get; set; }
|
||||
|
||||
public void Add()
|
||||
{
|
||||
EventAggregator.Publish(new AddPage(Name));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<UserControl
|
||||
x:Class="Builder.CreateProjectConfigurationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:TheXamlGuy.UI.Avalonia.Controls;assembly=TheXamlGuy.UI.Avalonia.Controls"
|
||||
xmlns:fluent="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:views="using:Builder"
|
||||
Loaded="{Composite {ChangeProperty {Binding $parent[fluent:ContentDialog]},
|
||||
Classes,
|
||||
Create}}">
|
||||
<Grid>
|
||||
<controls:FilePicker x:Name="FilePicker" />
|
||||
<StackPanel Spacing="18">
|
||||
<TextBox Watermark="Project name" />
|
||||
<Grid ColumnDefinitions="*, 4, Auto">
|
||||
<TextBox Grid.Column="0" Watermark="Project location" />
|
||||
<Button
|
||||
Grid.Column="2"
|
||||
Click="{Invoke {Binding #FilePicker.Open}}"
|
||||
Content="..." />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Platform.Storage;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class CreateProjectConfigurationView : UserControl
|
||||
{
|
||||
public CreateProjectConfigurationView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
public class CreateProjectConfigurationViewModel : ObservableViewModel
|
||||
{
|
||||
public CreateProjectConfigurationViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<UserControl
|
||||
x:Class="Builder.ExistingProjectConfigurationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:fluent="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
Loaded="{Composite {ChangeProperty {Binding $parent[fluent:ContentDialog]},
|
||||
Classes,
|
||||
Open}}" />
|
||||
@@ -0,0 +1,15 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Data;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class ExistingProjectConfigurationView : UserControl
|
||||
{
|
||||
public ExistingProjectConfigurationView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
public class ExistingProjectConfigurationViewModel : ObservableViewModel
|
||||
{
|
||||
public ExistingProjectConfigurationViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<UserControl
|
||||
x:Class="Builder.MainView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Content="{Route {Binding Route},
|
||||
Main}"
|
||||
Loaded="{Navigate {Binding EventAggregator},
|
||||
Project,
|
||||
Route=Main}" />
|
||||
@@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace Builder
|
||||
{
|
||||
[DoNotNotify]
|
||||
public partial class MainView : UserControl
|
||||
{
|
||||
public MainView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using TheXamlGuy.Framework.Avalonia;
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
public class MainViewModel : ObservableViewModel
|
||||
{
|
||||
public MainViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer,
|
||||
IRouter route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
Route = route;
|
||||
}
|
||||
|
||||
public IRouter Route { get; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<Window
|
||||
x:Class="Builder.MainWindow"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Content="{Route {Binding Route},
|
||||
Window}"
|
||||
Loaded="{Navigate {Binding EventAggregator},
|
||||
Main,
|
||||
Route=Window}" />
|
||||
@@ -0,0 +1,75 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Media.Immutable;
|
||||
using FluentAvalonia.Styling;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using FluentAvalonia.UI.Media;
|
||||
using PropertyChanged;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class MainWindow : CoreWindow
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnOpened(EventArgs args)
|
||||
{
|
||||
if (AvaloniaLocator.Current.GetService<FluentAvaloniaTheme>() is FluentAvaloniaTheme theme)
|
||||
{
|
||||
theme.RequestedThemeChanged += OnRequestedThemeChanged;
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
if (IsWindows11 && theme.RequestedTheme != FluentAvaloniaTheme.HighContrastModeString)
|
||||
{
|
||||
TransparencyBackgroundFallback = Brushes.Transparent;
|
||||
TransparencyLevelHint = WindowTransparencyLevel.Mica;
|
||||
|
||||
TryEnableMicaEffect(theme);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.OnOpened(args);
|
||||
}
|
||||
|
||||
private void OnRequestedThemeChanged(FluentAvaloniaTheme sender, RequestedThemeChangedEventArgs args)
|
||||
{
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
if (IsWindows11 && args.NewTheme != FluentAvaloniaTheme.HighContrastModeString)
|
||||
{
|
||||
TryEnableMicaEffect(sender);
|
||||
}
|
||||
else if (args.NewTheme == FluentAvaloniaTheme.HighContrastModeString)
|
||||
{
|
||||
SetValue(BackgroundProperty, AvaloniaProperty.UnsetValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TryEnableMicaEffect(FluentAvaloniaTheme theme)
|
||||
{
|
||||
if (theme.RequestedTheme == FluentAvaloniaTheme.DarkModeString)
|
||||
{
|
||||
Color2 color = this.TryFindResource("SolidBackgroundFillColorBase", out object? value) ? (Color2)(Color)value! : new Color2(32, 32, 32);
|
||||
color = color.LightenPercent(-0.5f);
|
||||
|
||||
Background = new ImmutableSolidColorBrush(color, 0.78);
|
||||
}
|
||||
else if (theme.RequestedTheme == FluentAvaloniaTheme.LightModeString)
|
||||
{
|
||||
Color2 color = this.TryFindResource("SolidBackgroundFillColorBase", out object? value) ? (Color2)(Color)value! : new Color2(243, 243, 243);
|
||||
color = color.LightenPercent(0.5f);
|
||||
|
||||
Background = new ImmutableSolidColorBrush(color, 0.9);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using TheXamlGuy.Framework.Avalonia;
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
public class MainWindowViewModel : ObservableViewModel
|
||||
{
|
||||
public MainWindowViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer,
|
||||
IRouter route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
Route = route;
|
||||
}
|
||||
|
||||
public IRouter Route { get; }
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<UserControl
|
||||
x:Class="Builder.PageCollectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:fluent="using:FluentAvalonia.UI.Controls"
|
||||
xmlns:view="clr-namespace:Builder;assembly=Builder">
|
||||
<fluent:NavigationView
|
||||
IsPaneToggleButtonVisible="False"
|
||||
IsSettingsVisible="False"
|
||||
MenuItems="{Binding}">
|
||||
<fluent:NavigationView.PaneHeader>
|
||||
<Button
|
||||
HorizontalAlignment="Left"
|
||||
Classes="Icon"
|
||||
Click="{Navigate {Binding EventAggregator},
|
||||
AddPage}"
|
||||
Content="">
|
||||
<fluent:FAPathIcon Data="F1 M 10.52 4.559999 C 10.519999 4.346666 10.446666 4.166668 10.3 4.02 C 10.153333 3.873333 9.973333 3.799999 9.76 3.799999 C 9.546666 3.799999 9.366666 3.873333 9.22 4.02 C 9.073333 4.166668 9 4.346666 9 4.559999 L 9 10.799999 L 2.76 10.799999 C 2.546667 10.799999 2.366667 10.873333 2.22 11.02 C 2.073333 11.166667 2 11.346666 2 11.559999 C 2 11.773333 2.073333 11.953333 2.22 12.099999 C 2.366667 12.246667 2.546667 12.32 2.76 12.32 L 9 12.32 L 9 18.559999 C 9 18.773333 9.073333 18.953333 9.22 19.099998 C 9.366666 19.246666 9.546666 19.313332 9.76 19.299999 C 9.973333 19.286667 10.153333 19.213333 10.3 19.08 C 10.446666 18.946667 10.519999 18.773333 10.52 18.559999 L 10.52 12.28 L 16.76 12.28 C 16.973333 12.306667 17.153332 12.246667 17.299999 12.099999 C 17.446667 11.953333 17.513332 11.773333 17.5 11.559999 C 17.486666 11.346666 17.413332 11.166667 17.279999 11.02 C 17.146666 10.873333 16.973333 10.799999 16.76 10.799999 L 10.52 10.799999 Z " />
|
||||
</Button>
|
||||
</fluent:NavigationView.PaneHeader>
|
||||
<fluent:NavigationView.MenuItemTemplate>
|
||||
<DataTemplate x:DataType="view:PageItemViewModel">
|
||||
<fluent:NavigationViewItem Content="{Binding Name}">
|
||||
<fluent:NavigationViewItem.Icon>
|
||||
<fluent:FAPathIcon Data="F1 M 7.08 11.24 C 7.053333 11.373333 7.08 11.5 7.16 11.62 C 7.24 11.74 7.346666 11.806666 7.48 11.82 C 7.613333 11.833333 7.739999 11.799999 7.86 11.719999 C 7.98 11.639999 8.053333 11.533333 8.08 11.4 L 8.16 10.799999 L 9.4 10.799999 L 9.32 11.24 C 9.293333 11.373333 9.32 11.5 9.4 11.62 C 9.48 11.74 9.593332 11.806666 9.74 11.82 C 9.886666 11.833333 10.013333 11.799999 10.12 11.719999 C 10.226665 11.639999 10.293333 11.533333 10.32 11.4 L 10.4 10.799999 L 11 10.799999 C 11.133333 10.799999 11.253333 10.753333 11.36 10.66 C 11.466666 10.566667 11.52 10.446667 11.52 10.299999 C 11.52 10.153334 11.466666 10.033333 11.36 9.94 C 11.253333 9.846666 11.133333 9.799999 11 9.799999 L 10.559999 9.799999 L 10.76 8.32 L 11.52 8.32 C 11.653333 8.32 11.766666 8.266666 11.86 8.16 C 11.953333 8.053333 12 7.933333 12 7.799999 C 12 7.666666 11.953333 7.553333 11.86 7.459999 C 11.766666 7.366667 11.653333 7.32 11.52 7.32 L 10.92 7.32 L 11.04 6.36 C 11.066667 6.226667 11.04 6.106668 10.96 6 C 10.88 5.893333 10.766666 5.826666 10.62 5.799999 C 10.473332 5.773335 10.346666 5.806667 10.24 5.9 C 10.133333 5.993334 10.066666 6.106668 10.04 6.24 L 9.92 7.32 L 8.679999 7.32 L 8.8 6.36 C 8.826666 6.226667 8.793333 6.106668 8.7 6 C 8.606667 5.893333 8.493333 5.826666 8.36 5.799999 C 8.226666 5.773335 8.106667 5.806667 8 5.9 C 7.893332 5.993334 7.826666 6.106668 7.8 6.24 L 7.64 7.32 L 7 7.32 C 6.866666 7.32 6.746666 7.366667 6.64 7.459999 C 6.533333 7.553333 6.486667 7.666666 6.5 7.799999 C 6.513333 7.933333 6.566667 8.053333 6.66 8.16 C 6.753333 8.266666 6.866666 8.32 7 8.32 L 7.52 8.32 L 7.28 9.799999 L 6.52 9.799999 C 6.36 9.799999 6.233333 9.846666 6.14 9.94 C 6.046666 10.033333 6 10.153334 6 10.299999 C 6 10.446667 6.046666 10.566667 6.14 10.66 C 6.233333 10.753333 6.346666 10.799999 6.48 10.799999 L 7.12 10.799999 Z M 9.76 8.32 L 9.52 9.799999 L 8.28 9.799999 L 8.52 8.32 Z M 6 3.799999 C 5.44 3.799999 4.966666 3.993334 4.58 4.379999 C 4.193333 4.766666 4 5.24 4 5.799999 L 4 17.799999 C 4 18.360001 4.193333 18.833332 4.58 19.219999 C 4.966666 19.606667 5.44 19.799999 6 19.799999 L 14 19.799999 C 14.559999 19.799999 15.033333 19.606667 15.42 19.219999 C 15.806666 18.833332 16 18.360001 16 17.799999 L 16 5.799999 C 16 5.24 15.806666 4.766666 15.42 4.379999 C 15.033333 3.993334 14.559999 3.799999 14 3.799999 Z M 6 4.799999 L 14 4.799999 C 14.266666 4.799999 14.5 4.9 14.7 5.1 C 14.9 5.299999 14.999999 5.533333 15 5.799999 L 15 17.799999 C 14.999999 18.066666 14.9 18.299999 14.7 18.5 C 14.5 18.699999 14.266666 18.799999 14 18.799999 L 6 18.799999 C 5.733333 18.799999 5.5 18.699999 5.3 18.5 C 5.099999 18.299999 5 18.066666 5 17.799999 L 5 5.799999 C 5 5.533333 5.099999 5.299999 5.3 5.1 C 5.5 4.9 5.733333 4.799999 6 4.799999 Z " />
|
||||
</fluent:NavigationViewItem.Icon>
|
||||
</fluent:NavigationViewItem>
|
||||
</DataTemplate>
|
||||
</fluent:NavigationView.MenuItemTemplate>
|
||||
</fluent:NavigationView>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class PageCollectionView : UserControl
|
||||
{
|
||||
public PageCollectionView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using TheXamlGuy.Framework.Avalonia;
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
public class PageCollectionViewModel : ObservableViewModelCollection<PageItemViewModel>
|
||||
{
|
||||
public PageCollectionViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer,
|
||||
ITemplateSelector templateSelector,
|
||||
IRouter route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
TemplateSelector = templateSelector;
|
||||
Route = route;
|
||||
}
|
||||
|
||||
public ITemplateSelector TemplateSelector { get; }
|
||||
|
||||
public IRouter Route { get; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<UserControl
|
||||
x:Class="Builder.PageDesignerView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SplitView
|
||||
IsPaneOpen="True"
|
||||
PaneBackground="Red"
|
||||
PanePlacement="Right" />
|
||||
</UserControl>
|
||||
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class PageDesignerView : UserControl
|
||||
{
|
||||
public PageDesignerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using TheXamlGuy.Framework.Avalonia;
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
public class PageDesignerViewModel : ObservableViewModel
|
||||
{
|
||||
public PageDesignerViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer,
|
||||
IRouter route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
Route = route;
|
||||
}
|
||||
|
||||
public IRouter Route { get; }
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using TheXamlGuy.Framework.Avalonia;
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
public class PageItemViewModel : ObservableViewModel
|
||||
{
|
||||
public PageItemViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer,
|
||||
IRouter route,
|
||||
string name) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
Route = route;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public IRouter Route { get; }
|
||||
|
||||
public string Name { get; }
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<fluent:ContentDialog
|
||||
x:Class="Builder.ProjectConfigurationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:fluent="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
CloseButtonText="Cancel">
|
||||
<fluent:ContentDialog.Title>
|
||||
<Grid Height="40" ColumnDefinitions="Auto, *">
|
||||
<Button
|
||||
x:Name="BackButton"
|
||||
Grid.Column="0"
|
||||
Classes="Icon"
|
||||
Click="{Invoke {Binding #Frame.GoBack}}">
|
||||
<fluent:FAPathIcon Data="F1 M 12.28 17.599998 C 12.119999 17.733334 11.939999 17.799999 11.74 17.799999 C 11.539999 17.799999 11.36 17.719999 11.2 17.559999 L 6.2 12.32 C 6.066667 12.186666 6 12.02 6 11.82 C 6 11.62 6.066667 11.440001 6.2 11.28 L 11.2 6.04 C 11.413333 5.826667 11.66 5.753334 11.94 5.82 C 12.219999 5.886666 12.399999 6.059999 12.48 6.339999 C 12.559999 6.62 12.493332 6.866667 12.28 7.08 L 7.8 11.799999 L 12.28 16.52 C 12.439999 16.68 12.513332 16.860001 12.5 17.059999 C 12.486666 17.259998 12.413332 17.439999 12.28 17.599998 Z " />
|
||||
</Button>
|
||||
<TextBlock
|
||||
x:Name="Title"
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
</fluent:ContentDialog.Title>
|
||||
<fluent:Frame
|
||||
x:Name="Frame"
|
||||
Width="500"
|
||||
Height="350"
|
||||
Content="{Route {Binding Route},
|
||||
ProjectConfiguration}"
|
||||
Loaded="{Navigate {Binding EventAggregator},
|
||||
StartProjectConfiguration,
|
||||
Route=ProjectConfiguration}" />
|
||||
<fluent:ContentDialog.Styles>
|
||||
<Style Selector="fluent|ContentDialog.Project">
|
||||
<Style Selector="^fluent|ContentDialog.Project /template/ Button#PrimaryButton">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^fluent|ContentDialog.Project Button#BackButton">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^fluent|ContentDialog.Project TextBlock#Title">
|
||||
<Setter Property="Text" Value="Let's get started" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="fluent|ContentDialog.Create">
|
||||
<Style Selector="^fluent|ContentDialog.Create /template/ Button#PrimaryButton">
|
||||
<Setter Property="Content" Value="Create" />
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
<Setter Property="Grid.Column" Value="0" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||
<Setter Property="Margin" Value="0 0 4 0" />
|
||||
</Style>
|
||||
<Style Selector="^fluent|ContentDialog.Create Button#BackButton">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="^fluent|ContentDialog.Create TextBlock#Title">
|
||||
<Setter Property="Text" Value="Create a new project" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="fluent|ContentDialog.Open">
|
||||
<Style Selector="^fluent|ContentDialog.Open /template/ Button#PrimaryButton">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^fluent|ContentDialog.Open Button#BackButton">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="^fluent|ContentDialog.Open TextBlock#Title">
|
||||
<Setter Property="Text" Value="Open a project" />
|
||||
</Style>
|
||||
</Style>
|
||||
</fluent:ContentDialog.Styles>
|
||||
</fluent:ContentDialog>
|
||||
@@ -0,0 +1,17 @@
|
||||
using Avalonia.Styling;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using PropertyChanged;
|
||||
using System;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class ProjectConfigurationView : ContentDialog, IStyleable
|
||||
{
|
||||
public ProjectConfigurationView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
Type IStyleable.StyleKey => typeof(ContentDialog);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using TheXamlGuy.Framework.Avalonia;
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
public class ProjectConfigurationViewModel : ObservableViewModel
|
||||
{
|
||||
public ProjectConfigurationViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer,
|
||||
IRouter route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
Route = route;
|
||||
}
|
||||
|
||||
public IRouter Route { get; }
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<UserControl
|
||||
x:Class="Builder.ProjectView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:fluent="using:FluentAvalonia.UI.Controls"
|
||||
Loaded="{Navigate {Binding EventAggregator},
|
||||
ProjectConfiguration}">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Button
|
||||
Grid.Row="0"
|
||||
Margin="6,6,12,6"
|
||||
HorizontalAlignment="Right"
|
||||
Classes="accent"
|
||||
Content="New project" />
|
||||
<fluent:Frame
|
||||
Grid.Row="1"
|
||||
Content="{Route {Binding Route},
|
||||
Navigation}"
|
||||
Loaded="{Navigate {Binding EventAggregator},
|
||||
Pages,
|
||||
Route=Navigation}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class ProjectView : UserControl
|
||||
{
|
||||
public ProjectView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using TheXamlGuy.Framework.Avalonia;
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
public class ProjectViewModel : ObservableViewModel
|
||||
{
|
||||
public ProjectViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer,
|
||||
IRouter route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
Route = route;
|
||||
}
|
||||
|
||||
public IRouter Route { get; }
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<UserControl
|
||||
x:Class="Builder.StartProjectConfigurationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:fluent="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
Loaded="{Composite {ChangeProperty {Binding $parent[fluent:ContentDialog]},
|
||||
Classes,
|
||||
Project}}">
|
||||
<StackPanel Spacing="4">
|
||||
<fluent:SettingsExpander
|
||||
Click="{Navigate {Binding EventAggregator},
|
||||
CreateProjectConfiguration,
|
||||
Route=ProjectConfiguration}"
|
||||
Description="Let's started with a new blank builder proejct"
|
||||
Header="Create a new project"
|
||||
IsClickEnabled="True">
|
||||
<fluent:SettingsExpander.IconSource>
|
||||
<fluent:PathIconSource Data="F1 M 3.056641 18.75 C 2.646484 18.75 2.255859 18.666992 1.884766 18.500977 C 1.513672 18.334961 1.189779 18.113607 0.913086 17.836914 C 0.636393 17.560221 0.415039 17.236328 0.249023 16.865234 C 0.083008 16.494141 0 16.103516 0 15.693359 L 0 4.306641 C 0 3.896484 0.083008 3.505859 0.249023 3.134766 C 0.415039 2.763672 0.636393 2.439779 0.913086 2.163086 C 1.189779 1.886395 1.513672 1.665039 1.884766 1.499023 C 2.255859 1.333008 2.646484 1.25 3.056641 1.25 L 6.875 1.25 C 7.324219 1.25 7.709961 1.319988 8.032227 1.459961 C 8.354492 1.599936 8.644205 1.785482 8.901367 2.016602 C 9.158528 2.247723 9.397786 2.513021 9.619141 2.8125 C 9.840494 3.11198 10.071614 3.42448 10.3125 3.75 L 16.943359 3.75 C 17.353516 3.75 17.744141 3.833008 18.115234 3.999023 C 18.486328 4.165039 18.810221 4.386394 19.086914 4.663086 C 19.363605 4.939779 19.584961 5.263672 19.750977 5.634766 C 19.916992 6.005859 20 6.396484 20 6.806641 L 20 9.902344 C 19.817707 9.674479 19.622395 9.456381 19.414062 9.248047 C 19.205729 9.039714 18.984375 8.847656 18.75 8.671875 L 18.75 6.875 C 18.75 6.621095 18.701172 6.380209 18.603516 6.152344 C 18.505859 5.924479 18.370768 5.724284 18.198242 5.551758 C 18.025715 5.379232 17.82552 5.244142 17.597656 5.146484 C 17.369791 5.048829 17.128906 5.000001 16.875 5 L 10.185547 5 C 9.957682 5.156251 9.736328 5.309246 9.521484 5.458984 C 9.306641 5.608725 9.088541 5.742188 8.867188 5.859375 C 8.645833 5.976562 8.413086 6.070964 8.168945 6.142578 C 7.924805 6.214193 7.65625 6.25 7.363281 6.25 L 1.25 6.25 L 1.25 15.625 C 1.25 15.878906 1.298828 16.119791 1.396484 16.347656 C 1.494141 16.575521 1.629232 16.775717 1.801758 16.948242 C 1.974284 17.120768 2.174479 17.255859 2.402344 17.353516 C 2.630208 17.451172 2.871094 17.5 3.125 17.5 L 7.900391 17.5 C 8.011067 17.721354 8.129883 17.936197 8.256836 18.144531 C 8.383789 18.352865 8.522135 18.554688 8.671875 18.75 Z M 7.363281 5 C 7.539062 5.000001 7.70345 4.977215 7.856445 4.931641 C 8.009439 4.886068 8.154297 4.825847 8.291016 4.750977 C 8.427734 4.676107 8.562825 4.5931 8.696289 4.501953 C 8.829752 4.410808 8.964844 4.316406 9.101562 4.21875 C 8.951822 4.016928 8.805338 3.813477 8.662109 3.608398 C 8.51888 3.40332 8.36263 3.219402 8.193359 3.056641 C 8.024088 2.893881 7.833658 2.760418 7.62207 2.65625 C 7.410481 2.552084 7.161458 2.5 6.875 2.5 L 3.125 2.5 C 2.871094 2.5 2.630208 2.548828 2.402344 2.646484 C 2.174479 2.744141 1.974284 2.879232 1.801758 3.051758 C 1.629232 3.224285 1.494141 3.42448 1.396484 3.652344 C 1.298828 3.880209 1.25 4.121094 1.25 4.375 L 1.25 5 Z M 8.75 14.375 C 8.75 13.600261 8.898111 12.871094 9.194336 12.1875 C 9.49056 11.503906 9.892578 10.908203 10.400391 10.400391 C 10.908203 9.892578 11.503906 9.490561 12.1875 9.194336 C 12.871093 8.898112 13.60026 8.75 14.375 8.75 C 14.889322 8.75 15.385741 8.816732 15.864258 8.950195 C 16.342773 9.083659 16.790363 9.272461 17.207031 9.516602 C 17.623697 9.760742 18.004557 10.055339 18.349609 10.400391 C 18.69466 10.745443 18.989258 11.126303 19.233398 11.542969 C 19.477539 11.959636 19.66634 12.407227 19.799805 12.885742 C 19.933268 13.364258 20 13.860678 20 14.375 C 20 15.14974 19.851887 15.878906 19.555664 16.5625 C 19.259439 17.246094 18.857422 17.841797 18.349609 18.349609 C 17.841797 18.857422 17.246094 19.259439 16.5625 19.555664 C 15.878906 19.851889 15.149739 20 14.375 20 C 13.59375 20 12.861328 19.853516 12.177734 19.560547 C 11.494141 19.267578 10.898438 18.867188 10.390625 18.359375 C 9.882812 17.851562 9.482422 17.255859 9.189453 16.572266 C 8.896484 15.888672 8.75 15.15625 8.75 14.375 Z M 15 15 L 16.875 15 C 17.04427 15 17.190754 14.938151 17.314453 14.814453 C 17.43815 14.690756 17.5 14.544271 17.5 14.375 C 17.5 14.205729 17.43815 14.059245 17.314453 13.935547 C 17.190754 13.81185 17.04427 13.75 16.875 13.75 L 15 13.75 L 15 11.875 C 14.999999 11.705729 14.93815 11.559245 14.814453 11.435547 C 14.690755 11.31185 14.544271 11.25 14.375 11.25 C 14.205729 11.25 14.059244 11.31185 13.935547 11.435547 C 13.811849 11.559245 13.75 11.705729 13.75 11.875 L 13.75 13.75 L 11.875 13.75 C 11.705729 13.75 11.559244 13.81185 11.435547 13.935547 C 11.311849 14.059245 11.25 14.205729 11.25 14.375 C 11.25 14.544271 11.311849 14.690756 11.435547 14.814453 C 11.559244 14.938151 11.705729 15 11.875 15 L 13.75 15 L 13.75 16.875 C 13.75 17.044271 13.811849 17.190756 13.935547 17.314453 C 14.059244 17.43815 14.205729 17.5 14.375 17.5 C 14.544271 17.5 14.690755 17.43815 14.814453 17.314453 C 14.93815 17.190756 14.999999 17.044271 15 16.875 Z " />
|
||||
</fluent:SettingsExpander.IconSource>
|
||||
<fluent:SettingsExpander.ActionIconSource>
|
||||
<fluent:PathIconSource Data="F1 M 6.25 16.875 C 6.25 16.705729 6.311849 16.559244 6.435547 16.435547 L 12.861328 10 L 6.435547 3.564453 C 6.311849 3.440756 6.25 3.294271 6.25 3.125 C 6.25 2.95573 6.311849 2.809246 6.435547 2.685547 C 6.559244 2.56185 6.705729 2.5 6.875 2.5 C 7.044271 2.5 7.190755 2.56185 7.314453 2.685547 L 14.189453 9.560547 C 14.31315 9.684245 14.375 9.830729 14.375 10 C 14.375 10.169271 14.31315 10.315756 14.189453 10.439453 L 7.314453 17.314453 C 7.190755 17.43815 7.044271 17.5 6.875 17.5 C 6.705729 17.5 6.559244 17.43815 6.435547 17.314453 C 6.311849 17.190756 6.25 17.044271 6.25 16.875 Z " />
|
||||
</fluent:SettingsExpander.ActionIconSource>
|
||||
</fluent:SettingsExpander>
|
||||
<fluent:SettingsExpander
|
||||
Click="{Navigate {Binding EventAggregator},
|
||||
ExistingProjectConfiguration,
|
||||
Route=ProjectConfiguration}"
|
||||
Description="Open an existing builder project"
|
||||
Header="Open a project"
|
||||
IsClickEnabled="True">
|
||||
<fluent:SettingsExpander.IconSource>
|
||||
<fluent:PathIconSource Data="F1 M 3.056641 18.75 C 2.646484 18.75 2.255859 18.666992 1.884766 18.500977 C 1.513672 18.334961 1.189779 18.113607 0.913086 17.836914 C 0.636393 17.560221 0.415039 17.236328 0.249023 16.865234 C 0.083008 16.494141 0 16.103516 0 15.693359 L 0 4.306641 C 0 3.896484 0.083008 3.505859 0.249023 3.134766 C 0.415039 2.763672 0.636393 2.439779 0.913086 2.163086 C 1.189779 1.886395 1.513672 1.665039 1.884766 1.499023 C 2.255859 1.333008 2.646484 1.25 3.056641 1.25 L 6.875 1.25 C 7.324219 1.25 7.709961 1.319988 8.032227 1.459961 C 8.354492 1.599936 8.644205 1.785482 8.901367 2.016602 C 9.158528 2.247723 9.397786 2.513021 9.619141 2.8125 C 9.840494 3.11198 10.071614 3.42448 10.3125 3.75 L 16.943359 3.75 C 17.353516 3.75 17.744141 3.833008 18.115234 3.999023 C 18.486328 4.165039 18.810221 4.386394 19.086914 4.663086 C 19.363605 4.939779 19.584961 5.263672 19.750977 5.634766 C 19.916992 6.005859 20 6.396484 20 6.806641 L 20 9.902344 C 19.817707 9.674479 19.622395 9.456381 19.414062 9.248047 C 19.205729 9.039714 18.984375 8.847656 18.75 8.671875 L 18.75 6.875 C 18.75 6.621095 18.701172 6.380209 18.603516 6.152344 C 18.505859 5.924479 18.370768 5.724284 18.198242 5.551758 C 18.025715 5.379232 17.82552 5.244142 17.597656 5.146484 C 17.369791 5.048829 17.128906 5.000001 16.875 5 L 10.185547 5 C 9.957682 5.156251 9.736328 5.309246 9.521484 5.458984 C 9.306641 5.608725 9.088541 5.742188 8.867188 5.859375 C 8.645833 5.976562 8.413086 6.070964 8.168945 6.142578 C 7.924805 6.214193 7.65625 6.25 7.363281 6.25 L 1.25 6.25 L 1.25 15.625 C 1.25 15.878906 1.298828 16.119791 1.396484 16.347656 C 1.494141 16.575521 1.629232 16.775717 1.801758 16.948242 C 1.974284 17.120768 2.174479 17.255859 2.402344 17.353516 C 2.630208 17.451172 2.871094 17.5 3.125 17.5 L 7.900391 17.5 C 8.011067 17.721354 8.129883 17.936197 8.256836 18.144531 C 8.383789 18.352865 8.522135 18.554688 8.671875 18.75 Z M 7.363281 5 C 7.539062 5.000001 7.70345 4.977215 7.856445 4.931641 C 8.009439 4.886068 8.154297 4.825847 8.291016 4.750977 C 8.427734 4.676107 8.562825 4.5931 8.696289 4.501953 C 8.829752 4.410808 8.964844 4.316406 9.101562 4.21875 C 8.951822 4.016928 8.805338 3.813477 8.662109 3.608398 C 8.51888 3.40332 8.36263 3.219402 8.193359 3.056641 C 8.024088 2.893881 7.833658 2.760418 7.62207 2.65625 C 7.410481 2.552084 7.161458 2.5 6.875 2.5 L 3.125 2.5 C 2.871094 2.5 2.630208 2.548828 2.402344 2.646484 C 2.174479 2.744141 1.974284 2.879232 1.801758 3.051758 C 1.629232 3.224285 1.494141 3.42448 1.396484 3.652344 C 1.298828 3.880209 1.25 4.121094 1.25 4.375 L 1.25 5 Z M 8.75 14.375 C 8.75 13.600261 8.898111 12.871094 9.194336 12.1875 C 9.49056 11.503906 9.892578 10.908203 10.400391 10.400391 C 10.908203 9.892578 11.503906 9.490561 12.1875 9.194336 C 12.871093 8.898112 13.60026 8.75 14.375 8.75 C 14.889322 8.75 15.385741 8.816732 15.864258 8.950195 C 16.342773 9.083659 16.790363 9.272461 17.207031 9.516602 C 17.623697 9.760742 18.004557 10.055339 18.349609 10.400391 C 18.69466 10.745443 18.989258 11.126303 19.233398 11.542969 C 19.477539 11.959636 19.66634 12.407227 19.799805 12.885742 C 19.933268 13.364258 20 13.860678 20 14.375 C 20 15.14974 19.851887 15.878906 19.555664 16.5625 C 19.259439 17.246094 18.857422 17.841797 18.349609 18.349609 C 17.841797 18.857422 17.246094 19.259439 16.5625 19.555664 C 15.878906 19.851889 15.149739 20 14.375 20 C 13.59375 20 12.861328 19.853516 12.177734 19.560547 C 11.494141 19.267578 10.898438 18.867188 10.390625 18.359375 C 9.882812 17.851562 9.482422 17.255859 9.189453 16.572266 C 8.896484 15.888672 8.75 15.15625 8.75 14.375 Z M 12.5 16.923828 C 12.688802 16.923828 12.848307 16.858725 12.978516 16.728516 L 16.25 13.457031 L 16.25 15.625 C 16.25 15.794271 16.311848 15.940756 16.435547 16.064453 C 16.559244 16.188152 16.705729 16.25 16.875 16.25 C 17.04427 16.25 17.190754 16.188152 17.314453 16.064453 C 17.43815 15.940756 17.5 15.794271 17.5 15.625 L 17.5 11.875 C 17.5 11.705729 17.43815 11.559245 17.314453 11.435547 C 17.190754 11.31185 17.04427 11.25 16.875 11.25 L 13.125 11.25 C 12.955729 11.25 12.809244 11.31185 12.685547 11.435547 C 12.561849 11.559245 12.5 11.705729 12.5 11.875 C 12.5 12.044271 12.561849 12.190756 12.685547 12.314453 C 12.809244 12.438151 12.955729 12.5 13.125 12.5 L 15.292969 12.5 L 12.021484 15.771484 C 11.891275 15.901693 11.826172 16.061197 11.826172 16.25 C 11.826172 16.438803 11.891275 16.598307 12.021484 16.728516 C 12.151691 16.858725 12.311197 16.923828 12.5 16.923828 Z " />
|
||||
</fluent:SettingsExpander.IconSource>
|
||||
<fluent:SettingsExpander.ActionIconSource>
|
||||
<fluent:PathIconSource Data="F1 M 6.25 16.875 C 6.25 16.705729 6.311849 16.559244 6.435547 16.435547 L 12.861328 10 L 6.435547 3.564453 C 6.311849 3.440756 6.25 3.294271 6.25 3.125 C 6.25 2.95573 6.311849 2.809246 6.435547 2.685547 C 6.559244 2.56185 6.705729 2.5 6.875 2.5 C 7.044271 2.5 7.190755 2.56185 7.314453 2.685547 L 14.189453 9.560547 C 14.31315 9.684245 14.375 9.830729 14.375 10 C 14.375 10.169271 14.31315 10.315756 14.189453 10.439453 L 7.314453 17.314453 C 7.190755 17.43815 7.044271 17.5 6.875 17.5 C 6.705729 17.5 6.559244 17.43815 6.435547 17.314453 C 6.311849 17.190756 6.25 17.044271 6.25 16.875 Z " />
|
||||
</fluent:SettingsExpander.ActionIconSource>
|
||||
</fluent:SettingsExpander>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class StartProjectConfigurationView : UserControl
|
||||
{
|
||||
public StartProjectConfigurationView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace Builder;
|
||||
|
||||
public class StartProjectConfigurationViewModel : ObservableViewModel
|
||||
{
|
||||
public StartProjectConfigurationViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user