mirror of
https://onedev.site.tesses.net/crosslang/crosslangdevstudio
synced 2026-02-08 09:15:45 +00:00
Get way further
This commit is contained in:
43
Views/AddProjectReferenceView.axaml
Normal file
43
Views/AddProjectReferenceView.axaml
Normal file
@@ -0,0 +1,43 @@
|
||||
<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:vm="clr-namespace:CrossLangDevStudio.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="CrossLangDevStudio.Views.AddProjectReferenceView"
|
||||
x:DataType="vm:AddProjectReferenceViewModel">
|
||||
<Design.DataContext>
|
||||
<!-- This only sets the DataContext for the previewer in an IDE,
|
||||
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
|
||||
<vm:AddProjectReferenceViewModel />
|
||||
</Design.DataContext>
|
||||
<Grid Margin="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ScrollViewer Grid.Row="0" HorizontalScrollBarVisibility="Auto">
|
||||
<ItemsControl ItemsSource="{Binding References}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0 10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="{Binding Path}" />
|
||||
<Button Grid.Column="1" Content="Remove" Command="{Binding RemoveCommand}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="1" Content="Add" Command="{Binding AddProjectCommand}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
14
Views/AddProjectReferenceView.axaml.cs
Normal file
14
Views/AddProjectReferenceView.axaml.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using AvaloniaEdit;
|
||||
using CrossLangDevStudio.ViewModels;
|
||||
|
||||
namespace CrossLangDevStudio.Views;
|
||||
|
||||
public partial class AddProjectReferenceView : UserControl
|
||||
{
|
||||
public AddProjectReferenceView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
}
|
||||
75
Views/CRVMViewerView.axaml
Normal file
75
Views/CRVMViewerView.axaml
Normal file
@@ -0,0 +1,75 @@
|
||||
<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:vm="clr-namespace:CrossLangDevStudio.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="CrossLangDevStudio.Views.CRVMViewerView"
|
||||
x:DataType="vm:CRVMViewerViewModel">
|
||||
<Design.DataContext>
|
||||
<!-- This only sets the DataContext for the previewer in an IDE,
|
||||
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
|
||||
<vm:CRVMViewerViewModel />
|
||||
</Design.DataContext>
|
||||
<ScrollViewer>
|
||||
<StackPanel Margin="20">
|
||||
<TextBlock FontSize="42" Margin="0 5">Functions:</TextBlock>
|
||||
<ItemsControl ItemsSource="{Binding Functions}" >
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock>
|
||||
<Run FontSize="24" Foreground="#6A9955" Text="{Binding Documentation}" />
|
||||
<LineBreak />
|
||||
<Run FontSize="24" Foreground="#569CD6" Text="func " />
|
||||
<Run FontSize="24" Foreground="#DCDCAA" Text="{Binding Name}" />
|
||||
<Run FontSize="24" Foreground="#C586C0" Text="(" />
|
||||
<Run FontSize="24" Foreground="#CCCCCC" Text="{Binding Args}" />
|
||||
<Run FontSize="24" Foreground="#C586C0" Text=")" />
|
||||
</TextBlock>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock FontSize="42" Margin="0 5">Classes:</TextBlock>
|
||||
<ItemsControl ItemsSource="{Binding Classes}" >
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock>
|
||||
<Run FontSize="24" Foreground="#6A9955" Text="{Binding Documentation}" />
|
||||
<LineBreak />
|
||||
<Run FontSize="24" Foreground="#569CD6" Text="class " />
|
||||
<Run FontSize="24" Foreground="#4EC9B0" Text="{Binding Name}" />
|
||||
<Run FontSize="24" Foreground="#CCCCCC" Text="{Binding InheritsColon}" />
|
||||
<Run FontSize="24" Foreground="#4EC9B0" Text="{Binding Inherits}" />
|
||||
<Run FontSize="24" Foreground="#CCCCCC" Text=" {" />
|
||||
</TextBlock>
|
||||
|
||||
<ItemsControl ItemsSource="{Binding Entries}" >
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock>
|
||||
<LineBreak />
|
||||
<Run FontSize="24" Foreground="#6A9955" Text="{Binding Documentation}" />
|
||||
<LineBreak />
|
||||
<Run FontSize="24" Foreground="#569CD6" Text="{Binding Modifiers}" />
|
||||
<Run FontSize="24" Foreground="{Binding NameColor}" Text="{Binding Name}" />
|
||||
<Run FontSize="24" Foreground="{Binding LeftParenColor}" Text="{Binding LeftParen}" />
|
||||
<Run FontSize="24" Foreground="#CCCCCC" Text="{Binding Args}" />
|
||||
<Run FontSize="24" Foreground="#C586C0" Text="{Binding RightParen}" />
|
||||
</TextBlock>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock>
|
||||
<LineBreak />
|
||||
<Run FontSize="24" Foreground="#CCCCCC" Text="}" />
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
|
||||
<!--4EC9B0-->
|
||||
14
Views/CRVMViewerView.axaml.cs
Normal file
14
Views/CRVMViewerView.axaml.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using AvaloniaEdit;
|
||||
using CrossLangDevStudio.ViewModels;
|
||||
|
||||
namespace CrossLangDevStudio.Views;
|
||||
|
||||
public partial class CRVMViewerView : UserControl
|
||||
{
|
||||
public CRVMViewerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,15 @@
|
||||
xmlns:vm="clr-namespace:CrossLangDevStudio.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="CrossLangDevStudio.Views.FileEditorView"
|
||||
xmlns:AvaloniaEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
|
||||
x:DataType="vm:FileEditorViewModel">
|
||||
<Design.DataContext>
|
||||
<!-- This only sets the DataContext for the previewer in an IDE,
|
||||
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
|
||||
<vm:FileEditorViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<TextBox FontSize="24" FontFamily="{StaticResource AardvarkFont}" Text="{Binding Text}" AcceptsReturn="True" AcceptsTab="True" TextWrapping="Wrap"/>
|
||||
|
||||
|
||||
<!--<TextBox FontSize="24" FontFamily="{StaticResource AardvarkFont}" Text="{Binding Text}" AcceptsReturn="True" AcceptsTab="True" TextWrapping="Wrap"/>-->
|
||||
|
||||
</UserControl>
|
||||
@@ -1,4 +1,5 @@
|
||||
using Avalonia.Controls;
|
||||
using AvaloniaEdit;
|
||||
using CrossLangDevStudio.ViewModels;
|
||||
|
||||
namespace CrossLangDevStudio.Views;
|
||||
@@ -8,5 +9,21 @@ public partial class FileEditorView : UserControl
|
||||
public FileEditorView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Loaded += (sender, e) =>
|
||||
{
|
||||
if (this.DataContext is FileEditorViewModel dc)
|
||||
{
|
||||
this.Content = dc.TextEditor;
|
||||
}
|
||||
};
|
||||
this.Unloaded += (sender, e) =>
|
||||
{
|
||||
this.Content = null;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -28,37 +28,38 @@
|
||||
<MenuItem Header="_Open Project" HotKey="Ctrl+O" Command="{Binding OpenProjectCommand}"/>
|
||||
<MenuItem Header="_Save" HotKey="Ctrl+S" Command="{Binding SaveCommand}"/>
|
||||
<MenuItem Header="Save All" HotKey="Ctrl+Shift+S" Command="{Binding SaveAllCommand}"/>
|
||||
<MenuItem Header="CrossLang Settings"/>
|
||||
<Separator/>
|
||||
<MenuItem Header="_Exit" HotKey="Alt+F4"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="_Project">
|
||||
<MenuItem Header="Build" Command="{Binding BuildCommand}" />
|
||||
<MenuItem Header="Build And Run" HotKey="F5" Command="{Binding BuildAndRunCommand}" />
|
||||
<MenuItem Header="Publish" Command="{Binding PublishCommand}" />
|
||||
<MenuItem Header="Open In File Manager" Command="{Binding OpenProjectInFileManagerCommand}" />
|
||||
<MenuItem Header="Open In Terminal" HotKey="CTRL+T" Command="{Binding OpenProjectInTerminalCommand}" />
|
||||
<MenuItem Header="Refresh" HotKey="CTRL+R" Command="{Binding RefreshListingCommand}" />
|
||||
</MenuItem>
|
||||
<MenuItem Header="_CPKG">
|
||||
<MenuItem Header="Add Package"/>
|
||||
<MenuItem Header="Add Package" Command="{Binding AddPackageCommand}"/>
|
||||
<MenuItem Header="Install">
|
||||
<MenuItem Header="Template"/>
|
||||
<MenuItem Header="Tool"/>
|
||||
<MenuItem Header="Web Application"/>
|
||||
<MenuItem Header="Console Application"/>
|
||||
<MenuItem Header="Template" Command="{Binding InstallTemplateCommand}"/>
|
||||
<MenuItem Header="Tool" Command="{Binding InstallToolCommand}"/>
|
||||
<MenuItem Header="Web Application" Command="{Binding InstallWebAppCommand}"/>
|
||||
<MenuItem Header="Console Application" Command="{Binding InstallConsoleCommand}"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Push Package"/>
|
||||
<MenuItem Header="Manage Servers"/>
|
||||
<MenuItem Header="Push Package" Command="{Binding PushPackageCommand}"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="_Help">
|
||||
|
||||
<MenuItem Header="Welcome"/>
|
||||
<MenuItem Header="Website"/>
|
||||
<MenuItem Header="Documentation"/>
|
||||
<MenuItem Header="Welcome" Command="{Binding WelcomeCommand}"/>
|
||||
<MenuItem Header="Website" Command="{Binding WebsiteCommand}"/>
|
||||
<MenuItem Header="Documentation" Command="{Binding DocumentationCommand}"/>
|
||||
<MenuItem Header="Video Documentation" Command="{Binding VideoDocumentationCommand}" />
|
||||
<MenuItem Header="Reference" Command="{Binding ReferenceCommand}" />
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
<Grid Grid.Row="1" ColumnDefinitions="300, 4, *">
|
||||
<TreeView Grid.Column="0" ItemsSource="{Binding ProjectFiles}" SelectedItem="{Binding SelectedProjectFile}">
|
||||
<TreeView Grid.Column="0" ItemsSource="{Binding ProjectFiles}" SelectedItem="{Binding SelectedProjectFile}">
|
||||
<!--Thanks to https://stackoverflow.com/a/77362693 -->
|
||||
<TreeView.ItemContainerTheme>
|
||||
<ControlTheme TargetType="TreeViewItem" BasedOn="{StaticResource {x:Type TreeViewItem}}">
|
||||
@@ -78,6 +79,7 @@
|
||||
<controls:TabsControl SelectedItem="{Binding SelectedTab}" Grid.Column="2" ItemsSource="{Binding TabItems}"
|
||||
NewItemFactory="{Binding NewItemFactory}"
|
||||
LastTabClosedAction="{Binding Closed}"
|
||||
TabClosing="{Binding ClosingTab}"
|
||||
ShowDefaultAddButton="True"
|
||||
ShowDefaultCloseButton="True"
|
||||
Margin="0 8 0 0"
|
||||
|
||||
@@ -1,21 +1,59 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Platform.Storage;
|
||||
using Avalonia.Threading;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using CrossLangDevStudio.Messages;
|
||||
using CrossLangDevStudio.ViewModels;
|
||||
using MsBox.Avalonia;
|
||||
using MsBox.Avalonia.Enums;
|
||||
using Tabalonia.Controls;
|
||||
|
||||
namespace CrossLangDevStudio.Views;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
private async Task CloseWindowAsync(WindowClosingEventArgs e, MainWindowViewModel vm)
|
||||
{
|
||||
var box = MessageBoxManager
|
||||
.GetMessageBoxStandard("Save?", $"You have unsaved work do you want to save?",
|
||||
ButtonEnum.YesNoCancel, MsBox.Avalonia.Enums.Icon.Question);
|
||||
|
||||
switch (await box.ShowWindowDialogAsync(this))
|
||||
{
|
||||
case ButtonResult.Yes:
|
||||
vm.SaveAll();
|
||||
break;
|
||||
case ButtonResult.Cancel:
|
||||
e.Cancel = true;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (Design.IsDesignMode)
|
||||
return;
|
||||
this.Closing += (sender, e) =>
|
||||
{
|
||||
if (this.DataContext is MainWindowViewModel vm)
|
||||
{
|
||||
if (vm.HasUnsaved)
|
||||
{
|
||||
//thanks https://github.com/AvaloniaUI/Avalonia/issues/4810#issuecomment-704372304
|
||||
using (var source = new CancellationTokenSource())
|
||||
{
|
||||
CloseWindowAsync(e, vm).ContinueWith(e => source.Cancel(), TaskScheduler.FromCurrentSynchronizationContext());
|
||||
Dispatcher.UIThread.MainLoop(source.Token);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Whenever 'Send(new PurchaseAlbumMessage())' is called, invoke this callback on the MainWindow instance:
|
||||
WeakReferenceMessenger.Default.Register<MainWindow, NewProjectMessage>(this, static (w, m) =>
|
||||
@@ -27,6 +65,7 @@ public partial class MainWindow : Window
|
||||
};
|
||||
// Show dialog window and reply with returned AlbumViewModel or null when the dialog is closed.
|
||||
m.Reply(dialog.ShowDialog<string?>(w));
|
||||
|
||||
});
|
||||
WeakReferenceMessenger.Default.Register<MainWindow, InstallPackageMessage>(this, static (w, m) =>
|
||||
{
|
||||
@@ -42,6 +81,13 @@ public partial class MainWindow : Window
|
||||
m.Reply(w);
|
||||
}
|
||||
);
|
||||
|
||||
WeakReferenceMessenger.Default.Register<MainWindow, PublishMessage>(this, static (w, m) =>
|
||||
{
|
||||
var dialog = new PublishDialogView
|
||||
{
|
||||
DataContext = new PublishDialogViewModel(m.Path)
|
||||
};
|
||||
m.Reply(dialog.ShowDialog(w));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
|
||||
<vm:NewProjectDialogViewModel/>
|
||||
</Design.DataContext>
|
||||
<Grid>
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -32,19 +32,19 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Column="0" Source="{Binding Icon}" />
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}"/>
|
||||
<TextBlock Margin="10 0 0 0" Grid.Column="1" Text="{Binding Name}" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid Grid.Row="1" Margin="0 10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Content="Name: " />
|
||||
<TextBox Grid.Column="1" Text="{Binding Name}" />
|
||||
<TextBox Margin="10 0 0 0" Grid.Column="1" Text="{Binding Name}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -53,16 +53,16 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Content="Parent Directory: " />
|
||||
<TextBox Grid.Column="1" Text="{Binding ParentDirectory}"/>
|
||||
<Button Grid.Column="2" Content="Browse..." />
|
||||
<TextBox Margin="10 0" Grid.Column="1" Text="{Binding ParentDirectory}"/>
|
||||
<Button Grid.Column="2" Content="Browse..." Command="{Binding BrowseCommand}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="3">
|
||||
<Grid Grid.Row="3" Margin="0 10 0 0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="1" Content="OK" Command="{Binding OKCommand}" />
|
||||
<Button Margin="10 0" Grid.Column="1" Content="OK" Command="{Binding OKCommand}" />
|
||||
<Button Grid.Column="2" Content="Cancel" Command="{Binding CancelCommand}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
|
||||
<vm:PackageManagerViewModel />
|
||||
</Design.DataContext>
|
||||
<Grid>
|
||||
<Grid Margin="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
@@ -25,21 +25,21 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Grid.Column="0" Text="{Binding Search}" Watermark="Search..." />
|
||||
<ComboBox Grid.Column="1" ItemsSource="{Binding Servers}" SelectedIndex="{Binding ServerIndex}" />
|
||||
<ComboBox Margin="20 0" Grid.Column="1" ItemsSource="{Binding Servers}" SelectedIndex="{Binding ServerIndex}" />
|
||||
<Button Grid.Column="2" Content="Search" Command="{Binding SearchPackagesCommand}" />
|
||||
</Grid>
|
||||
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto">
|
||||
<ItemsControl ItemsSource="{Binding PackageList}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid Margin="0 20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="64" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Column="0" Source="{Binding Icon}" />
|
||||
<Grid Grid.Column="1">
|
||||
<Grid Grid.Column="1" Margin="20 0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
|
||||
@@ -43,10 +43,10 @@
|
||||
<TextBox Watermark="Project Homepage" Text="{Binding Homepage}"/>
|
||||
<TextBlock Margin="0 5" >License:</TextBlock>
|
||||
<TextBox Watermark="Project License" Text="{Binding License}"/>
|
||||
<TextBlock Margin="0 5" >Template Name (Shown in crosslang new --list):</TextBlock>
|
||||
<TextBox Watermark="Project Template Name" Text="{Binding TemplateName}"/>
|
||||
<TextBlock Margin="0 5" >Template Pretty Name (Shown in new project):</TextBlock>
|
||||
<TextBox Watermark="Project Template Pretty Name" Text="{Binding TemplateNamePretty}"/>
|
||||
<TextBlock Margin="0 5" >Short Name (Shown in crosslang new --list or tool or console name):</TextBlock>
|
||||
<TextBox Watermark="Project Short Name" Text="{Binding ShortName}"/>
|
||||
<TextBlock Margin="0 5" >Short Pretty Name (Shown in new project):</TextBlock>
|
||||
<TextBox Watermark="Project Short Pretty Name" Text="{Binding ShortNamePretty}"/>
|
||||
<TextBlock Margin="0 15 0 5">Description:</TextBlock>
|
||||
<TextBox Height="100" Text="{Binding Description}" AcceptsReturn="True" AcceptsTab="True" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
79
Views/PublishDialogView.axaml
Normal file
79
Views/PublishDialogView.axaml
Normal file
@@ -0,0 +1,79 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:CrossLangDevStudio.ViewModels"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
Width="640"
|
||||
Height="480"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
x:Class="CrossLangDevStudio.Views.PublishDialogView"
|
||||
x:DataType="vm:PublishDialogViewModel"
|
||||
Icon="/Assets/crosslang.ico"
|
||||
Title="Publish">
|
||||
<Design.DataContext>
|
||||
<!-- This only sets the DataContext for the previewer in an IDE,
|
||||
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
|
||||
<vm:PublishDialogViewModel/>
|
||||
</Design.DataContext>
|
||||
|
||||
<Grid Margin="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Margin="0 5" Grid.Row="0" Content="Package Prefix" />
|
||||
<TextBox Grid.Row="1" Text="{Binding Prefix}" />
|
||||
<Label Margin="0 5" Grid.Row="2" Content="Server (click load even if correct and if package prefix is changed)" />
|
||||
<Grid Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ComboBox Grid.Column="0" ItemsSource="{Binding Servers}" SelectedIndex="{Binding ServerIndex}" HorizontalAlignment="Stretch" />
|
||||
<Button Grid.Column="1" Content="Load" Command="{Binding LoadCommand}" />
|
||||
</Grid>
|
||||
<Label Margin="0 5" Grid.Row="4" Content="Target" />
|
||||
<ComboBox Grid.Row="5" ItemsSource="{Binding Targets}" SelectedIndex="{Binding TargetIndex}" HorizontalAlignment="Stretch" />
|
||||
<Label Margin="0 5" Grid.Row="6" Content="Output type" />
|
||||
<ComboBox Grid.Row="7" SelectedIndex="{Binding OutputType}" HorizontalAlignment="Stretch">
|
||||
<ComboBoxItem>Directory</ComboBoxItem>
|
||||
<ComboBoxItem>ZIP</ComboBoxItem>
|
||||
<ComboBoxItem>TAR</ComboBoxItem>
|
||||
<ComboBoxItem>TAR.GZ</ComboBoxItem>
|
||||
<ComboBoxItem>TAR.BZ2</ComboBoxItem>
|
||||
</ComboBox>
|
||||
|
||||
<Label Margin="0 5" Grid.Row="8" Content="{Binding OutputLabel}" />
|
||||
<Grid Grid.Row="9">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBox Grid.Column="0" Text="{Binding Output}" />
|
||||
<Button Grid.Column="1" Content="Browse" Command="{Binding BrowseCommand}" />
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="11">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="1" Content="Publish" Command="{Binding PublishCommand}" Margin="0 0 5 0"/>
|
||||
<Button Grid.Column="2" Content="Cancel" Command="{Binding CancelCommand}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
21
Views/PublishDialogView.axaml.cs
Normal file
21
Views/PublishDialogView.axaml.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Diagnostics;
|
||||
using Avalonia.Controls;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using CrossLangDevStudio.Messages;
|
||||
|
||||
namespace CrossLangDevStudio.Views;
|
||||
|
||||
public partial class PublishDialogView : Window
|
||||
{
|
||||
public PublishDialogView()
|
||||
{
|
||||
InitializeComponent();
|
||||
if (Design.IsDesignMode) return;
|
||||
|
||||
WeakReferenceMessenger.Default.Register<PublishDialogView, PublishCloseMessage>(this, static (w, m) =>
|
||||
{
|
||||
w.Close(false);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user