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

Dev #11

Merged
merged 34 commits into from
May 22, 2020
Merged

Dev #11

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8a20af9
Update ImageSharp
Panda-Sharp May 2, 2020
b962966
Work on ApplyTileFoundProcessor
Panda-Sharp May 3, 2020
5b08ecb
Add ApplyTileFoundProcessor
Panda-Sharp May 3, 2020
255e770
Move Onboarding strings to strings
Panda-Sharp May 3, 2020
6bf269a
Refactor proessors
Panda-Sharp May 3, 2020
b5d0a07
Refactor
Panda-Sharp May 4, 2020
af91253
Fix ApplyTileFoundProcessor
Panda-Sharp May 5, 2020
c7123e2
Cleanup
Panda-Sharp May 5, 2020
57c80ea
Merge pull request #7 from emiliano84/dev
Emiliano84 May 5, 2020
d2f471e
Chenge SixLabors.ImageSharp.Drawing version
Panda-Sharp May 5, 2020
1ac79e0
Merge pull request #8 from emiliano84/dev
Emiliano84 May 5, 2020
aea8b2a
Fix ApplyTileFoundProcessor
Panda-Sharp May 5, 2020
c49fa4f
Merge branch 'release/store' into dev
Emiliano84 May 5, 2020
715d61c
Merge pull request #9 from emiliano84/dev
Emiliano84 May 5, 2020
cc9c4c3
Update build-pipelines.yml for Azure Pipelines
Emiliano84 May 5, 2020
0a26155
Update build-pipelines.yml for Azure Pipelines
Emiliano84 May 5, 2020
90f7c16
Cleanup
Panda-Sharp May 5, 2020
daed30a
Merge branch 'dev' of https://github.com/emiliano84/Yugen.Mosaic.Uwp …
Panda-Sharp May 5, 2020
d0c5f34
merge
Panda-Sharp May 5, 2020
35df351
Update build-pipelines.yml for Azure Pipelines
Emiliano84 May 5, 2020
2519753
Update build-pipelines.yml for Azure Pipelines
Emiliano84 May 5, 2020
96bd9bc
Remove PR trigger
Panda-Sharp May 6, 2020
3d9b61a
Refactor and Cleanup
Panda-Sharp May 6, 2020
3febfd0
Add gitversion yml file
Panda-Sharp May 6, 2020
eff48a7
Fix
Panda-Sharp May 6, 2020
d26c98d
Update translations
Panda-Sharp May 10, 2020
9d183a9
Refactor and cleanup
Panda-Sharp May 10, 2020
9dbaf43
Refactor and Cleanup
Panda-Sharp May 10, 2020
f0a931b
merge
Panda-Sharp May 10, 2020
0a32e6e
Update strings
Panda-Sharp May 16, 2020
f90dbf3
Update strings
Panda-Sharp May 17, 2020
be8da58
Cleanup
Panda-Sharp May 17, 2020
77cc6cd
Cleanup
Panda-Sharp May 17, 2020
3377bf2
Merge pull request #10 from emiliano84/feature/refactor
Emiliano84 May 22, 2020
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
1 change: 1 addition & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
assembly-file-versioning-format: '{Major}.{Minor}.{BuildMetaData ?? 0}.0'
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
# Yugen Mosaic UWP

## The Toolkit is a collection of helper functions, custom controls, and app services. It helps develop common task for UWP apps.
Yugen Mosaic is a free app that helps you to create digital art pictures made from your own pictures. For example you can create a photo mosaic, an image composed of many tiled photos.

### Contributing
## Contributing
Everyone is welcome to contribute, if you're looking to help out with the project, feel free to join and submit anything that you find useful. If you find an issue please could you raise it in the issues section or it would be fantastic if you could have a look at rectifying the issue and submitting a pull request.

### Getting started
## Getting started
The project has been primarily built for the universal Windows platform (UWP), so you'll need the latest version of [Visual Studio 2019](https://www.visualstudio.com/) (including the community edition) and the latest Windows 10 SDK which you can install as part of the Visual Studio installer.

I'm using github packages from my toolkit for nuget, to restore them in VS you need to add this,
go to tools -> options -> nuget package manager -> package sources
Name: Github (or whatever)
Source: https://nuget.pkg.github.com/emiliano84/index.json

when VS will ask for credentials
username: emiliano84
password: {ask me for the token}

17 changes: 8 additions & 9 deletions Yugen.Mosaic.Uwp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,26 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using Yugen.Mosaic.Uwp.Helpers;
using Yugen.Mosaic.Uwp.Extensions;
using Yugen.Mosaic.Uwp.Services;
using Yugen.Mosaic.Uwp.Views;
using Yugen.Toolkit.Standard.Extensions;

namespace Yugen.Mosaic.Uwp
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
public sealed partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
InitializeComponent();
Suspending += OnSuspending;

AppCenter.Start("7df4b441-69ae-49c5-b27d-5a532f33b554",
typeof(Analytics), typeof(Crashes));
Expand Down Expand Up @@ -76,10 +78,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
private void OnNavigationFailed(object sender, NavigationFailedEventArgs e) => throw new Exception("Failed to load Page " + e.SourcePageType.FullName);

/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
Expand All @@ -90,7 +89,7 @@ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity
deferral.Complete();
}
Expand Down
Binary file modified Yugen.Mosaic.Uwp/Assets/Store/Screenshot.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 Yugen.Mosaic.Uwp/Assets/Store/Screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 14 additions & 17 deletions Yugen.Mosaic.Uwp/Controls/AlignmentGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,44 +60,44 @@ private static void OnPropertyChanged(DependencyObject dependencyObject, Depende
/// </summary>
public Brush LineBrush
{
get { return (Brush)GetValue(LineBrushProperty); }
set { SetValue(LineBrushProperty, value); }
get => (Brush)GetValue(LineBrushProperty);
set => SetValue(LineBrushProperty, value);
}

/// <summary>
/// Gets or sets the step to use horizontally.
/// </summary>
public double HorizontalStep
{
get { return (double)GetValue(HorizontalStepProperty); }
set { SetValue(HorizontalStepProperty, value); }
get => (double)GetValue(HorizontalStepProperty);
set => SetValue(HorizontalStepProperty, value);
}

/// <summary>
/// Gets or sets the step to use horizontally.
/// </summary>
public double VerticalStep
{
get { return (double)GetValue(VerticalStepProperty); }
set { SetValue(VerticalStepProperty, value); }
get => (double)GetValue(VerticalStepProperty);
set => SetValue(VerticalStepProperty, value);
}

/// <summary>
/// Get or set the container width.
/// </summary>
public double ContainerWidth
{
get { return (double)GetValue(ContainerWidthProperty); }
set { SetValue(ContainerWidthProperty, value); }
get => (double)GetValue(ContainerWidthProperty);
set => SetValue(ContainerWidthProperty, value);
}

/// <summary>
/// Get or set the container height.
/// </summary>
public double ContainerHeight
{
get { return (double)GetValue(ContainerHeightProperty); }
set { SetValue(ContainerHeightProperty, value); }
get => (double)GetValue(ContainerHeightProperty);
set => SetValue(ContainerHeightProperty, value);
}

/// <summary>
Expand All @@ -121,7 +121,7 @@ private void Rebuild()
containerCanvas.Children.Clear();
var horizontalStep = HorizontalStep;
var verticalStep = VerticalStep;
var brush = LineBrush ?? (Brush)Application.Current.Resources["ApplicationForegroundThemeBrush"];
Brush brush = LineBrush ?? (Brush)Application.Current.Resources["ApplicationForegroundThemeBrush"];

if (horizontalStep > 0)
{
Expand All @@ -133,7 +133,7 @@ private void Rebuild()
Height = ActualHeight,
Fill = brush
};
Canvas.SetLeft(line, MathHelper.RangesConverter(x, 0, ContainerWidth, 0, ActualWidth));
Canvas.SetLeft(line, MathHelper.RangeConvert(x, 0, ContainerWidth, 0, ActualWidth));

containerCanvas.Children.Add(line);
}
Expand All @@ -149,16 +149,13 @@ private void Rebuild()
Height = 1,
Fill = brush
};
Canvas.SetTop(line, MathHelper.RangesConverter(y, 0, ContainerHeight, 0, ActualHeight));
Canvas.SetTop(line, MathHelper.RangeConvert(y, 0, ContainerHeight, 0, ActualHeight));

containerCanvas.Children.Add(line);
}
}
}

private void AlignmentGrid_SizeChanged(object sender, SizeChangedEventArgs e)
{
Rebuild();
}
private void AlignmentGrid_SizeChanged(object sender, SizeChangedEventArgs e) => Rebuild();
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<ContentDialog x:Class="Yugen.Mosaic.Uwp.SettingsDialog"
<ContentDialog x:Class="Yugen.Mosaic.Uwp.Controls.SettingsDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:xaml="using:Windows.UI.Xaml"
xmlns:vm="using:Yugen.Mosaic.Uwp.ViewModels"
xmlns:converters="using:Yugen.Toolkit.Uwp.Converters"
RequestedTheme="{Binding ElementTheme}"
RequestedTheme="{x:Bind ViewModel.ElementTheme, Mode=OneWay}"
mc:Ignorable="d">

<ContentDialog.Resources>
Expand Down Expand Up @@ -35,7 +35,7 @@
<Button Style="{StaticResource SoftRevealButtonStyle}"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Tapped="Button_Tapped">
Command="{x:Bind HideCommand}">
<FontIcon Glyph="" />
</Button>
</Grid>
Expand All @@ -46,24 +46,24 @@
Foreground="{ThemeResource AppForegroundBrush}"
Style="{StaticResource SubtitleTextBlockStyle}" />
<RadioButton Content="Light"
Command="{Binding SwitchThemeCommand}"
IsChecked="{Binding ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Light, Mode=OneWay}"
Command="{x:Bind ViewModel.SwitchThemeCommand}"
IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Light, Mode=OneWay}"
Foreground="{ThemeResource AppForegroundBrush}">
<RadioButton.CommandParameter>
<xaml:ElementTheme>Light</xaml:ElementTheme>
</RadioButton.CommandParameter>
</RadioButton>
<RadioButton Content="Dark"
Command="{Binding SwitchThemeCommand}"
IsChecked="{Binding ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Dark, Mode=OneWay}"
Command="{x:Bind ViewModel.SwitchThemeCommand}"
IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Dark, Mode=OneWay}"
Foreground="{ThemeResource AppForegroundBrush}">
<RadioButton.CommandParameter>
<xaml:ElementTheme>Dark</xaml:ElementTheme>
</RadioButton.CommandParameter>
</RadioButton>
<RadioButton Content="Default"
Command="{Binding SwitchThemeCommand}"
IsChecked="{Binding ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Default, Mode=OneWay}"
Command="{x:Bind ViewModel.SwitchThemeCommand}"
IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Default, Mode=OneWay}"
Foreground="{ThemeResource AppForegroundBrush}">
<RadioButton.CommandParameter>
<xaml:ElementTheme>Default</xaml:ElementTheme>
Expand All @@ -80,32 +80,32 @@

<TextBlock Foreground="{ThemeResource AppForegroundBrush}"
Style="{StaticResource CaptionTextBlockStyle}">
<Run Text="{Binding AppName}"
<Run Text="{x:Bind ViewModel.AppName}"
FontWeight="SemiBold" />
<LineBreak />
<Run Text="{Binding AppVersion}" />
<Run Text="{x:Bind ViewModel.AppVersion}" />
</TextBlock>

<TextBlock Foreground="{ThemeResource AppForegroundBrush}"
Style="{StaticResource CaptionTextBlockStyle}">
<Run Text="Developed by"
FontWeight="SemiBold" />
<LineBreak />
<Run Text="{Binding Publisher}" />
<Run Text="{x:Bind ViewModel.Publisher}" />
</TextBlock>

<TextBlock Foreground="{ThemeResource AppForegroundBrush}"
Style="{StaticResource CaptionTextBlockStyle}">
<Run Text="Colaborators"
FontWeight="SemiBold" />
<LineBreak />
<Run Text="{Binding Collaborator[0]}" />
<Run Text="{x:Bind ViewModel.Collaborator[0]}" />
<LineBreak />
<Run Text="{Binding Collaborator[1]}" />
<Run Text="{x:Bind ViewModel.Collaborator[1]}" />
</TextBlock>

<HyperlinkButton Content="Rate and review"
Command="{Binding LaunchRateAndReviewCommand}" />
Command="{x:Bind ViewModel.LaunchRateAndReviewCommand}" />

</StackPanel>

Expand Down
23 changes: 23 additions & 0 deletions Yugen.Mosaic.Uwp/Controls/SettingsDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Windows.Input;
using Windows.UI.Xaml.Controls;
using Yugen.Mosaic.Uwp.ViewModels;
using Yugen.Toolkit.Standard.Commands;

// The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238

namespace Yugen.Mosaic.Uwp.Controls
{
public sealed partial class SettingsDialog : ContentDialog
{
private ICommand _hideCommand;
public SettingsViewModel ViewModel => DataContext as SettingsViewModel;

public SettingsDialog()
{
InitializeComponent();
//DataContext = new SettingsViewModel();
}

public ICommand HideCommand => _hideCommand ?? (_hideCommand = new RelayCommand(() => Hide()));
}
}
9 changes: 8 additions & 1 deletion Yugen.Mosaic.Uwp/Enums/FileFormat.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
namespace Yugen.Mosaic.Uwp.Enums
using System.ComponentModel;

namespace Yugen.Mosaic.Uwp.Enums
{
public enum FileFormat
{
[Description(".jpg")]
Jpg,
[Description(".png")]
Png,
[Description(".bmp")]
Bmp,
[Description(".tiff")]
Tiff,
[Description(".gif")]
Gif
}
}
16 changes: 16 additions & 0 deletions Yugen.Mosaic.Uwp/Enums/MosaicTypeEnum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.ComponentModel;

namespace Yugen.Mosaic.Uwp.Enums
{
public enum MosaicTypeEnum
{
[Description("Classic")]
Classic,
[Description("Random")]
Random,
[Description("Adjust Hue")]
AdjustHue,
[Description("Plain Color")]
PlainColor
}
}
13 changes: 13 additions & 0 deletions Yugen.Mosaic.Uwp/Enums/OnboardingStage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Yugen.Mosaic.Uwp.Enums
{
public enum OnboardingStage
{
MasterImage,
AddTiles,
TileProperties,
MosaicType,
OutputProperties,
Generate,
Save
}
}
33 changes: 33 additions & 0 deletions Yugen.Mosaic.Uwp/Extensions/EnumExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.ComponentModel;
using System.Reflection;

namespace Yugen.Mosaic.Uwp.Extensions
{
public static class EnumExtensions
{
public static string GetStringRepresentation(this Enum en)
{
if (en == null)
{
return null;
}

Type type = en.GetType();

MemberInfo[] memInfo = type.GetMember(en.ToString());

if (memInfo != null && memInfo.Length > 0)
{
var attrs = memInfo[0].GetCustomAttributes(typeof(DescriptionAttribute), false);

if (attrs != null && attrs.Length > 0)
{
return ((DescriptionAttribute)attrs[0]).Description;
}
}

return en.ToString();
}
}
}
9 changes: 0 additions & 9 deletions Yugen.Mosaic.Uwp/Extensions/FileFormatExtensions.cs

This file was deleted.

Loading