diff --git a/.gitignore b/.gitignore index a788580..3c4efe2 100644 --- a/.gitignore +++ b/.gitignore @@ -258,7 +258,4 @@ paket-files/ # Python Tools for Visual Studio (PTVS) __pycache__/ -*.pyc - -# Ammy auto-generated XAML -*.g.xaml \ No newline at end of file +*.pyc \ No newline at end of file diff --git a/DiscordChatExporter.Gui/App.ammy b/DiscordChatExporter.Gui/App.ammy deleted file mode 100644 index c279ece..0000000 --- a/DiscordChatExporter.Gui/App.ammy +++ /dev/null @@ -1,69 +0,0 @@ -Application "DiscordChatExporter.Gui.App" { - StartupUri: "Views/MainWindow.g.xaml" - Startup: App_Startup - Exit: App_Exit - - Resources: ResourceDictionary { - // Material Design - #MergeDictionary("pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml") - #MergeDictionary("pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml") - - // Colors - Color Key="PrimaryColor" { "#343838" } - Color Key="PrimaryLightColor" { "#5E6262" } - Color Key="PrimaryDarkColor" { "#0D1212" } - Color Key="AccentColor" { "#F9A825" } - Color Key="TextColor" { "#000000" } - Color Key="InverseTextColor" { "#FFFFFF" } - - // Brushes - SolidColorBrush Key="PrimaryHueLightBrush" { Color: resource dyn "PrimaryLightColor" } - SolidColorBrush Key="PrimaryHueLightForegroundBrush" { Color: resource dyn "InverseTextColor" } - SolidColorBrush Key="PrimaryHueMidBrush" { Color: resource dyn "PrimaryColor" } - SolidColorBrush Key="PrimaryHueMidForegroundBrush" { Color: resource dyn "InverseTextColor" } - SolidColorBrush Key="PrimaryHueDarkBrush" { Color: resource dyn "PrimaryDarkColor" } - SolidColorBrush Key="PrimaryHueDarkForegroundBrush" { Color: resource dyn "InverseTextColor" } - SolidColorBrush Key="SecondaryAccentBrush" { Color: resource dyn "AccentColor" } - SolidColorBrush Key="SecondaryAccentForegroundBrush" { Color: resource dyn "TextColor" } - SolidColorBrush Key="PrimaryTextBrush" { Color: resource dyn "TextColor", Opacity: 0.87 } - SolidColorBrush Key="SecondaryTextBrush" { Color: resource dyn "TextColor", Opacity: 0.64 } - SolidColorBrush Key="DimTextBrush" { Color: resource dyn "TextColor", Opacity: 0.45 } - SolidColorBrush Key="PrimaryInverseTextBrush" { Color: resource dyn "InverseTextColor", Opacity: 1 } - SolidColorBrush Key="SecondaryInverseTextBrush" { Color: resource dyn "InverseTextColor", Opacity: 0.7 } - SolidColorBrush Key="DimInverseTextBrush" { Color: resource dyn "InverseTextColor", Opacity: 0.52 } - SolidColorBrush Key="AccentTextBrush" { Color: resource dyn "AccentColor", Opacity: 1 } - SolidColorBrush Key="DividerBrush" { Color: resource dyn "TextColor", Opacity: 0.12 } - SolidColorBrush Key="InverseDividerBrush" { Color: resource dyn "InverseTextColor", Opacity: 0.12 } - - // Styles - Style { - TargetType: "Image" - #Setter("RenderOptions.BitmapScalingMode", "HighQuality") - } - - Style { - TargetType: "ProgressBar" - BasedOn: resource "MaterialDesignLinearProgressBar" - #Setter("Foreground", resource dyn "SecondaryAccentBrush") - #Setter("Height", 2) - #Setter("Minimum", 0) - #Setter("Maximum", 1) - #Setter("BorderThickness", 0) - } - - Style { - TargetType: "TextBox" - BasedOn: resource "MaterialDesignTextBox" - #Setter("Foreground", resource dyn "PrimaryTextBrush") - } - - Style { - TargetType: "ComboBox" - BasedOn: resource "MaterialDesignComboBox" - #Setter("Foreground", resource dyn "PrimaryTextBrush") - } - - // Container - Container Key="Container" { } - } -} \ No newline at end of file diff --git a/DiscordChatExporter.Gui/App.xaml b/DiscordChatExporter.Gui/App.xaml new file mode 100644 index 0000000..a4aa02d --- /dev/null +++ b/DiscordChatExporter.Gui/App.xaml @@ -0,0 +1,106 @@ + + + + + + + + + + + #343838 + #5E6262 + #0D1212 + #F9A825 + #C17900 + #000000 + #FFFFFF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DiscordChatExporter.Gui/App.ammy.cs b/DiscordChatExporter.Gui/App.xaml.cs similarity index 100% rename from DiscordChatExporter.Gui/App.ammy.cs rename to DiscordChatExporter.Gui/App.xaml.cs diff --git a/DiscordChatExporter.Gui/Converters/ExportFormatToStringConverter.cs b/DiscordChatExporter.Gui/Converters/ExportFormatToStringConverter.cs new file mode 100644 index 0000000..45d2e44 --- /dev/null +++ b/DiscordChatExporter.Gui/Converters/ExportFormatToStringConverter.cs @@ -0,0 +1,22 @@ +using System; +using System.Globalization; +using System.Windows.Data; +using DiscordChatExporter.Core.Models; + +namespace DiscordChatExporter.Gui.Converters +{ + [ValueConversion(typeof(ExportFormat), typeof(string))] + public class ExportFormatToStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + var format = (ExportFormat) value; + return format.GetDisplayName(); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj b/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj index 5944064..21f87a5 100644 --- a/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj +++ b/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj @@ -42,9 +42,6 @@ - - ..\packages\Ammy.WPF.1.2.94\lib\net40\AmmySidekick.dll - ..\packages\CommonServiceLocator.2.0.3\lib\net45\CommonServiceLocator.dll @@ -75,11 +72,18 @@ ..\packages\Tyrrrz.Extensions.1.5.0\lib\net45\Tyrrrz.Extensions.dll + + ..\packages\Tyrrrz.WpfExtensions.1.0.5\lib\net45\Tyrrrz.WpfExtensions.dll + + + App.xaml + + @@ -88,50 +92,18 @@ - - ErrorDialog.ammy - - - ExportSetupDialog.ammy - - - SettingsDialog.ammy - - - Designer - XamlIntelliSenseFileGenerator - App.ammy - - - Designer - MSBuild:Compile - ErrorDialog.ammy - - - Designer - MSBuild:Compile - ExportSetupDialog.ammy - - - Designer - MSBuild:Compile - MainWindow.ammy - - - App.ammy - - - - MainWindow.ammy + + ExportSetupDialog.xaml + + + MainWindow.xaml + + + SettingsDialog.xaml - - Designer - MSBuild:Compile - SettingsDialog.ammy - @@ -146,16 +118,10 @@ ResXFileCodeGenerator Resources.Designer.cs - - Designer - - - - @@ -166,12 +132,24 @@ DiscordChatExporter.Core + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - \ No newline at end of file diff --git a/DiscordChatExporter.Gui/Program.cs b/DiscordChatExporter.Gui/Program.cs deleted file mode 100644 index 8cd4a46..0000000 --- a/DiscordChatExporter.Gui/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using AmmySidekick; - -namespace DiscordChatExporter.Gui -{ - public static class Program - { - [STAThread] - public static void Main() - { - var app = new App(); - app.InitializeComponent(); - RuntimeUpdateHandler.Register(app, $"/{Ammy.GetAssemblyName(app)};component/App.g.xaml"); - app.Run(); - } - } -} \ No newline at end of file diff --git a/DiscordChatExporter.Gui/Views/ErrorDialog.ammy b/DiscordChatExporter.Gui/Views/ErrorDialog.ammy deleted file mode 100644 index 526c954..0000000 --- a/DiscordChatExporter.Gui/Views/ErrorDialog.ammy +++ /dev/null @@ -1,27 +0,0 @@ -using MaterialDesignThemes.Wpf - -UserControl "DiscordChatExporter.Gui.Views.ErrorDialog" { - DataContext: bind ErrorViewModel from $resource Container - Width: 250 - - StackPanel { - // Message - TextBlock { - Margin: 16 - FontSize: 16 - TextWrapping: WrapWithOverflow - Text: bind Message - } - - // OK - Button { - Margin: 8 - Command: DialogHost.CloseDialogCommand - Content: "OK" - HorizontalAlignment: Right - IsDefault: true - IsCancel: true - Style: resource dyn "MaterialDesignFlatButton" - } - } -} \ No newline at end of file diff --git a/DiscordChatExporter.Gui/Views/ErrorDialog.ammy.cs b/DiscordChatExporter.Gui/Views/ErrorDialog.ammy.cs deleted file mode 100644 index a21413e..0000000 --- a/DiscordChatExporter.Gui/Views/ErrorDialog.ammy.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace DiscordChatExporter.Gui.Views -{ - public partial class ErrorDialog - { - public ErrorDialog() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/DiscordChatExporter.Gui/Views/ExportSetupDialog.ammy b/DiscordChatExporter.Gui/Views/ExportSetupDialog.ammy deleted file mode 100644 index 1a93328..0000000 --- a/DiscordChatExporter.Gui/Views/ExportSetupDialog.ammy +++ /dev/null @@ -1,89 +0,0 @@ -using DiscordChatExporter.Core.Models -using MaterialDesignThemes.Wpf - -UserControl "DiscordChatExporter.Gui.Views.ExportSetupDialog" { - DataContext: bind ExportSetupViewModel from $resource Container - Width: 325 - - StackPanel { - // File path - TextBox { - Margin: [16, 16, 16, 8] - HintAssist.Hint: "Output file" - HintAssist.IsFloating: true - IsReadOnly: true - Text: bind FilePath - set [ UpdateSourceTrigger: PropertyChanged ] - } - - // Format - ComboBox { - Margin: [16, 8, 16, 8] - HintAssist.Hint: "Export format" - HintAssist.IsFloating: true - IsReadOnly: true - ItemsSource: bind AvailableFormats - SelectedItem: bind SelectedFormat - - ItemTemplate: DataTemplate { - TextBlock { - Text: bind - convert (ExportFormat f) => Extensions.GetDisplayName(f) - } - } - } - - // Date range - Grid { - #TwoColumns("*", "*") - - DatePicker { - #Cell(0, 0) - Margin: [16, 20, 8, 8] - HintAssist.Hint: "From (optional)" - HintAssist.IsFloating: true - SelectedDate: bind From - } - - DatePicker { - #Cell(0, 1) - Margin: [8, 20, 16, 8] - HintAssist.Hint: "To (optional)" - HintAssist.IsFloating: true - SelectedDate: bind To - } - } - - // Buttons - @StackPanelHorizontal { - HorizontalAlignment: Right - - // Browse - Button "BrowseButton" { - Margin: 8 - Click: BrowseButton_Click - Content: "BROWSE" - Style: resource dyn "MaterialDesignFlatButton" - } - - // Export - Button "ExportButton" { - Margin: 8 - Click: ExportButton_Click - Command: bind ExportCommand - Content: "EXPORT" - IsDefault: true - Style: resource dyn "MaterialDesignFlatButton" - } - - // Cancel - Button { - Margin: 8 - Command: DialogHost.CloseDialogCommand - Content: "CANCEL" - IsCancel: true - Style: resource dyn "MaterialDesignFlatButton" - } - } - } -} \ No newline at end of file diff --git a/DiscordChatExporter.Gui/Views/ExportSetupDialog.xaml b/DiscordChatExporter.Gui/Views/ExportSetupDialog.xaml new file mode 100644 index 0000000..5fb759c --- /dev/null +++ b/DiscordChatExporter.Gui/Views/ExportSetupDialog.xaml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +