Batch Update
This commit is contained in:
parent
693d12b61c
commit
4c2b5cca93
32 changed files with 483 additions and 332 deletions
|
|
@ -10,5 +10,29 @@
|
|||
x:Class="InkForge.Desktop.Views.Documents.WelcomePageDocument"
|
||||
x:DataType="vm:WelcomePageDocumentViewModel"
|
||||
inkforge:TopLevels.Register="{CompiledBinding}">
|
||||
Welcome to Avalonia!
|
||||
<Grid RowDefinitions="Auto, *, Auto">
|
||||
<Label Target="RecentItemsList"
|
||||
Content="Open Recent"
|
||||
Grid.Row="0" />
|
||||
|
||||
<DataGrid Name="RecentItemsList"
|
||||
IsEnabled="False"
|
||||
IsReadOnly="True"
|
||||
Grid.Row="1">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Name"
|
||||
Width="*" />
|
||||
<DataGridTextColumn Header="Last Used" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Menu Grid.Row="2">
|
||||
<MenuItem Header="Create New"
|
||||
Command="{CompiledBinding CreateNew}" />
|
||||
<MenuItem Header="Open"
|
||||
IsEnabled="False" />
|
||||
<MenuItem Header="Open File"
|
||||
Command="{CompiledBinding OpenNew}" />
|
||||
</Menu>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
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:inkforge="using:InkForge.Desktop.ViewModels"
|
||||
mc:Ignorable="d"
|
||||
d:DesignWidth="800"
|
||||
d:DesignHeight="450"
|
||||
x:Class="InkForge.Desktop.Views.DocumentsView"
|
||||
x:DataType="inkforge:DocumentsViewModel">
|
||||
<DockControl Layout="{CompiledBinding Layout}" />
|
||||
</UserControl>
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
|
||||
using InkForge.Desktop.ViewModels;
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace InkForge.Desktop.Views;
|
||||
|
||||
public partial class DocumentsView : UserControl
|
||||
{
|
||||
public DocumentsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = CreateViewModel();
|
||||
}
|
||||
|
||||
private static DocumentsViewModel CreateViewModel()
|
||||
{
|
||||
return ActivatorUtilities.CreateInstance<DocumentsViewModel>(
|
||||
Application.Current!.GetValue(App.ServiceProviderProperty)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,12 +2,16 @@
|
|||
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:inkforge="app:InkForge"
|
||||
xmlns:local="using:InkForge.Desktop.Views"
|
||||
xmlns:vm="using:InkForge.Desktop.ViewModels"
|
||||
mc:Ignorable="d"
|
||||
Width="800"
|
||||
Height="450"
|
||||
x:Class="InkForge.Desktop.Views.MainWindow"
|
||||
Title="MainWindow">
|
||||
x:DataType="vm:MainViewModel"
|
||||
Title="MainWindow"
|
||||
inkforge:TopLevels.Register="{CompiledBinding}">
|
||||
<NativeMenu.Menu>
|
||||
<NativeMenu />
|
||||
</NativeMenu.Menu>
|
||||
|
|
@ -15,13 +19,6 @@
|
|||
<DockPanel>
|
||||
<NativeMenuBar DockPanel.Dock="Top" />
|
||||
|
||||
<SplitView IsPaneOpen="true"
|
||||
DisplayMode="Inline">
|
||||
<SplitView.Pane>
|
||||
<local:WorkspacesView />
|
||||
</SplitView.Pane>
|
||||
|
||||
<local:DocumentsView />
|
||||
</SplitView>
|
||||
<DockControl Layout="{CompiledBinding Layout}" />
|
||||
</DockPanel>
|
||||
</Window>
|
||||
|
|
@ -1,11 +1,24 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia;
|
||||
using Avalonia.ReactiveUI;
|
||||
|
||||
using InkForge.Desktop.ViewModels;
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace InkForge.Desktop.Views;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
public partial class MainWindow : ReactiveWindow<MainViewModel>
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
ViewModel = CreateViewModel();
|
||||
}
|
||||
|
||||
private static MainViewModel CreateViewModel()
|
||||
{
|
||||
return ActivatorUtilities.CreateInstance<MainViewModel>(
|
||||
Application.Current!.GetValue(App.ServiceProviderProperty)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
32
app/InkForge.Desktop/Views/Tools/WorkspaceTool.axaml
Normal file
32
app/InkForge.Desktop/Views/Tools/WorkspaceTool.axaml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
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:local="using:InkForge.Desktop.Views.Tools"
|
||||
xmlns:workspaces="using:InkForge.Desktop.Views.Workspaces"
|
||||
xmlns:vm="using:InkForge.Desktop.ViewModels.Tools"
|
||||
mc:Ignorable="d"
|
||||
d:DesignWidth="800"
|
||||
d:DesignHeight="450"
|
||||
x:Class="InkForge.Desktop.Views.Tools.WorkspaceTool"
|
||||
x:DataType="vm:WorkspaceTool"
|
||||
Classes.HasWorkspace="{CompiledBinding Workspace, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
|
||||
<UserControl.Styles>
|
||||
<Style Selector="local|WorkspaceTool">
|
||||
<Setter Property="Content">
|
||||
<Template>
|
||||
<TextBlock>No workspace selected.</TextBlock>
|
||||
</Template>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^.HasWorkspace">
|
||||
<Setter Property="Content">
|
||||
<Template>
|
||||
<workspaces:WorkspaceView DataContext="{CompiledBinding Workspace}" />
|
||||
</Template>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
</UserControl>
|
||||
11
app/InkForge.Desktop/Views/Tools/WorkspaceTool.axaml.cs
Normal file
11
app/InkForge.Desktop/Views/Tools/WorkspaceTool.axaml.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
using Avalonia.ReactiveUI;
|
||||
|
||||
namespace InkForge.Desktop.Views.Tools;
|
||||
|
||||
public partial class WorkspaceTool : ReactiveUserControl<ViewModels.Tools.WorkspaceTool>
|
||||
{
|
||||
public WorkspaceTool()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
mc:Ignorable="d"
|
||||
d:DesignWidth="800"
|
||||
d:DesignHeight="450"
|
||||
x:Class="InkForge.Desktop.Views.Workspaces.WorkspaceViewModel"
|
||||
x:Class="InkForge.Desktop.Views.Workspaces.WorkspaceView"
|
||||
x:DataType="vm:WorkspaceViewModel">
|
||||
|
||||
<Grid ColumnDefinitions="*, Auto"
|
||||
13
app/InkForge.Desktop/Views/Workspaces/WorkspaceView.axaml.cs
Normal file
13
app/InkForge.Desktop/Views/Workspaces/WorkspaceView.axaml.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using Avalonia.ReactiveUI;
|
||||
|
||||
using InkForge.Desktop.ViewModels.Workspaces;
|
||||
|
||||
namespace InkForge.Desktop.Views.Workspaces;
|
||||
|
||||
public partial class WorkspaceView : ReactiveUserControl<WorkspaceViewModel>
|
||||
{
|
||||
public WorkspaceView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace InkForge.Desktop.Views.Workspaces;
|
||||
|
||||
public partial class WorkspaceViewModel : UserControl
|
||||
{
|
||||
public WorkspaceViewModel()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
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:reactiveui="http://reactiveui.net"
|
||||
xmlns:local="using:InkForge.Desktop.Views"
|
||||
xmlns:inkforge="app:InkForge"
|
||||
xmlns:vm="using:InkForge.Desktop.ViewModels"
|
||||
mc:Ignorable="d"
|
||||
d:DesignWidth="800"
|
||||
d:DesignHeight="450"
|
||||
x:Class="InkForge.Desktop.Views.WorkspacesView"
|
||||
x:DataType="vm:WorkspacesViewModel"
|
||||
Classes.HasWorkspace="{CompiledBinding Workspace}">
|
||||
|
||||
<UserControl.Styles>
|
||||
<Style Selector="local|WorkspacesView">
|
||||
<Style Selector="^:not(.HasWorkspace)">
|
||||
<Setter Property="Content">
|
||||
<Template>
|
||||
<TextBlock>
|
||||
No workspace selected.
|
||||
</TextBlock>
|
||||
</Template>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="^.HasWorkspace">
|
||||
<Setter Property="Content"
|
||||
Value="{CompiledBinding Workspace}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
</UserControl>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
using Avalonia.Controls;
|
||||
|
||||
using InkForge.Desktop.ViewModels;
|
||||
|
||||
using Splat;
|
||||
|
||||
namespace InkForge.Desktop.Views;
|
||||
|
||||
public partial class WorkspacesView : UserControl
|
||||
{
|
||||
public WorkspacesView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = Locator.Current.GetService<WorkspacesViewModel>();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue