- add solution

master
Simon G 5 years ago
parent 303521a585
commit ff685bb5d8
  1. 13
      .idea/.idea.Mystify.dir/.idea/.gitignore
  2. 4
      .idea/.idea.Mystify.dir/.idea/encodings.xml
  3. 8
      .idea/.idea.Mystify.dir/.idea/indexLayout.xml
  4. 6
      .idea/.idea.Mystify.dir/.idea/vcs.xml
  5. 4
      .idea/.idea.Mystify/.idea/encodings.xml
  6. 117
      .idea/.idea.Mystify/.idea/workspace.xml
  7. 16
      Mystify.sln
  8. 8
      Mystify/.gitignore
  9. 12
      Mystify/App.axaml
  10. 26
      Mystify/App.axaml.cs
  11. 20
      Mystify/Mystify.csproj
  12. 21
      Mystify/Program.cs
  13. 25
      Mystify/ViewLocator.cs
  14. 11
      Mystify/ViewModels/MainWindowViewModel.cs
  15. 22
      Mystify/ViewModels/ViewModelBase.cs
  16. 17
      Mystify/Views/MainWindow.axaml
  17. 19
      Mystify/Views/MainWindow.axaml.cs
  18. BIN
      MystifyTempIcon.ico

@ -0,0 +1,13 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/.idea.Mystify.iml
/modules.xml
/contentModel.xml
/projectSettingsUpdater.xml
# Datasource local storage ignored files
/../../../../../../../:\Workspace\Testprojekte\Mystify\.idea\.idea.Mystify.dir\.idea/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoGeneratedRunConfigurationManager">
<projectFile>Mystify/Mystify.csproj</projectFile>
</component>
<component name="ChangeListManager">
<list default="true" id="0221b891-b150-4bbf-813e-d901900db1ad" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/.idea.Mystify.dir/.idea/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/.idea.Mystify.dir/.idea/encodings.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/.idea.Mystify.dir/.idea/indexLayout.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/.idea.Mystify.dir/.idea/vcs.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/.idea.Mystify/.idea/encodings.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/.idea.Mystify/.idea/workspace.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Mystify.sln" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Mystify/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Mystify/App.axaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Mystify/App.axaml.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Mystify/Mystify.csproj" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Mystify/Program.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Mystify/ViewLocator.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Mystify/ViewModels/MainWindowViewModel.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Mystify/ViewModels/ViewModelBase.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Mystify/Views/MainWindow.axaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Mystify/Views/MainWindow.axaml.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/MystifyTempIcon.ico" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GitToolBoxStore">
<option name="projectConfigVersion" value="2" />
</component>
<component name="HighlightingSettingsPerFile">
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/783DE5A1-32E6-4CE1-9590-C76447498BD2/1/FluentTheme.cs" root0="SKIP_HIGHLIGHTING" />
</component>
<component name="IdeDocumentHistory">
<changedPaths>
<option value="$PROJECT_DIR$/Mystify/ViewLocator.cs" />
<option value="$PROJECT_DIR$/Mystify/Program.cs" />
<option value="$PROJECT_DIR$/Mystify/App.axaml.cs" />
<option value="$PROJECT_DIR$/Mystify/Views/MainWindow.axaml.cs" />
<option value="$PROJECT_DIR$/Mystify/ViewModels/ViewModelBase.cs" />
</changedPaths>
</component>
<component name="ProjectId" id="1qn67JHYPvsYJveNIpD2b90OIpP" />
<component name="ProjectViewState">
<option name="autoscrollFromSource" value="true" />
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
<property name="node.js.selected.package.tslint" value="(autodetect)" />
<property name="vue.rearranger.settings.migration" value="true" />
</component>
<component name="RunManager">
<configuration name="Mystify" type="DotNetProject" factoryName=".NET Project">
<option name="EXE_PATH" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="PROJECT_PATH" value="$PROJECT_DIR$/Mystify/Mystify.csproj" />
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
<option name="PROJECT_KIND" value="DotNetCore" />
<option name="PROJECT_TFM" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="0221b891-b150-4bbf-813e-d901900db1ad" name="Default Changelist" comment="" />
<created>1617702838043</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1617702838043</updated>
<workItem from="1617702840894" duration="1854000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="UnityProjectConfiguration" hasMinimizedUI="null" />
<component name="UnityUnitTestConfiguration" currentTestLauncher="NUnit" />
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
</component>
</project>

@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mystify", "Mystify\Mystify.csproj", "{87373A7B-B012-4E47-A875-0F189DE731E7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{87373A7B-B012-4E47-A875-0F189DE731E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{87373A7B-B012-4E47-A875-0F189DE731E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{87373A7B-B012-4E47-A875-0F189DE731E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87373A7B-B012-4E47-A875-0F189DE731E7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

@ -0,0 +1,8 @@
.idea/
.vscode/
.vs/
bin/
obj/
*.user

@ -0,0 +1,12 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Mystify"
x:Class="Mystify.App">
<Application.DataTemplates>
<local:ViewLocator/>
</Application.DataTemplates>
<Application.Styles>
<FluentTheme Mode="Light"/>
</Application.Styles>
</Application>

@ -0,0 +1,26 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Mystify.ViewModels;
using Mystify.Views;
namespace Mystify
{
public class App : Application
{
public override void Initialize() => AvaloniaXamlLoader.Load(this);
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow
{
DataContext = new MainWindowViewModel(),
};
}
base.OnFrameworkInitializationCompleted();
}
}
}

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="Models\" />
<AvaloniaResource Include="Assets\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.0" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.0" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.0" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.0" />
</ItemGroup>
<ItemGroup>
<UpToDateCheckInput Remove="Assets\avalonia-logo.ico" />
</ItemGroup>
</Project>

@ -0,0 +1,21 @@
using Avalonia;
using Avalonia.ReactiveUI;
namespace Mystify
{
class Program
{
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
public static void Main(string[] args) => BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.LogToTrace()
.UseReactiveUI();
}
}

@ -0,0 +1,25 @@
using System;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Mystify.ViewModels;
namespace Mystify
{
public class ViewLocator : IDataTemplate
{
public bool SupportsRecycling => false;
public IControl Build(object data)
{
string name = data.GetType().FullName!.Replace("ViewModel", "View");
Type? type = Type.GetType(name);
if (type != null)
return (Control) Activator.CreateInstance(type)!;
return new TextBlock { Text = "Not Found: " + name };
}
public bool Match(object data) => data is ViewModelBase;
}
}

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Mystify.ViewModels
{
public class MainWindowViewModel : ViewModelBase
{
public string Greeting => "Welcome to Avalonia!";
}
}

@ -0,0 +1,22 @@
using System;
using System.Linq.Expressions;
using System.Reflection;
using Avalonia.Controls;
using ReactiveUI;
namespace Mystify.ViewModels
{
public class ViewModelBase : ReactiveObject
{
protected bool IsInDesignMode => Design.IsDesignMode;
protected void RaisePropertyChanged(string propertyName) => ((IReactiveObject) this).RaisePropertyChanged(propertyName);
protected void RaisePropertyChanged<T>(Expression<Func<T>> propertyExpression)
{
if (propertyExpression.Body is not MemberExpression body)
throw new ArgumentException("Invalid argument.", nameof(propertyExpression));
PropertyInfo propertyInfo = body.Member as PropertyInfo ?? throw new ArgumentException("Argument is not a property.", nameof(propertyExpression));
((IReactiveObject) this).RaisePropertyChanged(propertyInfo.Name);
}
}
}

@ -0,0 +1,17 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Mystify.ViewModels"
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="Mystify.Views.MainWindow"
Icon="/Assets/avalonia-logo.ico"
Title="Mystify">
<Design.DataContext>
<vm:MainWindowViewModel/>
</Design.DataContext>
<TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Window>

@ -0,0 +1,19 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Mystify.Views
{
public class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
#if DEBUG
this.AttachDevTools();
#endif
}
private void InitializeComponent() => AvaloniaXamlLoader.Load(this);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Loading…
Cancel
Save