Skip to content

Commit

Permalink
Merge pull request #50 from TorisanKitsune/CommandModule
Browse files Browse the repository at this point in the history
Command module
  • Loading branch information
mkromis authored Nov 21, 2019
2 parents 198d719 + 2afe0bb commit cff057d
Show file tree
Hide file tree
Showing 144 changed files with 254 additions and 43 deletions.
6 changes: 6 additions & 0 deletions Demos/SimpleDemo/SimpleDemo.Core/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,11 @@ public MainViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigati
}

public ICommand TipCalcCommand => new MvxCommand(() => NavigationService.Navigate<TipViewModel>());

public ICommand SettingsCommand => new MvxCommand(() =>
{
IMesSettingsManager settingsManager = Mvx.IoCProvider.Resolve<IMesSettingsManager>();
NavigationService.Navigate(settingsManager);
});
}
}
12 changes: 9 additions & 3 deletions Demos/SimpleDemo/SimpleDemo.WPF/Views/MainView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@
d:DesignHeight="450" d:DesignWidth="800">
<DockPanel>
<StackPanel DockPanel.Dock="Top" Orientation="Vertical">
<Button Content="TipCalc" Command="{Binding TipCalcCommand}" />
<!--<ContentControl cal:View.Model="{Binding MainMenu}" />-->
<!--<ContentControl cal:View.Model="{Binding ToolBars}" />-->
<Menu>
<MenuItem Header="Samples">
<MenuItem Header="TipCalc" Command="{Binding TipCalcCommand}" />
<MenuItem Header="Settings" Command="{Binding SettingsCommand}" />
</MenuItem>
</Menu>
<ToolBar>
<Button Content="TipCalc" Command="{Binding TipCalcCommand}" />
</ToolBar>
</StackPanel>

<!--<ContentControl DockPanel.Dock="Bottom" cal:View.Model="{Binding StatusBar}" IsTabStop="False" />-->
Expand Down
105 changes: 105 additions & 0 deletions Modules/MinoriEditorShell.Command/MinoriEditorShell.Command.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<Description>
MinoriEditorStudio is an application shell similar in concept to the Visual Studio Shell.
It uses AvalonDock and has an MVVM architecture based on MvvmCross.
</Description>
<Copyright>Copyright 2019</Copyright>
<PackageProjectUrl>https://github.com/TorisanKitsune/MinoriEditorShell</PackageProjectUrl>
<RepositoryUrl>https://github.com/TorisanKitsune/MinoriEditorShell</RepositoryUrl>
<PackageIconUrl></PackageIconUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>.net40 WPF MvvmCross AvalonDock Visual Studio IDE Shell</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Mark Kromis</Authors>
<Company>Mark Kromis</Company>
<PackageLicenseExpression></PackageLicenseExpression>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Platforms\**\*.cs" />
<None Include="Platforms\**\*" />
<None Remove="Platforms\Wpf\Themes\MesThemeBase.cs" />

<PackageReference Include="MvvmCross" Version="6.4.1" />
<PackageReference Include="MvvmCross.Plugin.Messenger" Version="6.4.1" />
<PackageReference Include="GitVersionTask" Version="5.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MvvmCross.Plugin.ResxLocalization" Version="6.4.1" />
<PackageReference Include="System.ComponentModel.Composition" Version="4.6.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0" />
<PackageReference Include="System.Drawing.Common" Version="4.6.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) ">
<Compile Include="Platforms\NetStandard\**\*.cs" />

<PackageReference Include="System.ComponentModel" Version="4.3.0" />
<!--<PackageReference Include="System.ComponentModel.Composition" Version="4.6.0" />-->
<PackageReference Include="System.Drawing.Common" Version="4.6.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('net4')) ">
<Page Include="Platforms\Wpf\**\*.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Compile Include="Platforms\Wpf\**\*.cs" />

<PackageReference Include="Dirkster.AvalonDock" Version="3.6.0" />
<PackageReference Include="Dirkster.AvalonDock.Themes.VS2013" Version="3.6.0" />
<PackageReference Include="MahApps.Metro" Version="1.6.5" />
<PackageReference Include="MvvmCross.Platforms.Wpf" Version="6.4.1" />
<PackageReference Include="System.Windows.Interactivity.WPF" Version="2.0.20525" />

<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<!--<Reference Include="System.ComponentModel.Composition" />-->
<Reference Include="System.Drawing" />
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MinoriEditorShell\MinoriEditorShell.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Update="Properties\Resources.de.resx">
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.ko.resx">
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.ru.resx">
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.zh-Hans.resx">
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
</ItemGroup>
</Project>
File renamed without changes.
101 changes: 101 additions & 0 deletions Modules/MinoriEditorShell.History/MinoriEditorShell.History.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<Description>
MinoriEditorStudio is an application shell similar in concept to the Visual Studio Shell.
It uses AvalonDock and has an MVVM architecture based on MvvmCross.
</Description>
<Copyright>Copyright 2019</Copyright>
<PackageProjectUrl>https://github.com/TorisanKitsune/MinoriEditorShell</PackageProjectUrl>
<RepositoryUrl>https://github.com/TorisanKitsune/MinoriEditorShell</RepositoryUrl>
<PackageIconUrl></PackageIconUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>.net40 WPF MvvmCross AvalonDock Visual Studio IDE Shell</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Mark Kromis</Authors>
<Company>Mark Kromis</Company>
<PackageLicenseExpression></PackageLicenseExpression>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Platforms\**\*.cs" />
<None Include="Platforms\**\*" />
<None Remove="Platforms\Wpf\Themes\MesThemeBase.cs" />

<PackageReference Include="MvvmCross" Version="6.4.1" />
<PackageReference Include="MvvmCross.Plugin.Messenger" Version="6.4.1" />
<PackageReference Include="GitVersionTask" Version="5.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MvvmCross.Plugin.ResxLocalization" Version="6.4.1" />
<PackageReference Include="System.ComponentModel.Composition" Version="4.6.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0" />
<PackageReference Include="System.Drawing.Common" Version="4.6.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) ">
<Compile Include="Platforms\NetStandard\**\*.cs" />

<PackageReference Include="System.ComponentModel" Version="4.3.0" />
<!--<PackageReference Include="System.ComponentModel.Composition" Version="4.6.0" />-->
<PackageReference Include="System.Drawing.Common" Version="4.6.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('net4')) ">
<Page Include="Platforms\Wpf\**\*.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Compile Include="Platforms\Wpf\**\*.cs" />

<PackageReference Include="Dirkster.AvalonDock" Version="3.6.0" />
<PackageReference Include="Dirkster.AvalonDock.Themes.VS2013" Version="3.6.0" />
<PackageReference Include="MahApps.Metro" Version="1.6.5" />
<PackageReference Include="MvvmCross.Platforms.Wpf" Version="6.4.1" />
<PackageReference Include="System.Windows.Interactivity.WPF" Version="2.0.20525" />

<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<!--<Reference Include="System.ComponentModel.Composition" />-->
<Reference Include="System.Drawing" />
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
</ItemGroup>

<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Update="Properties\Resources.de.resx">
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.ko.resx">
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.ru.resx">
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.zh-Hans.resx">
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace MinoriEditorShell.Ribbon.Platforms.Wpf.Views
{
public class MesRibbonWindow : MesWindow, IMvxWindow, IMvxWpfView, IRibbonWindow, IDisposable
public class MesRibbonWindow : MesWindow, IMvxWindow, IMvxWpfView, IRibbonWindow
{
#region TitelBar
/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion Modules/MinoriEditorShell/Platforms/Wpf/Core/MesWpfSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ protected override IDictionary<Type, Type> InitializeLookupDictionary()
IMvxViewsContainer container = Mvx.IoCProvider.Resolve<IMvxViewsContainer>();
if (container != null)
{
container.Add<MesMainMenuSettingsViewModel, MesMainMenuSettingsView>();
#warning MesMainMenuSettingsView
//container.Add<MesMainMenuSettingsViewModel, MesMainMenuSettingsView>();
container.Add<MesSettingsViewModel, MesSettingsView>();
}

Expand Down
32 changes: 8 additions & 24 deletions Modules/MinoriEditorShell/Platforms/Wpf/Views/MesWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace MinoriEditorShell.Platforms.Wpf.Views
{
public class MesWindow : MetroWindow, IMesWindow, IMvxWindow, IMvxWpfView, IDisposable
public class MesWindow : MetroWindow, IMesWindow, IMvxWindow, IMvxWpfView
{
private IMvxViewModel _viewModel;
private IMvxBindingContext _bindingContext;
Expand Down Expand Up @@ -71,6 +71,12 @@ private void MesWindow_Initialized(Object sender, EventArgs e)

// Init mes setup
Mvx.IoCProvider.Resolve<IMesThemeManager>();

#warning fix style
//WindowCloseButtonStyle = Application.Current.Resources.MergedDictionaries
//WindowCloseButtonStyle = "{DynamicResource MetroWindowButtonStyle}"
//WindowMinButtonStyle = "{DynamicResource MetroWindowButtonStyle}"
//WindowMaxButtonStyle = "{DynamicResource MetroWindowButtonStyle}"
}
}

Expand All @@ -91,31 +97,9 @@ private void MesWindow_Loaded(Object sender, RoutedEventArgs e)
ViewModel?.ViewAppearing();
ViewModel?.ViewAppeared();
}

public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

~MesWindow()
{
Dispose(false);
}

protected virtual void Dispose(Boolean disposing)
{
if (disposing)
{
Unloaded -= MesWindow_Unloaded;
Loaded -= MesWindow_Loaded;
}
}
}

public class MesWindow<TViewModel>
: MesWindow
, IMvxWpfView<TViewModel> where TViewModel : class, IMvxViewModel
public class MesWindow<TViewModel> : MesWindow, IMvxWpfView<TViewModel> where TViewModel : class, IMvxViewModel
{
public new TViewModel ViewModel
{
Expand Down
Binary file removed Modules/MinoriEditorShell/Resources/Icons/Gemini-32.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@ namespace MinoriEditorShell.Platforms.Wpf.Results
{
public static class MesShow
{
public static MesShowCommonDialogResult CommonDialog(CommonDialog commonDialog) => new MesShowCommonDialogResult(commonDialog);
#warning fix common dialog
//public static MesShowCommonDialogResult CommonDialog(CommonDialog commonDialog) => new MesShowCommonDialogResult(commonDialog);

public static MesShowToolResult<TTool> Tool<TTool>()
where TTool : IMesTool => new MesShowToolResult<TTool>();

public static MesShowToolResult<TTool> Tool<TTool>(TTool tool)
where TTool : IMesTool => new MesShowToolResult<TTool>(tool);

public static MesOpenDocumentResult Document(IMesDocument document) => new MesOpenDocumentResult(document);
#warning IWindow
#if false
//public static MesOpenDocumentResult Document(IMesDocument document) => new MesOpenDocumentResult(document);

public static MesOpenDocumentResult Document(String path) => new MesOpenDocumentResult(path);
//public static MesOpenDocumentResult Document(String path) => new MesOpenDocumentResult(path);

public static MesOpenDocumentResult Document<T>() where T : IMesDocument => new MesOpenDocumentResult(typeof(T));
//public static MesOpenDocumentResult Document<T>() where T : IMesDocument => new MesOpenDocumentResult(typeof(T));

#warning IWindow
#if false
public static ShowWindowResult<TWindow> Window<TWindow>()
where TWindow : IWindow
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ public class MesShowCommonDialogResult /*: IResult*/
#warning ResultCompletionEventArgs
public event EventHandler</*ResultCompletionEventArgs*/ Object> Completed;

private readonly CommonDialog _commonDialog;
#warning fix commmon dialog
//private readonly CommonDialog _commonDialog;

public MesShowCommonDialogResult(CommonDialog commonDialog)
{
_commonDialog = commonDialog;
}
// public MesShowCommonDialogResult(CommonDialog commonDialog)
//{
// _commonDialog = commonDialog;
//}

#warning CoroutineExecutionContext
public void Execute(/*CoroutineExecutionContext*/Object context)
Expand Down
2 changes: 1 addition & 1 deletion Modules/MinoriEditorShell/Services/IMesDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public interface IMesDocument : IMesLayoutItem
{
String DisplayName { get; }
IMvxView View { get; set; }
IMesUndoRedoManager UndoRedoManager { get; }
//IMesUndoRedoManager UndoRedoManager { get; }
Boolean CanClose { get; }
}
}
4 changes: 2 additions & 2 deletions Modules/MinoriEditorShell/Services/MesDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public abstract class MesDocument : MesLayoutItemBase, IMesDocument
//ICommandHandler<SaveFileCommandDefinition>,
//ICommandHandler<SaveFileAsCommandDefinition>
{
private IMesUndoRedoManager _undoRedoManager;
public IMesUndoRedoManager UndoRedoManager => _undoRedoManager ?? (_undoRedoManager = new MesUndoRedoManager());
//private IMesUndoRedoManager _undoRedoManager;
//public IMesUndoRedoManager UndoRedoManager => _undoRedoManager ?? (_undoRedoManager = new MesUndoRedoManager());

/// <summary>
/// Sets weather a document can be closed by close button
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ Dual-Licensed with either
[![Apache](https://img.shields.io/badge/license-Apache-blue.svg)](https://github.com/TorisanKitsune/MinoriEditorShell/blob/master/LICENCE.txt) or
[![MS-PL](https://img.shields.io/badge/license-MsPL-blue.svg)](https://github.com/TorisanKitsune/MinoriEditorShell/blob/master/LICENCE.txt)

## Breaking Changes

The goal is to minimize the main library into a more consice library. Thus the following changes will/have been made.
* Command interface was moved to MinoriEditorShell.Command -- This is currently un-tested and no nuget yet.
* Undo - Redo interface was moved to MinoriEditorShell.History -- This is currently un-tested and no nuget yet.

## What is this

MinoriEditorShell is a IDE framework designed specifically for building multi document editor applications with MvvmCross. It builds on some excellent libraries:
Expand Down

0 comments on commit cff057d

Please sign in to comment.