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
File renamed without changes.
8 changes: 4 additions & 4 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore
working-directory: src/Lemon.ModuleNavigation.Sample.Desktop
working-directory: samples/Lemon.ModuleNavigation.Sample.Desktop
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: src/Lemon.ModuleNavigation.Sample.Desktop
working-directory: samples/Lemon.ModuleNavigation.Sample.Desktop
build-wpf:
runs-on: windows-2022
steps:
Expand All @@ -40,7 +40,7 @@ jobs:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore
working-directory: src/Lemon.ModuleNavigation.WpfSample
working-directory: samples/Lemon.ModuleNavigation.WpfSample
- name: Build WPF Sample
run: dotnet build --configuration Release --no-restore
working-directory: src/Lemon.ModuleNavigation.WpfSample
working-directory: samples/Lemon.ModuleNavigation.WpfSample
File renamed without changes.
22 changes: 14 additions & 8 deletions src/Lemon.ModuleNavigation.sln → Lemon.ModuleNavigation.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,28 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35312.102
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation", "Lemon.ModuleNavigation\Lemon.ModuleNavigation.csproj", "{9E271C3B-0D09-4318-BF49-4BE2952759D8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation", "src\Lemon.ModuleNavigation\Lemon.ModuleNavigation.csproj", "{9E271C3B-0D09-4318-BF49-4BE2952759D8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6E1EE4BE-93AB-4A7D-B080-E054855DDEA6}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation.Avaloniaui", "Lemon.ModuleNavigation.Avaloniaui\Lemon.ModuleNavigation.Avaloniaui.csproj", "{3EDBF55F-6D3E-4BD0-A726-4BA84461C687}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation.Avaloniaui", "src\Lemon.ModuleNavigation.Avaloniaui\Lemon.ModuleNavigation.Avaloniaui.csproj", "{3EDBF55F-6D3E-4BD0-A726-4BA84461C687}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation.Sample", "Lemon.ModuleNavigation.Sample\Lemon.ModuleNavigation.Sample.csproj", "{0CCB72E9-102B-41E2-80A4-67D580041508}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation.Sample", "samples\Lemon.ModuleNavigation.Sample\Lemon.ModuleNavigation.Sample.csproj", "{0CCB72E9-102B-41E2-80A4-67D580041508}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation.Sample.DesktopHosting", "Lemon.ModuleNavigation.Sample.DesktopHosting\Lemon.ModuleNavigation.Sample.DesktopHosting.csproj", "{48509E81-7077-402B-A208-2134A7476857}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation.Sample.DesktopHosting", "samples\Lemon.ModuleNavigation.Sample.DesktopHosting\Lemon.ModuleNavigation.Sample.DesktopHosting.csproj", "{48509E81-7077-402B-A208-2134A7476857}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation.Sample.Desktop", "Lemon.ModuleNavigation.Sample.Desktop\Lemon.ModuleNavigation.Sample.Desktop.csproj", "{AF18E2B0-7ED3-4BDA-81BA-6A23B3C89F39}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation.Sample.Desktop", "samples\Lemon.ModuleNavigation.Sample.Desktop\Lemon.ModuleNavigation.Sample.Desktop.csproj", "{AF18E2B0-7ED3-4BDA-81BA-6A23B3C89F39}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lemon.ModuleNavigation.Sample.Browser", "Lemon.ModuleNavigation.Sample.Browser\Lemon.ModuleNavigation.Sample.Browser.csproj", "{FDD2C508-3201-4659-8962-886C2CBF41BD}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lemon.ModuleNavigation.Sample.Browser", "samples\Lemon.ModuleNavigation.Sample.Browser\Lemon.ModuleNavigation.Sample.Browser.csproj", "{FDD2C508-3201-4659-8962-886C2CBF41BD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lemon.ModuleNavigation.Wpf", "Lemon.ModuleNavigation.Wpf\Lemon.ModuleNavigation.Wpf.csproj", "{2AE59E5E-900D-5CCB-0C30-F8DFAD324C9E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lemon.ModuleNavigation.Wpf", "src\Lemon.ModuleNavigation.Wpf\Lemon.ModuleNavigation.Wpf.csproj", "{2AE59E5E-900D-5CCB-0C30-F8DFAD324C9E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lemon.ModuleNavigation.WpfSample", "Lemon.ModuleNavigation.WpfSample\Lemon.ModuleNavigation.WpfSample.csproj", "{8EC545BD-E076-A2DF-A7A4-2F11221AF297}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lemon.ModuleNavigation.WpfSample", "samples\Lemon.ModuleNavigation.WpfSample\Lemon.ModuleNavigation.WpfSample.csproj", "{8EC545BD-E076-A2DF-A7A4-2F11221AF297}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lemon.ModuleNavigation.SampleViewModel", "samples\Lemon.ModuleNavigation.SampleViewModel\Lemon.ModuleNavigation.SampleViewModel.csproj", "{99600F69-5901-4CEA-8C54-BFDC0751E207}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -62,6 +64,10 @@ Global
{8EC545BD-E076-A2DF-A7A4-2F11221AF297}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8EC545BD-E076-A2DF-A7A4-2F11221AF297}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8EC545BD-E076-A2DF-A7A4-2F11221AF297}.Release|Any CPU.Build.0 = Release|Any CPU
{99600F69-5901-4CEA-8C54-BFDC0751E207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{99600F69-5901-4CEA-8C54-BFDC0751E207}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99600F69-5901-4CEA-8C54-BFDC0751E207}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99600F69-5901-4CEA-8C54-BFDC0751E207}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Lemon.ModuleNavigation.SampleViewModel\Lemon.ModuleNavigation.SampleViewModel.csproj" />
<ProjectReference Include="..\Lemon.ModuleNavigation.Sample\Lemon.ModuleNavigation.Sample.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Lemon.ModuleNavigation.Sample.ModuleCs;
using Lemon.ModuleNavigation.Sample.ViewModels;
using Lemon.ModuleNavigation.Sample.Views;
using Lemon.ModuleNavigation.SampleViewModel;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Lemon.ModuleNavigation.Sample.ModuleCs;
using Lemon.ModuleNavigation.Sample.ViewModels;
using Lemon.ModuleNavigation.Sample.Views;
using Lemon.ModuleNavigation.SampleViewModel;
using Microsoft.Extensions.DependencyInjection;
using System;

Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Lemon.ModuleNavigation.Avaloniaui\Lemon.ModuleNavigation.Avaloniaui.csproj" />
<ProjectReference Include="..\Lemon.ModuleNavigation\Lemon.ModuleNavigation.csproj" />
<ProjectReference Include="..\..\src\Lemon.ModuleNavigation.Avaloniaui\Lemon.ModuleNavigation.Avaloniaui.csproj" />
<ProjectReference Include="..\..\src\Lemon.ModuleNavigation\Lemon.ModuleNavigation.csproj" />
<ProjectReference Include="..\Lemon.ModuleNavigation.SampleViewModel\Lemon.ModuleNavigation.SampleViewModel.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Lemon.ModuleNavigation.Abstractions;
using Lemon.ModuleNavigation.Sample.ViewModels;
using Lemon.ModuleNavigation.SampleViewModel;
using ReactiveUI;
using System.Reactive;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Lemon.ModuleNavigation.Abstractions;
using Lemon.ModuleNavigation.Sample.ViewModels;
using Lemon.ModuleNavigation.SampleViewModel;
using ReactiveUI;
using System.Reactive;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Lemon.ModuleNavigation.Abstractions;
using Lemon.ModuleNavigation.Sample.ViewModels;
using Lemon.ModuleNavigation.SampleViewModel;
using ReactiveUI;
using System;
using System.Reactive;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Lemon.ModuleNavigation.Abstractions;
using Lemon.ModuleNavigation.Sample.ViewModels;
using Lemon.ModuleNavigation.SampleViewModel;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Lemon.ModuleNavigation.Abstractions;
using Lemon.ModuleNavigation.Sample.ViewModels;
using Lemon.ModuleNavigation.SampleViewModel;
using System;

namespace Lemon.ModuleNavigation.Sample.ModuleCs.ViewModels;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public MainViewModel(IEnumerable<IModule> modules,
{
viewName = content.Replace(".RequestNew",string.Empty);
requestNew = true;

}
_navigationService.RequestViewNavigation("ContentRegion",
viewName,
Expand Down Expand Up @@ -93,11 +92,7 @@ await _dialogService.ShowDialog(content,
};
var result = _dialogService.WaitShowDialog(content,
nameof(CustomDialogWindow),
param,
result =>
{
_logger.LogDebug($"Call back:{result}");
});
param);
_logger.LogDebug($"ShowDialog over:{result}");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,77 +51,6 @@
</Style>
</UserControl.Styles>
<TabControl>
<TabItem Header="Module">
<Grid ColumnDefinitions="auto,*,*,*,*" ShowGridLines="True">
<StackPanel
Margin="0,0,2,0"
Orientation="Vertical"
Spacing="5">
<Label Content="Modules" Target="{Binding ElementName=ModuleLists}" />
<ListBox
Grid.Column="0"
ItemsSource="{Binding Modules}"
Name="ModuleLists"
SelectedItem="{Binding SelectedModule, Mode=TwoWay}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Alias}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
<StackPanel Classes="ForContainerShow" Grid.Column="1">
<Label Content="ContentControl" />
<Border Classes="HSeparator" />
<ContentControl lm:NavigationExtension.ModuleContainerName="NContentControl" />
</StackPanel>
<StackPanel Classes="ForContainerShow" Grid.Column="2">
<Label Content="TabControl" />
<Border Classes="HSeparator" />
<TabControl lm:NavigationExtension.ModuleContainerName="NTabControl">
<TabControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Spacing="2">
<TextBlock Text="{Binding Alias}" />
<Button
Content="X"
FontSize="11"
Height="20"
HorizontalContentAlignment="Center"
Padding="-1,0,0,0"
VerticalContentAlignment="Center"
Width="20"
lm:NavigationExtension.CanUnload="{Binding CanUnload}" />
</StackPanel>
</DataTemplate>
</TabControl.ItemTemplate>
</TabControl>
</StackPanel>
<StackPanel Classes="ForContainerShow" Grid.Column="3">
<Label Content="ListBox" />
<Border Classes="HSeparator" />
<ListBox
Background="Transparent"
BorderBrush="LemonChiffon"
BorderThickness="1"
Margin="2"
MaxHeight="600"
lm:NavigationExtension.ModuleContainerName="NListBox">
<!-- https://github.com/AvaloniaUI/Avalonia/issues/17349 -->
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</StackPanel>
<StackPanel Classes="ForContainerShow" Grid.Column="4">
<Label Content="TransitioningContentControl" />
<Border Classes="HSeparator" />
<TransitioningContentControl lm:NavigationExtension.ModuleContainerName="NTransitioningContentControl" />
</StackPanel>
</Grid>
</TabItem>
<TabItem Header="View">
<Grid ColumnDefinitions="auto,*,*,*,*" ShowGridLines="True">
<StackPanel Orientation="Vertical" Spacing="5">
Expand Down Expand Up @@ -209,21 +138,76 @@
Tag="ViewBeta" />
</StackPanel>
</TabItem>
<TabItem Header="Practice">
<DockPanel>
<!--<ContentControl DockPanel.Dock="Right" lm:NavigationExtension.RegionName="RightRegion">-->
<ItemsControl DockPanel.Dock="Right">
<ContentControl Content="11" />
<ContentControl Content="11" />
<ContentControl Content="11" />
<ContentControl Content="11" />
</ItemsControl>
<!--</ContentControl>-->
<ContentControl DockPanel.Dock="Left" lm:NavigationExtension.RegionName="LeftRegion" />
<ContentControl DockPanel.Dock="Top" lm:NavigationExtension.RegionName="TopRegion" />
<ContentControl DockPanel.Dock="Bottom" lm:NavigationExtension.RegionName="BottomRegion" />
<TransitioningContentControl lm:NavigationExtension.RegionName="MainRegion" />
</DockPanel>
<TabItem Header="Module">
<Grid ColumnDefinitions="auto,*,*,*,*" ShowGridLines="True">
<StackPanel
Margin="0,0,2,0"
Orientation="Vertical"
Spacing="5">
<Label Content="Modules" Target="{Binding ElementName=ModuleLists}" />
<ListBox
Grid.Column="0"
ItemsSource="{Binding Modules}"
Name="ModuleLists"
SelectedItem="{Binding SelectedModule, Mode=TwoWay}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Alias}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
<StackPanel Classes="ForContainerShow" Grid.Column="1">
<Label Content="ContentControl" />
<Border Classes="HSeparator" />
<ContentControl lm:NavigationExtension.ModuleContainerName="NContentControl" />
</StackPanel>
<StackPanel Classes="ForContainerShow" Grid.Column="2">
<Label Content="TabControl" />
<Border Classes="HSeparator" />
<TabControl lm:NavigationExtension.ModuleContainerName="NTabControl">
<TabControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Spacing="2">
<TextBlock Text="{Binding Alias}" />
<Button
Content="X"
FontSize="11"
Height="20"
HorizontalContentAlignment="Center"
Padding="-1,0,0,0"
VerticalContentAlignment="Center"
Width="20"
lm:NavigationExtension.CanUnload="{Binding CanUnload}" />
</StackPanel>
</DataTemplate>
</TabControl.ItemTemplate>
</TabControl>
</StackPanel>
<StackPanel Classes="ForContainerShow" Grid.Column="3">
<Label Content="ListBox" />
<Border Classes="HSeparator" />
<ListBox
Background="Transparent"
BorderBrush="LemonChiffon"
BorderThickness="1"
Margin="2"
MaxHeight="600"
lm:NavigationExtension.ModuleContainerName="NListBox">
<!-- https://github.com/AvaloniaUI/Avalonia/issues/17349 -->
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</StackPanel>
<StackPanel Classes="ForContainerShow" Grid.Column="4">
<Label Content="TransitioningContentControl" />
<Border Classes="HSeparator" />
<TransitioningContentControl lm:NavigationExtension.ModuleContainerName="NTransitioningContentControl" />
</StackPanel>
</Grid>
</TabItem>
</TabControl>
</UserControl>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Diagnostics;
using System.Reactive;

namespace Lemon.ModuleNavigation.WpfSample;
namespace Lemon.ModuleNavigation.SampleViewModel;

public class BaseNavigationViewModel : ReactiveObject, INavigationAware
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ReactiveUI" Version="18.3.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Lemon.ModuleNavigation\Lemon.ModuleNavigation.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Diagnostics;
using System.Reactive;

namespace Lemon.ModuleNavigation.WpfSample;
namespace Lemon.ModuleNavigation.SampleViewModel;

public class MainWindowViewModel : ReactiveObject, IServiceAware
{
Expand Down Expand Up @@ -73,11 +73,7 @@ await _dialogService.ShowDialog(content,
};
var result = _dialogService.WaitShowDialog(content,
null,
param,
result =>
{
Debug.WriteLine($"Call back:{result}");
});
param);
Debug.WriteLine($"ShowDialog over:{result}");
});
UnloadViewCommand = ReactiveCommand.Create<NavigationContext>((context) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using ReactiveUI;
using System.Reactive;

namespace Lemon.ModuleNavigation.WpfSample.ViewModels;
namespace Lemon.ModuleNavigation.SampleViewModel;

public class ViewAlphaViewModel : BaseNavigationViewModel, IDialogAware
{
Expand Down
Loading