Explorar el Código

initial commit

Karathan hace 6 años
padre
commit
020a13ee6c

+ 25
- 0
Editopia.sln Ver fichero

@@ -0,0 +1,25 @@
1
+
2
+Microsoft Visual Studio Solution File, Format Version 12.00
3
+# Visual Studio 15
4
+VisualStudioVersion = 15.0.27703.2042
5
+MinimumVisualStudioVersion = 10.0.40219.1
6
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Editopia", "Editopia\Editopia.csproj", "{64410260-95AF-4C4C-987B-636DE09F96FA}"
7
+EndProject
8
+Global
9
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
10
+		Debug|Any CPU = Debug|Any CPU
11
+		Release|Any CPU = Release|Any CPU
12
+	EndGlobalSection
13
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
14
+		{64410260-95AF-4C4C-987B-636DE09F96FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15
+		{64410260-95AF-4C4C-987B-636DE09F96FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
16
+		{64410260-95AF-4C4C-987B-636DE09F96FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
17
+		{64410260-95AF-4C4C-987B-636DE09F96FA}.Release|Any CPU.Build.0 = Release|Any CPU
18
+	EndGlobalSection
19
+	GlobalSection(SolutionProperties) = preSolution
20
+		HideSolutionNode = FALSE
21
+	EndGlobalSection
22
+	GlobalSection(ExtensibilityGlobals) = postSolution
23
+		SolutionGuid = {1E71EF89-9E35-40BB-9071-247DE301209B}
24
+	EndGlobalSection
25
+EndGlobal

+ 19
- 0
Editopia/App.xaml Ver fichero

@@ -0,0 +1,19 @@
1
+<Application xmlns="https://github.com/avaloniaui"
2
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3
+  <Application.Styles>
4
+
5
+    <Style Selector="TextBlock.h1">
6
+      <Setter Property="Foreground" Value="#212121"/>
7
+      <Setter Property="FontSize" Value="20"/>
8
+      <Setter Property="FontWeight" Value="Medium"/>
9
+    </Style>
10
+
11
+    <Style Selector="TextBlock.h2">
12
+      <Setter Property="Foreground" Value="#727272"/>
13
+      <Setter Property="FontSize" Value="13"/>
14
+    </Style>
15
+    <StyleInclude Source="resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default"/>
16
+    <StyleInclude Source="resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default"/>
17
+    <StyleInclude Source="resm:Editopia.SideBar.xaml"/>
18
+  </Application.Styles>
19
+</Application>

+ 13
- 0
Editopia/App.xaml.cs Ver fichero

@@ -0,0 +1,13 @@
1
+using Avalonia;
2
+using Avalonia.Markup.Xaml;
3
+
4
+namespace Editopia
5
+{
6
+    public class App : Application
7
+    {
8
+        public override void Initialize()
9
+        {
10
+            AvaloniaXamlLoader.Load(this);
11
+        }
12
+    }
13
+}

+ 45
- 0
Editopia/Editopia.csproj Ver fichero

@@ -0,0 +1,45 @@
1
+<Project Sdk="Microsoft.NET.Sdk">
2
+  <PropertyGroup>
3
+    <OutputType>WinExe</OutputType>
4
+    <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
5
+    <StartupObject>Editopia.Program</StartupObject>
6
+    <ApplicationIcon />
7
+  </PropertyGroup>
8
+  <ItemGroup>
9
+    <Compile Update="**\*.xaml.cs">
10
+      <DependentUpon>%(Filename)</DependentUpon>
11
+    </Compile>
12
+    <EmbeddedResource Include="**\*.xaml">
13
+      <SubType>Designer</SubType>
14
+    </EmbeddedResource>
15
+  </ItemGroup>
16
+  <ItemGroup>
17
+    <None Remove="MainView.xaml" />
18
+    <None Remove="Pages\EditTrainer.xaml" />
19
+    <None Remove="Pages\FilePage.xaml" />
20
+    <None Remove="sidebar.xaml" />
21
+  </ItemGroup>
22
+  <ItemGroup>
23
+    <PackageReference Include="Avalonia" Version="0.6.1" />
24
+    <PackageReference Include="Avalonia.Desktop" Version="0.6.1" />
25
+  </ItemGroup>
26
+  <ItemGroup>
27
+    <Compile Update="MainView.xaml.cs">
28
+      <DependentUpon>MainView.xaml</DependentUpon>
29
+    </Compile>
30
+    <Compile Update="Pages\FilePage.xaml.cs">
31
+      <DependentUpon>FilePage.xaml</DependentUpon>
32
+    </Compile>
33
+    <Compile Update="Pages\EditTrainer.xaml.cs">
34
+      <DependentUpon>EditTrainer.xaml</DependentUpon>
35
+    </Compile>
36
+  </ItemGroup>
37
+  <ItemGroup>
38
+    <EmbeddedResource Update="Pages\FilePage.xaml">
39
+      <Generator>MSBuild:Compile</Generator>
40
+    </EmbeddedResource>
41
+    <EmbeddedResource Update="Pages\EditTrainer.xaml">
42
+      <Generator>MSBuild:Compile</Generator>
43
+    </EmbeddedResource>
44
+  </ItemGroup>
45
+</Project>

+ 12
- 0
Editopia/MainView.xaml Ver fichero

@@ -0,0 +1,12 @@
1
+<UserControl xmlns="https://github.com/avaloniaui"
2
+        xmlns:pages="clr-namespace:Editopia.Pages"
3
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
4
+  <TabControl Classes="sidebar" Name="Sidebar">
5
+    <TabItem Header="File">
6
+      <pages:FilePage/>
7
+    </TabItem>
8
+    <TabItem Header="Trainer">
9
+      <pages:EditTrainer/>
10
+    </TabItem>
11
+  </TabControl>
12
+</UserControl>

+ 18
- 0
Editopia/MainView.xaml.cs Ver fichero

@@ -0,0 +1,18 @@
1
+using Avalonia.Controls;
2
+using Avalonia.Markup.Xaml;
3
+
4
+namespace Editopia
5
+{
6
+    public class MainView : UserControl
7
+    {
8
+        public MainView()
9
+        {
10
+            this.InitializeComponent();
11
+        }
12
+
13
+        private void InitializeComponent()
14
+        {
15
+            AvaloniaXamlLoader.Load(this);
16
+        }
17
+    }
18
+}

+ 6
- 0
Editopia/MainWindow.xaml Ver fichero

@@ -0,0 +1,6 @@
1
+<Window xmlns="https://github.com/avaloniaui"
2
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3
+        Title="Editopia"
4
+        xmlns:local="clr-namespace:Editopia">
5
+  <local:MainView/>
6
+</Window>

+ 24
- 0
Editopia/MainWindow.xaml.cs Ver fichero

@@ -0,0 +1,24 @@
1
+using Avalonia;
2
+using Avalonia.Controls;
3
+using Avalonia.Markup.Xaml;
4
+
5
+namespace Editopia
6
+{
7
+    public class MainWindow : Window
8
+    {
9
+        public MainWindow()
10
+        {
11
+            InitializeComponent();
12
+#if DEBUG
13
+            this.AttachDevTools();
14
+#endif
15
+        }
16
+
17
+        private void InitializeComponent()
18
+        {
19
+            var theme = new Avalonia.Themes.Default.DefaultTheme();
20
+            theme.TryGetResource("Button", out _);
21
+            AvaloniaXamlLoader.Load(this);
22
+        }
23
+    }
24
+}

+ 6
- 0
Editopia/Pages/EditTrainer.xaml Ver fichero

@@ -0,0 +1,6 @@
1
+<UserControl xmlns="https://github.com/avaloniaui"
2
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3
+  <StackPanel Orientation="Vertical" Gap="4">
4
+    <TextBlock Classes="h1">Trainer Editor</TextBlock>
5
+  </StackPanel>
6
+</UserControl>

+ 19
- 0
Editopia/Pages/EditTrainer.xaml.cs Ver fichero

@@ -0,0 +1,19 @@
1
+using Avalonia;
2
+using Avalonia.Controls;
3
+using Avalonia.Markup.Xaml;
4
+
5
+namespace Editopia.Pages
6
+{
7
+    public class EditTrainer : UserControl
8
+    {
9
+        public EditTrainer()
10
+        {
11
+            this.InitializeComponent();
12
+        }
13
+
14
+        private void InitializeComponent()
15
+        {
16
+            AvaloniaXamlLoader.Load(this);
17
+        }
18
+    }
19
+}

+ 6
- 0
Editopia/Pages/FilePage.xaml Ver fichero

@@ -0,0 +1,6 @@
1
+<UserControl xmlns="https://github.com/avaloniaui">
2
+  <StackPanel Orientation="Vertical" Gap="4">
3
+    <TextBlock Classes="h1">File</TextBlock>
4
+    <TextBlock Classes="h2">Manage your project</TextBlock>
5
+  </StackPanel>
6
+</UserControl>

+ 19
- 0
Editopia/Pages/FilePage.xaml.cs Ver fichero

@@ -0,0 +1,19 @@
1
+using Avalonia;
2
+using Avalonia.Controls;
3
+using Avalonia.Markup.Xaml;
4
+
5
+namespace Editopia.Pages
6
+{
7
+    public class FilePage : UserControl
8
+    {
9
+        public FilePage()
10
+        {
11
+            this.InitializeComponent();
12
+        }
13
+
14
+        private void InitializeComponent()
15
+        {
16
+            AvaloniaXamlLoader.Load(this);
17
+        }
18
+    }
19
+}

+ 20
- 0
Editopia/Program.cs Ver fichero

@@ -0,0 +1,20 @@
1
+using System;
2
+using Avalonia;
3
+using Avalonia.Logging.Serilog;
4
+using Editopia;
5
+
6
+namespace Editopia
7
+{
8
+    class Program
9
+    {
10
+        static void Main(string[] args)
11
+        {
12
+            BuildAvaloniaApp().Start<MainWindow>();
13
+        }
14
+
15
+        public static AppBuilder BuildAvaloniaApp()
16
+            => AppBuilder.Configure<App>()
17
+                .UsePlatformDetect()
18
+                .LogToDebug();
19
+    }
20
+}

+ 46
- 0
Editopia/SideBar.xaml Ver fichero

@@ -0,0 +1,46 @@
1
+<Styles xmlns="https://github.com/avaloniaui"
2
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
3
+  <Style Selector="TabControl.sidebar">
4
+    <Setter Property="Template">
5
+      <ControlTemplate>
6
+        <DockPanel>
7
+          <ScrollViewer MinWidth="190" Background="{DynamicResource ThemeAccentBrush}" DockPanel.Dock="Left">
8
+            <TabStrip Name="PART_TabStrip"
9
+                      MemberSelector="{x:Static TabControl.HeaderSelector}"
10
+                      Items="{TemplateBinding Items}"
11
+                      SelectedIndex="{TemplateBinding SelectedIndex, Mode=TwoWay}">
12
+              <TabStrip.ItemsPanel>
13
+                <ItemsPanelTemplate>
14
+                  <StackPanel Orientation="Vertical"/>
15
+                </ItemsPanelTemplate>
16
+              </TabStrip.ItemsPanel>
17
+            </TabStrip>
18
+          </ScrollViewer>
19
+          <Carousel Name="PART_Content"
20
+                    Margin="8 0 0 0"
21
+                    MemberSelector="{x:Static TabControl.ContentSelector}"
22
+                    Items="{TemplateBinding Items}"
23
+                    SelectedIndex="{TemplateBinding SelectedIndex}"
24
+                    Grid.Row="1"/>
25
+        </DockPanel>
26
+      </ControlTemplate>
27
+    </Setter>
28
+  </Style>
29
+
30
+  <Style Selector="TabControl.sidebar TabStripItem">
31
+    <Setter Property="Foreground" Value="White"/>
32
+    <Setter Property="FontSize" Value="14"/>
33
+    <Setter Property="Margin" Value="0"/>
34
+    <Setter Property="Padding" Value="16"/>
35
+    <Setter Property="Opacity" Value="0.5"/>
36
+  </Style>
37
+
38
+  <Style Selector="TabControl.sidebar TabStripItem:pointerover">
39
+    <Setter Property="Opacity" Value="1"/>
40
+  </Style>
41
+
42
+  <Style Selector="TabControl.sidebar TabStripItem:selected">
43
+    <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush2}"/>
44
+    <Setter Property="Opacity" Value="1"/>
45
+  </Style>
46
+</Styles>

+ 6
- 0
Editopia/nuget.config Ver fichero

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<configuration>
3
+  <packageSources>
4
+    <add key="AvaloniaCI" value="https://www.myget.org/F/avalonia-ci/api/v2" />
5
+  </packageSources>
6
+</configuration>