Skip to content

Commit

Permalink
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Browse files Browse the repository at this point in the history
  • Loading branch information
PieroCastillo committed Feb 1, 2024
1 parent 2ecdeb1 commit 258acf0
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 248 deletions.
18 changes: 5 additions & 13 deletions samples/Aura.UI.Gallery.NetCore/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,13 @@ public static void Main(string[] args) => BuildAvaloniaApp()
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.With(new Win32PlatformOptions
{
AllowEglInitialization = true,
UseDeferredRendering = true,
OverlayPopups = true,
})
.With(new X11PlatformOptions
{
OverlayPopups = true
})
.With(new MacOSPlatformOptions
{
ShowInDock = true
{
CompositionMode = new[] { Win32CompositionMode.WinUIComposition },
RenderingMode = new[] { Win32RenderingMode.Software },
})
.UseSkia()
.UsePlatformDetect()
.LogToTrace()
.UseReactiveUI();
}
Expand Down
9 changes: 5 additions & 4 deletions samples/Aura.UI.Gallery/App.axaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
RequestedThemeVariant="Light"
x:Class="Aura.UI.Gallery.App">
<Application.Styles>
<!--<StyleInclude Source="avares://Avalonia.Themes.Default/Accents/BaseLight.xaml"/>-->
<!--<FluentTheme Mode="Dark"/>-->
<StyleInclude Source="avares://AvaloniaEdit/AvaloniaEdit.xaml"/>
<StyleInclude Source="/Controls/CodeExample.xaml"/>
<FluentTheme/>
<StyleInclude Source="avares://Aura.UI.FluentTheme/AuraUI.xaml"/>
<StyleInclude Source="avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml" />
<StyleInclude Source="/Controls/CodeExample.axaml"/>
<Style Selector="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
Expand Down
54 changes: 9 additions & 45 deletions samples/Aura.UI.Gallery/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,37 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Avalonia.Markup.Xaml.Styling;
using Avalonia.Styling;
using Avalonia.Threading;
using ReactiveUI;
using System;
using System.Diagnostics;
using System.Reactive;
using System.Threading.Tasks;
using Avalonia.Controls;
using System.Threading;
using Aura.UI.Controls.Navigation;
using Avalonia.Controls.Presenters;
using Avalonia.Animation;
using Avalonia.Animation.Easings;
using System.Text;
using Avalonia.Media;

namespace Aura.UI.Gallery
{
public class App : Application
public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
var settings_prov = new SettingsProvider();
Settings = settings_prov.Load<AppSettings>();

switch (Settings.Theme)
{
case Theme.Light:
Styles.Insert(0, App.FluentLight);
SetTheme(Theme.Light);
break;

case Theme.Dark:
Styles.Insert(0, App.FluentDark);
SetTheme(Theme.Dark);
break;
}

AvaloniaXamlLoader.Load(this);
}


public override void OnFrameworkInitializationCompleted()
{
// NavigationViewStatic();
// NavigationViewStatic();
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{

Expand All @@ -57,7 +45,7 @@ public override void OnFrameworkInitializationCompleted()

desktop.Exit += (s, e) =>
{
new SettingsProvider().Save(Settings);
//new SettingsProvider().Save(Settings);
};
}
else if (ApplicationLifetime is ISingleViewApplicationLifetime single)
Expand Down Expand Up @@ -86,10 +74,10 @@ await Dispatcher.UIThread.InvokeAsync(() =>
switch (theme)
{
case Theme.Light:
Application.Current.Styles[0] = App.FluentLight;
RequestedThemeVariant = ThemeVariant.Light;
break;
case Theme.Dark:
Application.Current.Styles[0] = App.FluentDark;
RequestedThemeVariant = ThemeVariant.Dark;
break;
}
}, (DispatcherPriority)1);
Expand All @@ -101,30 +89,6 @@ await Dispatcher.UIThread.InvokeAsync(() =>
Console.WriteLine($"some error has executed");
}
}

public readonly static Styles FluentDark = new Styles
{
new StyleInclude(new Uri("avares://Aura.UI.Gallery/Styles"))
{
Source = new Uri("avares://Avalonia.Themes.Fluent/FluentDark.xaml")
},
new StyleInclude(new Uri("avares://Aura.UI.Gallery/Styles"))
{
Source = new Uri("avares://Aura.UI.FluentTheme/AuraUI.xaml")
}
};

public readonly static Styles FluentLight = new Styles
{
new StyleInclude(new Uri("avares://Aura.UI.Gallery/Styles"))
{
Source = new Uri("avares://Avalonia.Themes.Fluent/FluentLight.xaml")
},
new StyleInclude(new Uri("avares://Aura.UI.Gallery/Styles"))
{
Source = new Uri("avares://Aura.UI.FluentTheme/AuraUI.xaml")
}
};
}

[Serializable]
Expand Down
Binary file removed samples/Aura.UI.Gallery/App.settings
Binary file not shown.
49 changes: 4 additions & 45 deletions samples/Aura.UI.Gallery/Aura.UI.Gallery.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,7 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\20000.jpg" />
<AvaloniaResource Include="Assets\40000.jpg" />
<AvaloniaResource Include="Assets\75000.jpg" />
<AvaloniaResource Include="Assets\alonetogheterRM.jpg" />
<AvaloniaResource Include="Assets\AuraUIBanner_v2.png" />
<AvaloniaResource Include="Assets\AuraUILogo_full_icon.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</AvaloniaResource>
<AvaloniaResource Include="Assets\AuraUILogo_icon.png" />
<AvaloniaResource Include="Assets\bringtherain.jpg" />
<AvaloniaResource Include="Assets\dejavu.jpg" />
<AvaloniaResource Include="Assets\funny.jpg" />
<AvaloniaResource Include="Assets\greenlights.jpg" />
<AvaloniaResource Include="Assets\hourglass.jpg" />
<AvaloniaResource Include="Assets\howyouloveme.jpg" />
<AvaloniaResource Include="Assets\ignite.jpg" />
<AvaloniaResource Include="Assets\in2thefire.jpg" />
<AvaloniaResource Include="Assets\interface.png" />
<AvaloniaResource Include="Assets\levels.jpg" />
<AvaloniaResource Include="Assets\morethanyouknow.jpg" />
<AvaloniaResource Include="Assets\nana.jpg" />
<AvaloniaResource Include="Assets\nerve.jpg" />
<AvaloniaResource Include="Assets\noguarantee.jpg" />
<AvaloniaResource Include="Assets\staythenight.jpg" />
<AvaloniaResource Include="Assets\summerashes.jpg" />
<AvaloniaResource Include="Assets\summershesvip.jpg" />
<AvaloniaResource Include="Assets\th2cdyro.jpg" />
<AvaloniaResource Include="Assets\tonight.jpg" />
<AvaloniaResource Include="Assets\tonightvip.png" />
<AvaloniaResource Include="Assets\virus.jpg" />
<AvaloniaResource Include="Assets\younme.jpg" />
<None Remove="Assets\reactiveuiLogo.svg" />
<AvaloniaResource Include="Assets\reactiveuiLogo.svg" />
</ItemGroup>
<ItemGroup>
<AvaloniaXaml Include="Controls\CodeExample.xaml">
<Generator>MSBuild:Compile</Generator>
</AvaloniaXaml>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AuraUtilities" Version="0.1.5.5" />
Expand All @@ -53,16 +16,12 @@
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="11.0.7" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.7" />
<PackageReference Include="Avalonia.Svg" Version="11.0.0.12" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.7" />
<PackageReference Include="AvaloniaEdit.TextMate" Version="11.0.6" />
<PackageReference Include="jp2masa.Avalonia.Flexbox" Version="0.2.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Aura.UI.FluentTheme\Aura.UI.FluentTheme.csproj" />
<ProjectReference Include="..\..\src\Aura.UI\Aura.UI.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="App.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>App.Designer.cs</LastGenOutput>
</None>
<ProjectReference Include="..\..\src\Aura.UI.FluentTheme\Aura.UI.FluentTheme.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,19 @@
using Aura.UI.Extensions;
using AvaloniaEdit.Indentation.CSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Avalonia.Collections;
using Avalonia.Layout;
using Avalonia.LogicalTree;

namespace Aura.UI.Gallery.Controls
{
public class CodeExample : TemplatedControl, ILogical
public class CodeExample : TemplatedControl
{
static CodeExample()
{
ControlProperty.Changed.Subscribe(ControlChildChanged);
}
private TextEditor xaml_edit;
private TextEditor c_edit;
private IAvaloniaReadOnlyList<ILogical> _logicalChildren1;

private static void ControlChildChanged(AvaloniaPropertyChangedEventArgs e)
{
Expand Down Expand Up @@ -110,7 +104,5 @@ public string TitleTwo
}
public static readonly StyledProperty<string> TitleTwoProperty =
AvaloniaProperty.Register<CodeExample, string>(nameof(TitleTwo));

IAvaloniaReadOnlyList<ILogical> ILogical.LogicalChildren => this.LogicalChildren;
}
}
23 changes: 0 additions & 23 deletions samples/Aura.UI.Gallery/Highlighting/XAML-mode.xshd

This file was deleted.

4 changes: 2 additions & 2 deletions samples/Aura.UI.Gallery/Pages/BadgePage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<Rectangle Width="20" Height="20" Fill="LightGreen" RenderTransform="rotate(45deg)"/>
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"
TextBlock.FontSize="10"
FontSize="10"
Content="{Binding $parent[Badge].BadgeContent}"/>
</Panel>
</DataTemplate>
Expand All @@ -110,7 +110,7 @@
&lt;Rectangle Width="20" Height="20" Fill="LightGreen" RenderTransform="rotate(45deg)"/>
&lt;ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"
TextBlock.FontSize="10"
FontSize="10"
Content="{Binding $parent[Badge].BadgeContent}"/>
&lt;/Panel>
&lt;/DataTemplate>
Expand Down
16 changes: 8 additions & 8 deletions samples/Aura.UI.Gallery/Pages/SettingsPage.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,32 @@ public SettingsPage()
{
switch (app.GetTheme())
{
case Theme.Light:
case Gallery.Theme.Light:
PART_DarkOption.IsChecked = false;
PART_LightOption.IsChecked = true;
break;
case Theme.Dark:
case Gallery.Theme.Dark:
PART_DarkOption.IsChecked = true;
PART_LightOption.IsChecked = false;
break;
}
}

PART_DarkOption.Checked += async (s, e) =>
PART_DarkOption.IsCheckedChanged += async (s, e) =>
{
if (Application.Current is App app)
if (PART_DarkOption.IsChecked == true && Application.Current is App app)
{
Debug.WriteLine("dark checked");
await app.SetTheme(Theme.Dark);
await app.SetTheme(Gallery.Theme.Dark);
}
};

PART_LightOption.Checked += async (s, e) =>
PART_LightOption.IsCheckedChanged += async (s, e) =>
{
if (Application.Current is App app)
if (PART_LightOption.IsChecked == true && Application.Current is App app)
{
Debug.WriteLine("light checked");
await app.SetTheme(Theme.Light);
await app.SetTheme(Gallery.Theme.Light);
}
};

Expand Down
3 changes: 1 addition & 2 deletions samples/Aura.UI.Gallery/ViewModels/CardControlViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System.Windows.Input;
using Aura.UI.Data;
using ReactiveUI;

namespace Aura.UI.Gallery.ViewModels
{
public class CardControlViewModel : ViewModelBase, ICardControlTemplate
public class CardControlViewModel : ViewModelBase
{
private ICommand _command;
private object _commandParameter;
Expand Down
9 changes: 3 additions & 6 deletions samples/Aura.UI.Gallery/ViewModels/ReactiveAuraTabViewPage.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using Aura.UI.Data;
using Avalonia;
using Avalonia.Media;
using Avalonia.Platform;
Expand All @@ -10,9 +9,7 @@ public class ReactiveAuraTabViewPage : ViewModelBase
{
public ReactiveAuraTabViewPage()
{
var assetLoader = AvaloniaLocator.CurrentMutable.GetService<IAssetLoader>();

ItemsSource = new List<IAuraTabItemTemplate>()
ItemsSource = new List<AuraTabViewViewModel>()
{
new AuraTabViewViewModel()
{
Expand All @@ -33,10 +30,10 @@ public ReactiveAuraTabViewPage()
}
};
}
public IList<IAuraTabItemTemplate> ItemsSource { get; }
public IList<AuraTabViewViewModel> ItemsSource { get; }
}

public class AuraTabViewViewModel : IAuraTabItemTemplate
public class AuraTabViewViewModel
{
public object Content { get; set; }

Expand Down
Loading

0 comments on commit 258acf0

Please sign in to comment.