Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion build/Package.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@

<PackageProjectUrl>https://github.com/Onebeld/PleasantUI</PackageProjectUrl>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="HotAvalonia" Version="3.*" PrivateAssets="All" Publish="True" />
<PackageReference Include="MonoMod.RuntimeDetour" Version="*" PrivateAssets="All" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="12.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="**\*.axaml"/>
<Compile Update="**\*.axaml.cs"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ApplicationIcon>PleasantUIIcon.ico</ApplicationIcon>
<IncludeAvaloniaGenerators>true</IncludeAvaloniaGenerators>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>embedded</DebugType>
<IncludeSymbolsInSingleFile>true</IncludeSymbolsInSingleFile>
Expand All @@ -23,6 +23,9 @@
<PackageReference Include="Avalonia.Desktop" Version="12.0.0" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.0" />
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="9.0.8" />
<PackageReference Include="HotAvalonia" Version="3.*" PrivateAssets="All" Publish="True" />
<PackageReference Include="MonoMod.RuntimeDetour" Version="*" PrivateAssets="All" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="12.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
70 changes: 35 additions & 35 deletions samples/PleasantUI.Example/Factories/ControlPageCardsFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,55 @@ public AvaloniaList<ControlPageCard> CreateBasicControlPageCards()
{
return
[
new("CardTitle/Button", MaterialIcons.ButtonCursor, "Card/Button", new ButtonPage(), _eventAggregator),
new("CardTitle/Checkbox", MaterialIcons.CheckboxMarkedOutline,"Card/Checkbox", new CheckBoxPage(), _eventAggregator),
new("CardTitle/Progress", MaterialIcons.ProgressHelper, "Card/Progress", new ProgressPage(), _eventAggregator),
new("CardTitle/Calendar", MaterialIcons.CalendarOutline, "Card/Calendar", new CalendarPage(), _eventAggregator),
new("CardTitle/Carousel", MaterialIcons.ViewCarouselOutline, "Card/Carousel", new CarouselPage(), _eventAggregator),
new("CardTitle/ComboBox", MaterialIcons.ExpandAllOutline, "Card/ComboBox", new ComboBoxPage(), _eventAggregator),
new("CardTitle/TextBox", MaterialIcons.FormTextbox, "Card/TextBox", new TextBoxPage(), _eventAggregator),
new("CardTitle/DataGrid", MaterialIcons.Grid, "Card/DataGrid", new DataGridPage(), _eventAggregator),
new("CardTitle/PinCode", MaterialIcons.KeyboardOutline, "Card/PinCode", new PinCodePage(), _eventAggregator),
new("CardTitle/SelectionList", MaterialIcons.ViewListOutline, "Card/SelectionList", new SelectionListPage(), _eventAggregator),
new("CardTitle/Button", MaterialIcons.ButtonCursor, "Card/Button", () => new ButtonPage(), _eventAggregator),
new("CardTitle/Checkbox", MaterialIcons.CheckboxMarkedOutline,"Card/Checkbox", () => new CheckBoxPage(), _eventAggregator),
new("CardTitle/Progress", MaterialIcons.ProgressHelper, "Card/Progress", () => new ProgressPage(), _eventAggregator),
new("CardTitle/Calendar", MaterialIcons.CalendarOutline, "Card/Calendar", () => new CalendarPage(), _eventAggregator),
new("CardTitle/Carousel", MaterialIcons.ViewCarouselOutline, "Card/Carousel", () => new CarouselPage(), _eventAggregator),
new("CardTitle/ComboBox", MaterialIcons.ExpandAllOutline, "Card/ComboBox", () => new ComboBoxPage(), _eventAggregator),
new("CardTitle/TextBox", MaterialIcons.FormTextbox, "Card/TextBox", () => new TextBoxPage(), _eventAggregator),
new("CardTitle/DataGrid", MaterialIcons.Grid, "Card/DataGrid", () => new DataGridPage(), _eventAggregator),
new("CardTitle/PinCode", MaterialIcons.KeyboardOutline, "Card/PinCode", () => new PinCodePage(), _eventAggregator),
new("CardTitle/SelectionList", MaterialIcons.ViewListOutline, "Card/SelectionList", () => new SelectionListPage(), _eventAggregator),
];
}

public AvaloniaList<ControlPageCard> CreatePleasantControlPageCards()
{
return
[
new("CardTitle/PleasantSnackbar", MaterialIcons.InformationOutline, "Card/PleasantSnackbar", new PleasantSnackbarPage(), _eventAggregator),
new("CardTitle/InformationBlock", MaterialIcons.InformationBoxOutline, "Card/InformationBlock", new InformationBlockPage(), _eventAggregator),
new("CardTitle/OptionsDisplayItem", MaterialIcons.ViewListOutline, "Card/OptionsDisplayItem", new OptionsDisplayItemPage(), _eventAggregator),
new("CardTitle/PleasantTabView", MaterialIcons.Tab, "Card/PleasantTabView", new PleasantTabViewPage(), _eventAggregator),
new("CardTitle/PleasantMenu", MaterialIcons.MenuOpen, "Card/PleasantMenu", new PleasantMenuPage(), _eventAggregator),
new("CardTitle/Timeline", MaterialIcons.TimelineOutline, "Card/Timeline", new TimelinePage(), _eventAggregator),
new("CardTitle/InstallWizard", MaterialIcons.WizardHat, "Card/InstallWizard", new InstallWizardPage(), _eventAggregator),
new("CardTitle/PleasantDrawer", MaterialIcons.DrawingBox, "Card/PleasantDrawer", new PleasantDrawerPage(), _eventAggregator),
new("CardTitle/PopConfirm", MaterialIcons.CheckboxMarkedCircle, "Card/PopConfirm", new PopConfirmPage(), _eventAggregator),
new("CardTitle/PathPicker", MaterialIcons.FolderOpenOutline, "Card/PathPicker", new PathPickerPage(), _eventAggregator),
new("CardTitle/PleasantMiniWindow", MaterialIcons.WindowMinimize, "Card/PleasantMiniWindow", new PleasantMiniWindowPage(), _eventAggregator),
new("CardTitle/BreadcrumbBar", MaterialIcons.PageNextOutline, "Card/BreadcrumbBar", new BreadcrumbBarPage(), _eventAggregator),
new("CardTitle/CommandBar", MaterialIcons.ViewGridOutline, "Card/CommandBar", new CommandBarPage(), _eventAggregator),
new("CardTitle/DashboardCard", MaterialIcons.ViewDashboardOutline, "Card/DashboardCard", new DashboardCardPage(), _eventAggregator),
new("CardTitle/LogViewerPanel", MaterialIcons.TextBoxOutline, "Card/LogViewerPanel", new LogViewerPanelPage(), _eventAggregator),
new("CardTitle/TerminalPanel", MaterialIcons.ConsoleLine, "Card/TerminalPanel", new TerminalPanelPage(), _eventAggregator),
new("CardTitle/TreeViewPanel", MaterialIcons.FileTreeOutline, "Card/TreeViewPanel", new TreeViewPanelPage(), _eventAggregator),
new("CardTitle/ItemListPanel", MaterialIcons.FormatListBulletedType, "Card/ItemListPanel", new ItemListPanelPage(), _eventAggregator),
new("CardTitle/PropertyGrid", MaterialIcons.TableColumnPlusAfter, "Card/PropertyGrid", new PropertyGridPage(), _eventAggregator),
new("CardTitle/DownloadPanel", MaterialIcons.DownloadOutline, "Card/DownloadPanel", new DownloadPanelPage(), _eventAggregator),
new("CardTitle/CrashReportDialog", MaterialIcons.BugOutline, "Card/CrashReportDialog", new CrashReportDialogPage(), _eventAggregator),
new("CardTitle/PleasantSnackbar", MaterialIcons.InformationOutline, "Card/PleasantSnackbar", () => new PleasantSnackbarPage(), _eventAggregator),
new("CardTitle/InformationBlock", MaterialIcons.InformationBoxOutline, "Card/InformationBlock", () => new InformationBlockPage(), _eventAggregator),
new("CardTitle/OptionsDisplayItem", MaterialIcons.ViewListOutline, "Card/OptionsDisplayItem", () => new OptionsDisplayItemPage(), _eventAggregator),
new("CardTitle/PleasantTabView", MaterialIcons.Tab, "Card/PleasantTabView", () => new PleasantTabViewPage(), _eventAggregator),
new("CardTitle/PleasantMenu", MaterialIcons.MenuOpen, "Card/PleasantMenu", () => new PleasantMenuPage(), _eventAggregator),
new("CardTitle/Timeline", MaterialIcons.TimelineOutline, "Card/Timeline", () => new TimelinePage(), _eventAggregator),
new("CardTitle/InstallWizard", MaterialIcons.WizardHat, "Card/InstallWizard", () => new InstallWizardPage(), _eventAggregator),
new("CardTitle/PleasantDrawer", MaterialIcons.DrawingBox, "Card/PleasantDrawer", () => new PleasantDrawerPage(), _eventAggregator),
new("CardTitle/PopConfirm", MaterialIcons.CheckboxMarkedCircle, "Card/PopConfirm", () => new PopConfirmPage(), _eventAggregator),
new("CardTitle/PathPicker", MaterialIcons.FolderOpenOutline, "Card/PathPicker", () => new PathPickerPage(), _eventAggregator),
new("CardTitle/PleasantMiniWindow", MaterialIcons.WindowMinimize, "Card/PleasantMiniWindow", () => new PleasantMiniWindowPage(), _eventAggregator),
new("CardTitle/BreadcrumbBar", MaterialIcons.PageNextOutline, "Card/BreadcrumbBar", () => new BreadcrumbBarPage(), _eventAggregator),
new("CardTitle/CommandBar", MaterialIcons.ViewGridOutline, "Card/CommandBar", () => new CommandBarPage(), _eventAggregator),
new("CardTitle/DashboardCard", MaterialIcons.ViewDashboardOutline, "Card/DashboardCard", () => new DashboardCardPage(), _eventAggregator),
new("CardTitle/LogViewerPanel", MaterialIcons.TextBoxOutline, "Card/LogViewerPanel", () => new LogViewerPanelPage(), _eventAggregator),
new("CardTitle/TerminalPanel", MaterialIcons.ConsoleLine, "Card/TerminalPanel", () => new TerminalPanelPage(), _eventAggregator),
new("CardTitle/TreeViewPanel", MaterialIcons.FileTreeOutline, "Card/TreeViewPanel", () => new TreeViewPanelPage(), _eventAggregator),
new("CardTitle/ItemListPanel", MaterialIcons.FormatListBulletedType, "Card/ItemListPanel", () => new ItemListPanelPage(), _eventAggregator),
new("CardTitle/PropertyGrid", MaterialIcons.TableColumnPlusAfter, "Card/PropertyGrid", () => new PropertyGridPage(), _eventAggregator),
new("CardTitle/DownloadPanel", MaterialIcons.DownloadOutline, "Card/DownloadPanel", () => new DownloadPanelPage(), _eventAggregator),
new("CardTitle/CrashReportDialog", MaterialIcons.BugOutline, "Card/CrashReportDialog", () => new CrashReportDialogPage(), _eventAggregator),
];
}

public AvaloniaList<ControlPageCard> CreateToolkitControlPageCards()
{
return
[
new("CardTitle/MessageBox", MaterialIcons.MessageOutline, "Card/MessageBox", new MessageBoxPage(), _eventAggregator),
new("CardTitle/NoticeDialog", MaterialIcons.InformationOutline, "Card/NoticeDialog", new NoticeDialogPage(), _eventAggregator),
new("CardTitle/StepDialog", MaterialIcons.OrderNumericAscending, "Card/StepDialog", new StepDialogPage(), _eventAggregator),
new("CardTitle/Docking", MaterialIcons.ViewDashboardOutline, "Card/Docking", new DockingPage(), _eventAggregator),
new("CardTitle/MessageBox", MaterialIcons.MessageOutline, "Card/MessageBox", () => new MessageBoxPage(), _eventAggregator),
new("CardTitle/NoticeDialog", MaterialIcons.InformationOutline, "Card/NoticeDialog", () => new NoticeDialogPage(), _eventAggregator),
new("CardTitle/StepDialog", MaterialIcons.OrderNumericAscending, "Card/StepDialog", () => new StepDialogPage(), _eventAggregator),
new("CardTitle/Docking", MaterialIcons.ViewDashboardOutline, "Card/Docking", () => new DockingPage(), _eventAggregator),
];
}
}
6 changes: 3 additions & 3 deletions samples/PleasantUI.Example/Models/ControlPageCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ControlPageCard : INotifyPropertyChanged
public string TitleKey { get; }
public string DescriptionKey { get; }
public Geometry Icon { get; set; }
public IPage Page { get; set; }
public Func<IPage> Page { get; set; }

public string Title
{
Expand All @@ -43,7 +43,7 @@ private set
}
}

public ControlPageCard(string titleKey, Geometry icon, string descriptionKey, IPage page, IEventAggregator eventAggregator)
public ControlPageCard(string titleKey, Geometry icon, string descriptionKey, Func<IPage> page, IEventAggregator eventAggregator)
{
_eventAggregator = eventAggregator;
TitleKey = titleKey;
Expand Down Expand Up @@ -79,5 +79,5 @@ private static string Resolve(string key) =>
Localizer.Instance.TryGetString(key, out string value) ? value : key;

public void OpenPage() =>
_eventAggregator.PublishAsync(new ChangePageMessage(Page));
_eventAggregator.PublishAsync(new ChangePageMessage(Page.Invoke()));
}
3 changes: 3 additions & 0 deletions samples/PleasantUI.Example/PleasantUI.Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<ItemGroup>
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="HotAvalonia" Version="3.*" PrivateAssets="All" Publish="True" />
<PackageReference Include="MonoMod.RuntimeDetour" Version="*" PrivateAssets="All" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="12.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading