WIP: Add iOS version #10

Draft
Deadpikle wants to merge 67 commits from feature/ios into main
7 changed files with 178 additions and 2 deletions
Showing only changes of commit fa82407915 - Show all commits
+3
View File
@@ -109,6 +109,9 @@
<DataTemplate DataType="{x:Type viewModels:SettingsViewModel}">
<views:SettingsView/>
</DataTemplate>
<DataTemplate DataType="{x:Type viewModels:StartNewChooseReportViewModel}">
<views:StartNewChooseReport/>
</DataTemplate>
</Application.DataTemplates>
<Application.Resources>
<ResourceDictionary>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

+1 -1
View File
@@ -60,7 +60,7 @@
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference>
<PackageReference Include="PDFsharp-MigraDoc" Version="6.2.4" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.10.4" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.11.0" />
<PackageReference Include="Deadpikle.AvaloniaProgressRing" Version="0.10.11-preview20251127001" />
<PackageReference Include="DialogHost.Avalonia" Version="0.10.4" />
<PackageReference Include="Xaml.Behaviors.Interactions.DragAndDrop.DataGrid" Version="11.3.9.5" />
@@ -12,7 +12,7 @@ class MainViewModel : ChangeNotifier, IChangeViewModel
public MainViewModel(ITopLevelGrabber topLevelGrabber)
{
_viewModels = new Stack<BaseViewModel>();
var initialViewModel = new CreatePDFReportViewModel(this)
var initialViewModel = new StartNewChooseReportViewModel(this)
{
TopLevelGrabber = topLevelGrabber
};
@@ -0,0 +1,77 @@
#nullable enable
using System;
using System.Collections.ObjectModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Avalonia.Platform.Storage;
using Avalonia.Themes.Fluent;
using DialogHostAvalonia;
using ImageMagick;
using MigraDoc.DocumentObjectModel;
using MigraDoc.Rendering;
using PdfSharp.Fonts;
using PdfSharp.Pdf.IO;
using PdfSharp.Snippets.Font;
using MayShow.Interfaces;
using MayShow.Models;
using MayShow.Helpers;
namespace MayShow.ViewModels;
class StartNewChooseReportViewModel : BaseViewModel
{
private string _creatingReportTitle;
private ObservableCollection<string> _savedReports;
public StartNewChooseReportViewModel(IChangeViewModel viewModelChanger) : base(viewModelChanger)
{
_creatingReportTitle = "";
// TODO: load existing reports
_savedReports = [];
for (var i = 1; i <= 100; i++)
{
_savedReports.Add("Report " + i);
}
}
public string Version
{
get => Constants.AppVersion;
}
public string CreatingReportTitle
{
get => _creatingReportTitle;
set { _creatingReportTitle = value; NotifyPropertyChanged(); }
}
public ObservableCollection<string> SavedReports
{
get => _savedReports;
set { _savedReports = value; NotifyPropertyChanged(); }
}
public void StartReport()
{
// TODO: make sure there is a folder and everything set up for this report
ViewModelChanger.PushViewModel(new CreatePDFReportViewModel(ViewModelChanger)
{
ReportTitle = CreatingReportTitle
});
CreatingReportTitle = ""; // when user comes back they can start another new report
// TODO: add to existing reports list
}
public void LoadExistingReport()
{
// TODO: load data and send to create PDF report view model
}
public void DeleteExistingReport()
{
// TODO: warn user, delete if they want to proceed
}
}
@@ -0,0 +1,82 @@
<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"
mc:Ignorable="d"
d:DesignWidth="800"
d:DesignHeight="450"
x:Class="MayShow.Views.StartNewChooseReport"
xmlns:models="clr-namespace:MayShow.Models"
xmlns:vm="clr-namespace:MayShow.ViewModels"
xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
x:DataType="vm:StartNewChooseReportViewModel">
<Grid ColumnDefinitions="100, *, 100"
RowDefinitions="Auto, Auto, Auto, Auto, Auto, *">
<TextBlock HorizontalAlignment="Center"
FontSize="36"
FontWeight="Bold"
Margin="0,16,0,0"
Grid.Column="1"
Grid.Row="0">
MayShow <Run Text="{Binding Version}"/>
</TextBlock>
<Image Source="avares://MayShow/Assets/MayShowIcon.png"
Width="125"
Margin="0,24,0,0"
HorizontalAlignment="Center"
Grid.Column="1"
Grid.Row="1" />
<Label Content="Start New Project"
HorizontalAlignment="Left"
FontSize="18"
FontWeight="Bold"
Margin="0,24,0,0"
Grid.Column="1"
Grid.Row="2"/>
<Grid HorizontalAlignment="Stretch"
ColumnDefinitions="*, Auto"
Margin="0,8,0,0"
Grid.Column="1"
Grid.Row="3">
<TextBox Watermark="Report Title"
Classes="clearButton"
Text="{Binding CreatingReportTitle}"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
TextWrapping="Wrap"
Margin="0,0,16,0"
Grid.Column="0" />
<Button Command="{Binding StartReport}"
Classes="accent"
Grid.Column="1">
<TextBlock>
<Run Text="&#xe494;"
FontFamily="{StaticResource FontAwesomeSolid}" /> Create and Start Report</TextBlock>
</Button>
</Grid>
<Label Content="Load Existing Project"
FontSize="18"
FontWeight="Bold"
HorizontalAlignment="Left"
Margin="0,16,0,0"
Grid.Column="1"
Grid.Row="4"/>
<ScrollViewer Margin="0,8,0,8"
Grid.Column="1"
Grid.Row="5"
VerticalScrollBarVisibility="Visible"
AllowAutoHide="False"
HorizontalScrollBarVisibility="Disabled">
<ItemsControl ItemsSource="{Binding SavedReports}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding}" />
<!-- TODO: buttons to load, delete reports -->
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</UserControl>
@@ -0,0 +1,14 @@
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace MayShow.Views;
public partial class StartNewChooseReport : UserControl
{
public StartNewChooseReport()
{
this.InitializeComponent();
}
}