├── examples └── ViewManagerDemo │ ├── Resources │ └── Images │ │ ├── Logo.ico │ │ └── Background.jpg │ ├── App.xaml.cs │ ├── AssemblyInfo.cs │ ├── CommandListWindow.xaml.cs │ ├── ViewManagerDemo.csproj │ ├── Flyouts │ ├── FlyoutLocationDemo.xaml.cs │ └── FlyoutLocationDemo.xaml │ ├── MainWindow.xaml │ ├── Components │ ├── PopupViewHeader.xaml.cs │ └── PopupViewHeader.xaml │ ├── Dialogs │ ├── FullScreenDialog.xaml.cs │ ├── NormalDialog.xaml.cs │ ├── DialogWithEvent.xaml.cs │ ├── DialogWithEvent.xaml │ ├── FullScreenDialog.xaml │ └── NormalDialog.xaml │ ├── Views │ ├── ReadMe.xaml.cs │ ├── DialogsDemoView.xaml.cs │ ├── FlyoutsDemoView.xaml.cs │ ├── FlyoutsDemoView.xaml │ ├── ReadMe.xaml │ └── DialogsDemoView.xaml │ ├── StandardWindow.xaml.cs │ ├── StandardWindow.xaml │ ├── CommandListWindow.xaml │ ├── MainWindow.xaml.cs │ └── App.xaml ├── src └── Unicorn.ViewManager │ ├── Resource │ └── Images │ │ ├── box_error.png │ │ ├── box_info.png │ │ ├── box_warning.png │ │ └── box_question.png │ ├── AssemblyInfo.cs │ ├── ModalResult.cs │ ├── Themes │ ├── PopupStack.xaml │ ├── PopupStackControl.xaml │ ├── RichViewItem.xaml │ ├── DefaultPopupItemContainer.xaml │ ├── DialogContainer.xaml │ ├── PopupItemContainer.xaml │ ├── RichViewWindow.xaml │ ├── Generic.xaml │ ├── Dialog.xaml │ ├── Flyout.xaml │ ├── RichViewControl.xaml │ ├── FlyoutContainer.xaml │ ├── ProcessDialogBox.xaml │ └── MessageDialogBox.xaml │ ├── RichViewItem.cs │ ├── IPopupItemContainer.cs │ ├── DefaultPopupItemContainer.cs │ ├── ViewStackChangedEventArgs.cs │ ├── Preferences │ └── ViewPreferences.cs │ ├── Dialog.cs │ ├── Flyout.cs │ ├── Unicorn.ViewManager.csproj │ ├── PopupStack.cs │ ├── PopupItemContainer.cs │ ├── ViewCommands.cs │ ├── RichViewWindow.cs │ ├── ViewManager.cs │ ├── RichViewControl.cs │ ├── DialogContainer.cs │ ├── FlyoutContainer.cs │ ├── PopupItem.cs │ └── System │ └── Windows │ ├── ProcessDialogBox.cs │ └── MessageDialogBox.cs ├── .github └── workflows │ └── PublishNuget.yml ├── Unicorn.sln ├── .gitattributes ├── README.md └── .gitignore /examples/ViewManagerDemo/Resources/Images/Logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrZhangYuan/Unicorn.ViewManager/HEAD/examples/ViewManagerDemo/Resources/Images/Logo.ico -------------------------------------------------------------------------------- /src/Unicorn.ViewManager/Resource/Images/box_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrZhangYuan/Unicorn.ViewManager/HEAD/src/Unicorn.ViewManager/Resource/Images/box_error.png -------------------------------------------------------------------------------- /src/Unicorn.ViewManager/Resource/Images/box_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrZhangYuan/Unicorn.ViewManager/HEAD/src/Unicorn.ViewManager/Resource/Images/box_info.png -------------------------------------------------------------------------------- /src/Unicorn.ViewManager/Resource/Images/box_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrZhangYuan/Unicorn.ViewManager/HEAD/src/Unicorn.ViewManager/Resource/Images/box_warning.png -------------------------------------------------------------------------------- /examples/ViewManagerDemo/Resources/Images/Background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrZhangYuan/Unicorn.ViewManager/HEAD/examples/ViewManagerDemo/Resources/Images/Background.jpg -------------------------------------------------------------------------------- /src/Unicorn.ViewManager/Resource/Images/box_question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrZhangYuan/Unicorn.ViewManager/HEAD/src/Unicorn.ViewManager/Resource/Images/box_question.png -------------------------------------------------------------------------------- /src/Unicorn.ViewManager/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | [assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] 2 | -------------------------------------------------------------------------------- /src/Unicorn.ViewManager/ModalResult.cs: -------------------------------------------------------------------------------- 1 | namespace Unicorn.ViewManager 2 | { 3 | public class ModalResult 4 | { 5 | public object Result 6 | { 7 | get; set; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/ViewManagerDemo/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace ViewManagerDemo 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Unicorn.ViewManager/Themes/PopupStack.xaml: -------------------------------------------------------------------------------- 1 | 5 | 14 | -------------------------------------------------------------------------------- /examples/ViewManagerDemo/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo( 4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 5 | //(used if a resource is not found in the page, 6 | // or application resource dictionaries) 7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 8 | //(used if a resource is not found in the page, 9 | // app, or any theme specific resource dictionaries) 10 | )] 11 | -------------------------------------------------------------------------------- /examples/ViewManagerDemo/CommandListWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows; 5 | using System.Windows.Controls; 6 | using System.Windows.Data; 7 | using System.Windows.Documents; 8 | using System.Windows.Input; 9 | using System.Windows.Media; 10 | using System.Windows.Media.Imaging; 11 | using System.Windows.Shapes; 12 | 13 | namespace ViewManagerDemo 14 | { 15 | /// 16 | /// CommandListWindow.xaml 的交互逻辑 17 | /// 18 | public partial class CommandListWindow : Window 19 | { 20 | public CommandListWindow() 21 | { 22 | InitializeComponent(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Unicorn.ViewManager/RichViewItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows; 5 | using System.Windows.Controls; 6 | using System.Windows.Data; 7 | using System.Windows.Documents; 8 | using System.Windows.Input; 9 | using System.Windows.Media; 10 | using System.Windows.Media.Imaging; 11 | using System.Windows.Navigation; 12 | using System.Windows.Shapes; 13 | 14 | namespace Unicorn.ViewManager 15 | { 16 | internal class RichViewItem : ContentControl 17 | { 18 | static RichViewItem() 19 | { 20 | DefaultStyleKeyProperty.OverrideMetadata(typeof(RichViewItem), new FrameworkPropertyMetadata(typeof(RichViewItem))); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/ViewManagerDemo/ViewManagerDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | netcoreapp3.1 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Unicorn.ViewManager/IPopupItemContainer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | 4 | namespace Unicorn.ViewManager 5 | { 6 | public interface IPopupItemContainer 7 | { 8 | event ViewStackChangedEventHandler ViewStackChanged; 9 | 10 | IPopupItemContainer Parent 11 | { 12 | get; 13 | } 14 | 15 | PopupItem TopItem 16 | { 17 | get; 18 | } 19 | 20 | IEnumerable Children 21 | { 22 | get; 23 | } 24 | 25 | ModalResult ShowModal(PopupItem item); 26 | 27 | void Show(PopupItem item); 28 | 29 | void Close(PopupItem item); 30 | 31 | bool Close(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /examples/ViewManagerDemo/Flyouts/FlyoutLocationDemo.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows; 5 | using System.Windows.Controls; 6 | using System.Windows.Data; 7 | using System.Windows.Documents; 8 | using System.Windows.Input; 9 | using System.Windows.Media; 10 | using System.Windows.Media.Imaging; 11 | using System.Windows.Navigation; 12 | using System.Windows.Shapes; 13 | 14 | namespace ViewManagerDemo.Flyouts 15 | { 16 | /// 17 | /// FlyoutLocationDemo.xaml 的交互逻辑 18 | /// 19 | public partial class FlyoutLocationDemo 20 | { 21 | public FlyoutLocationDemo() 22 | { 23 | InitializeComponent(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Unicorn.ViewManager/Themes/PopupStackControl.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 17 | -------------------------------------------------------------------------------- /.github/workflows/PublishNuget.yml: -------------------------------------------------------------------------------- 1 | name: Publish Nuget 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | publish: 10 | name: Publish to Nuget 11 | runs-on: windows-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v1 15 | - name: Setup .NET Core 16 | uses: actions/setup-dotnet@v1 17 | with: 18 | dotnet-version: 3.1 19 | project_dir: src/Unicorn.ViewManager # Defaults to repository root 20 | 21 | - name: Build with dotnet 22 | run: dotnet pack -c Release src/Unicorn.ViewManager/Unicorn.ViewManager.csproj -o . 23 | 24 | - name: Push Package to Nuget 25 | run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate 26 | -------------------------------------------------------------------------------- /src/Unicorn.ViewManager/DefaultPopupItemContainer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows; 5 | using System.Windows.Controls; 6 | using System.Windows.Data; 7 | using System.Windows.Documents; 8 | using System.Windows.Input; 9 | using System.Windows.Media; 10 | using System.Windows.Media.Imaging; 11 | using System.Windows.Navigation; 12 | using System.Windows.Shapes; 13 | 14 | namespace Unicorn.ViewManager 15 | { 16 | public class DefaultPopupItemContainer : PopupItemContainer 17 | { 18 | static DefaultPopupItemContainer() 19 | { 20 | DefaultStyleKeyProperty.OverrideMetadata(typeof(DefaultPopupItemContainer), new FrameworkPropertyMetadata(typeof(DefaultPopupItemContainer))); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/ViewManagerDemo/Flyouts/FlyoutLocationDemo.xaml: -------------------------------------------------------------------------------- 1 | 14 |