Skip to content

Commit

Permalink
CustomNavigation collaboration (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewire129 authored Jan 30, 2024
1 parent 594b7cb commit faf9bc7
Show file tree
Hide file tree
Showing 196 changed files with 3,995 additions and 32 deletions.
22 changes: 22 additions & 0 deletions src/.idea/.idea.AvaloniaInside.Shell/.idea/avalonia.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions src/AvaloniaInside.Shell.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{50F7051E
..\README.md = ..\README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShellBottomCustomNavigator", "Example\ShellBottomCustomNavigator\ShellBottomCustomNavigator\ShellBottomCustomNavigator.csproj", "{6D8FCCDB-C66B-4B81-9555-725E1EE912B8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShellBottomCustomNavigator.Android", "Example\ShellBottomCustomNavigator\ShellBottomCustomNavigator.Android\ShellBottomCustomNavigator.Android.csproj", "{4CEAC589-3446-4370-9357-C362E03DB56E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShellBottomCustomNavigator.Desktop", "Example\ShellBottomCustomNavigator\ShellBottomCustomNavigator.Desktop\ShellBottomCustomNavigator.Desktop.csproj", "{6FAADB02-7185-463E-8C93-5DAEE90EF782}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShellBottomCustomNavigator.iOS", "Example\ShellBottomCustomNavigator\ShellBottomCustomNavigator.iOS\ShellBottomCustomNavigator.iOS.csproj", "{C77D28D8-7583-40FE-9EA7-6E8B5F902A8B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShellBottomCustomNavigator.Browser", "Example\ShellBottomCustomNavigator\ShellBottomCustomNavigator.Browser\ShellBottomCustomNavigator.Browser.csproj", "{58D15C4F-ADC5-4550-9224-365FFB38955D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -55,6 +65,26 @@ Global
{75883514-564B-4EBA-83D8-68FD9FDB0CB2}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{75883514-564B-4EBA-83D8-68FD9FDB0CB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75883514-564B-4EBA-83D8-68FD9FDB0CB2}.Release|Any CPU.Build.0 = Release|Any CPU
{6D8FCCDB-C66B-4B81-9555-725E1EE912B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6D8FCCDB-C66B-4B81-9555-725E1EE912B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6D8FCCDB-C66B-4B81-9555-725E1EE912B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6D8FCCDB-C66B-4B81-9555-725E1EE912B8}.Release|Any CPU.Build.0 = Release|Any CPU
{4CEAC589-3446-4370-9357-C362E03DB56E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CEAC589-3446-4370-9357-C362E03DB56E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CEAC589-3446-4370-9357-C362E03DB56E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CEAC589-3446-4370-9357-C362E03DB56E}.Release|Any CPU.Build.0 = Release|Any CPU
{6FAADB02-7185-463E-8C93-5DAEE90EF782}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6FAADB02-7185-463E-8C93-5DAEE90EF782}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6FAADB02-7185-463E-8C93-5DAEE90EF782}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6FAADB02-7185-463E-8C93-5DAEE90EF782}.Release|Any CPU.Build.0 = Release|Any CPU
{C77D28D8-7583-40FE-9EA7-6E8B5F902A8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C77D28D8-7583-40FE-9EA7-6E8B5F902A8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C77D28D8-7583-40FE-9EA7-6E8B5F902A8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C77D28D8-7583-40FE-9EA7-6E8B5F902A8B}.Release|Any CPU.Build.0 = Release|Any CPU
{58D15C4F-ADC5-4550-9224-365FFB38955D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58D15C4F-ADC5-4550-9224-365FFB38955D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58D15C4F-ADC5-4550-9224-365FFB38955D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58D15C4F-ADC5-4550-9224-365FFB38955D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -65,6 +95,11 @@ Global
{721FC232-3B13-492D-A96B-C6784FEDB10C} = {A495BEFD-2260-489E-A8F3-003EF9603D43}
{E2E23F24-CC66-4940-91EA-68C28DC04602} = {A495BEFD-2260-489E-A8F3-003EF9603D43}
{75883514-564B-4EBA-83D8-68FD9FDB0CB2} = {A495BEFD-2260-489E-A8F3-003EF9603D43}
{6D8FCCDB-C66B-4B81-9555-725E1EE912B8} = {A495BEFD-2260-489E-A8F3-003EF9603D43}
{4CEAC589-3446-4370-9357-C362E03DB56E} = {A495BEFD-2260-489E-A8F3-003EF9603D43}
{6FAADB02-7185-463E-8C93-5DAEE90EF782} = {A495BEFD-2260-489E-A8F3-003EF9603D43}
{C77D28D8-7583-40FE-9EA7-6E8B5F902A8B} = {A495BEFD-2260-489E-A8F3-003EF9603D43}
{58D15C4F-ADC5-4550-9224-365FFB38955D} = {A495BEFD-2260-489E-A8F3-003EF9603D43}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {10F59C6F-508A-4C41-820B-AAC163C9FDB2}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Globalization;
using Avalonia.Data.Converters;
using Avalonia.Media.Imaging;
using ShellBottomCustomNavigator.Helpers;

namespace ShellBottomCustomNavigator.Converters;

public class BitmapAssetValueConverter : IValueConverter
{
public static BitmapAssetValueConverter Instance = new BitmapAssetValueConverter();

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
return null;

if (value is string rawUri && targetType.IsAssignableFrom(typeof(Bitmap)))
{
return rawUri.GetBitmapFromAssets();
}

throw new NotSupportedException();
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Avalonia.Controls;
using Avalonia.VisualTree;

namespace ShellBottomCustomNavigator;
public static class Helper
{
public static void SetCarouselToTabControl(Carousel carousel, bool v)
{
var tabControl = carousel.FindAncestorOfType<TabControl>();
if (tabControl == null)
{
carousel.AttachedToVisualTree += delegate { SetCarouselToTabControl(carousel, true); };
return;
}

carousel.ItemsSource = tabControl.Items;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using Avalonia;
using Avalonia.Media.Imaging;
using Avalonia.Platform;
using Splat;

namespace ShellBottomCustomNavigator.Helpers;

public static class ImageHelper
{
public static Bitmap? GetBitmapFromAssets(this string rawUri)
{
Uri uri;

// Allow for assembly overrides
if (rawUri.StartsWith("avares://"))
{
uri = new Uri(rawUri);
}
else
{
var assemblyName = typeof(ImageHelper).Assembly.GetName().Name;
uri = new Uri($"avares://{assemblyName}/{rawUri.TrimStart('/')}");
}


//var assets = Locator.Current.GetService<IAssetLoader>();
using var asset = AssetLoader.Open(uri);

return new Bitmap(asset);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.IO;
using System.Reflection;
using Newtonsoft.Json;

namespace ShellBottomCustomNavigator.Models;

public static class DummyPlace
{
public static ProductDto[] Products { get; }

public static string GetProductsJson()
{
var assembly = Assembly.GetExecutingAssembly();
using var stream = assembly.GetManifestResourceStream("ShellBottomCustomNavigator.Resources.Products.json");
using var reader = new StreamReader(stream);
return reader.ReadToEnd();
}

static DummyPlace()
{
Products = JsonConvert.DeserializeObject<ProductDto[]>(GetProductsJson()) ?? throw new Exception("Where is my resource?!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using Newtonsoft.Json;

namespace ShellBottomCustomNavigator.Models;

public partial class ProductDto
{
[JsonProperty("ProductId")]
public string ProductId { get; set; }

[JsonProperty("Category")]
public string Category { get; set; }

[JsonProperty("MainCategory")]
public string MainCategory { get; set; }

[JsonProperty("SupplierName")]
public string SupplierName { get; set; }

[JsonProperty("Weight")]
public string Weight { get; set; }

[JsonProperty("WeightUnit")]
public string WeightUnit { get; set; }

[JsonProperty("ShortDescription")]
public string ShortDescription { get; set; }

[JsonProperty("Name")]
public string Name { get; set; }

[JsonProperty("PictureUrl")]
public string PictureUrl { get; set; }

[JsonProperty("Status")]
public string Status { get; set; }

[JsonProperty("Price")]
// [JsonConverter(typeof(ParseStringConverter))]
public decimal Price { get; set; }

[JsonProperty("DimensionWidth")]
// [JsonConverter(typeof(ParseStringConverter))]
public double DimensionWidth { get; set; }

[JsonProperty("DimensionDepth")]
// [JsonConverter(typeof(ParseStringConverter))]
public double DimensionDepth { get; set; }

[JsonProperty("DimensionHeight")]
public double DimensionHeight { get; set; }

[JsonProperty("Unit")]
public string Unit { get; set; }

[JsonProperty("CurrencyCode")]
public string CurrencyCode { get; set; }
}
Loading

0 comments on commit faf9bc7

Please sign in to comment.