Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #1

Merged
merged 3 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Source/StaX.Debug/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,15 @@ private static void LoadNativeRuntimeDlls(string path)
{
NativeLibrary.Load(file);
}
catch (Exception ex) { /*not implemented*/ }
catch { /*not implemented*/ }

var files = Directory.GetFiles(path);
foreach (var file in files)
try
{
Assembly.LoadFile(file);
}
catch (Exception ex)
{ /*not implemented*/ }
catch { /*not implemented*/ }
}

private static IUiState? LoadPlugin(string path)
Expand All @@ -83,6 +82,10 @@ private static void LoadNativeRuntimeDlls(string path)
List<IUiState> states = [];

var pluginFolder = Directory.GetParent(fullPath);

if (pluginFolder is null)
return null;

SetDllDirectory(pluginFolder.FullName);

using (var catalog = new DirectoryCatalog(pluginFolder.FullName))
Expand All @@ -101,8 +104,9 @@ private static void LoadNativeRuntimeDlls(string path)
if (stateInstance != null && stateInstance is IUiState uiState)
states.Add(uiState);
}
catch (Exception ex)
catch
{
//ignore
}
}
}
Expand Down
Binary file added Source/StaX.Desktop/Assets/StaXBlack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Source/StaX.Desktop/Assets/StaXWhite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion Source/StaX.Desktop/StaX.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>

<ItemGroup>
<None Remove="Assets\StaX.ico" />
</ItemGroup>

<ItemGroup>
<Content Include="Assets\StaX.ico" />
<Content Include="Assets\StaXBlack.png" />
<Content Include="Assets\StaXWhite.png" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 6 additions & 3 deletions Source/StaX.Desktop/ViewLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ public class ViewLocator : IDataTemplate
{
if (data is not null && data is LazyUiState uiState)
{
var control = uiState.UiState.StateView;
control.DataContext = uiState.UiState.StateViewModel;
return control;
if (uiState.UiState is not null)
{
var control = uiState.UiState.StateView;
control.DataContext = uiState.UiState.StateViewModel;
return control;
}
}
return null;
}
Expand Down
23 changes: 11 additions & 12 deletions Source/StaX.Desktop/Views/MainAppSplashContent.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,42 @@

<UserControl.Resources>
<ResourceDictionary>
<!--<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<ImageBrush
x:Key="LogoImageBrush"
AlignmentY="Center"
Source="/Assets/BlackLogo.png"
Source="/Assets/StaXBlack.png"
Stretch="UniformToFill" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<ImageBrush
x:Key="LogoImageBrush"
AlignmentY="Center"
Source="/Assets/Logo.png"
Source="/Assets/StaXWhite.png"
Stretch="UniformToFill" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>-->
</ResourceDictionary.ThemeDictionaries>
<ui:ImageIconSource x:Key="AppLogo" Source="/Assets/StaX.ico" />
</ResourceDictionary>
</UserControl.Resources>

<Panel Background="{DynamicResource ApplicationPageBackgroundThemeBrush}">
<Border
Width="892"
Height="174"
Width="900"
Height="200"
Background="{DynamicResource LogoImageBrush}"
ClipToBounds="True"
CornerRadius="8 0 0 0"
RenderOptions.BitmapInterpolationMode="HighQuality" />

<!-- Background="{DynamicResource LogoImageBrush}" -->

<ui:IconSourceElement
Width="150"
Height="150"
Margin="-920,0,0,-100"
Width="170"
Height="170"
Margin="-900,0,0,-140"
IconSource="{StaticResource AppLogo}" />
<Grid
Margin="0,0,0,-120"
Margin="0,0,0,-140"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<ui:ItemsRepeater ItemsSource="{Binding PluginLoaderVisualizator.Icons}">
Expand Down
2 changes: 1 addition & 1 deletion Source/StaX.Desktop/Views/MainAppSplashScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
DataContext = this,
};

public int MinimumShowTime => 1000;
public int MinimumShowTime => 1200;

public Action? InitApp { get; set; }

Expand All @@ -48,7 +48,7 @@

if (_pluginLoaderVisualizator is not null)
{
PluginLoaderVisualizator.Icons.CollectionChanged += _icons_CollectionChanged;

Check warning on line 51 in Source/StaX.Desktop/Views/MainAppSplashScreen.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.
await _serviceLocator.RegisterAsync(_pluginLoaderVisualizator, args);
}

Expand Down
16 changes: 8 additions & 8 deletions Source/StaX.Desktop/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@
Margin="0"
FontSize="21"
Symbol="WeatherMoon" />
<!--<ImageBrush
<ImageBrush
x:Key="LogoImageBrush"
AlignmentY="Center"
Source="/Assets/BlackLogo.png"
Stretch="UniformToFill" />-->
Source="/Assets/StaXBlack.png"
Stretch="UniformToFill" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<ui:SymbolIcon
x:Key="ThemeIcon"
Margin="0"
FontSize="21"
Symbol="WeatherSunny" />
<!--<ImageBrush
<ImageBrush
x:Key="LogoImageBrush"
AlignmentY="Center"
Source="/Assets/Logo.png"
Stretch="UniformToFill" />-->
Source="/Assets/StaXWhite.png"
Stretch="UniformToFill" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<ui:ImageIconSource x:Key="AppLogo" Source="/Assets/StaX.ico" />
Expand All @@ -58,12 +58,12 @@
<Grid>
<Panel Background="{DynamicResource ApplicationPageBackgroundThemeBrush}" Opacity="0.05">
<Border
Width="892"
Width="822"
Height="174"
Background="{DynamicResource LogoImageBrush}"
ClipToBounds="True"
CornerRadius="8 0 0 0"
RenderOptions.BitmapInterpolationMode="HighQuality" />
<!-- Background="{DynamicResource LogoImageBrush}" -->
</Panel>
<ui:NavigationView
x:Name="nvSample"
Expand Down
Loading