diff --git a/.gitignore b/.gitignore
index a7885808..3c4efe20 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 c279ece3..00000000
--- 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 00000000..a4aa02d0
--- /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 00000000..45d2e442
--- /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 5944064e..21f87a51 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 8cd4a463..00000000
--- 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 526c9548..00000000
--- 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 a21413e5..00000000
--- 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 1a93328c..00000000
--- 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 00000000..5fb759c1
--- /dev/null
+++ b/DiscordChatExporter.Gui/Views/ExportSetupDialog.xaml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DiscordChatExporter.Gui/Views/ExportSetupDialog.ammy.cs b/DiscordChatExporter.Gui/Views/ExportSetupDialog.xaml.cs
similarity index 98%
rename from DiscordChatExporter.Gui/Views/ExportSetupDialog.ammy.cs
rename to DiscordChatExporter.Gui/Views/ExportSetupDialog.xaml.cs
index 8b72f725..0cdad320 100644
--- a/DiscordChatExporter.Gui/Views/ExportSetupDialog.ammy.cs
+++ b/DiscordChatExporter.Gui/Views/ExportSetupDialog.xaml.cs
@@ -8,7 +8,7 @@ namespace DiscordChatExporter.Gui.Views
{
public partial class ExportSetupDialog
{
- private IExportSetupViewModel ViewModel => (IExportSetupViewModel) DataContext;
+ private IExportSetupViewModel ViewModel => (IExportSetupViewModel)DataContext;
public ExportSetupDialog()
{
diff --git a/DiscordChatExporter.Gui/Views/MainWindow.ammy b/DiscordChatExporter.Gui/Views/MainWindow.ammy
deleted file mode 100644
index 31620534..00000000
--- a/DiscordChatExporter.Gui/Views/MainWindow.ammy
+++ /dev/null
@@ -1,290 +0,0 @@
-using System.Windows.Interactivity;
-using MaterialDesignThemes.Wpf
-using MaterialDesignThemes.Wpf.Transitions
-
-Window "DiscordChatExporter.Gui.Views.MainWindow" {
- Title: "DiscordChatExporter"
- Width: 600
- Height: 550
- Background: resource dyn "MaterialDesignPaper"
- DataContext: bind MainViewModel from $resource Container
- FocusManager.FocusedElement: bind from "TokenTextBox"
- FontFamily: resource dyn "MaterialDesignFont"
- Icon: "/DiscordChatExporter;component/favicon.ico"
- SnapsToDevicePixels: true
- TextElement.FontSize: 13
- TextElement.FontWeight: Regular
- TextElement.Foreground: resource dyn "SecondaryTextBrush"
- TextOptions.TextFormattingMode: Ideal
- TextOptions.TextRenderingMode: Auto
- UseLayoutRounding: true
- WindowStartupLocation: CenterScreen
-
- Interaction.Triggers: [
- Interactivity.EventTrigger {
- EventName: "Loaded"
- InvokeCommandAction { Command: bind ViewLoadedCommand }
- },
- Interactivity.EventTrigger {
- EventName: "Closed"
- InvokeCommandAction { Command: bind ViewClosedCommand }
- }
- ]
-
- DialogHost {
- SnackbarMessageQueue: bind MessageQueue from "Snackbar"
-
- DockPanel {
- // Toolbar
- Border {
- DockPanel.Dock: Top
- Background: resource dyn "PrimaryHueMidBrush"
- IsEnabled: bind IsBusy
- convert (bool b) => b ? false : true
- TextElement.Foreground: resource dyn "SecondaryInverseTextBrush"
- StackPanel {
- Grid {
- #TwoColumns("*", "Auto")
-
- Card {
- #Cell(0, 0)
- Margin: [6, 6, 0, 6]
-
- Grid {
- #TwoColumns("*", "Auto")
-
- // Token
- TextBox "TokenTextBox" {
- #Cell(0, 0)
- Margin: 6
- BorderThickness: 0
- HintAssist.Hint: "Token"
- FontSize: 16
- Text: bind Token
- set [ UpdateSourceTrigger: PropertyChanged ]
- TextFieldAssist.DecorationVisibility: Hidden
- TextFieldAssist.TextBoxViewMargin: [0, 0, 2, 0]
- }
-
- // Submit
- Button {
- #Cell(0, 1)
- Margin: [0, 6, 6, 6]
- Padding: 4
- Command: bind PullDataCommand
- IsDefault: true
- Style: resource dyn "MaterialDesignFlatButton"
-
- PackIcon {
- Width: 24
- Height: 24
- Kind: PackIconKind.ArrowRight
- }
- }
- }
- }
-
- // Popup menu
- PopupBox {
- #Cell(0, 1)
- Foreground: resource dyn "PrimaryHueMidForegroundBrush"
- PlacementMode: LeftAndAlignTopEdges
-
- StackPanel {
- Button {
- Command: bind ShowSettingsCommand
- Content: "Settings"
- }
- Button {
- Command: bind ShowAboutCommand
- Content: "About"
- }
- }
- }
- }
-
- // Progress
- ProgressBar {
- Background: Transparent
- IsIndeterminate: true
- Visibility: bind IsBusy
- convert (bool b) => b ? Visibility.Visible : Visibility.Hidden
- }
- }
- }
-
- // Content
- Grid {
- DockPanel {
- Background: resource dyn "MaterialDesignCardBackground"
- IsEnabled: bind IsBusy
- convert (bool b) => b ? false : true
- Visibility: bind IsDataAvailable
- convert (bool b) => b ? Visibility.Visible : Visibility.Hidden
-
- // Guilds
- Border {
- DockPanel.Dock: Left
- BorderBrush: resource dyn "DividerBrush"
- BorderThickness: "0 0 1 0"
-
- ListBox {
- ItemsSource: bind AvailableGuilds
- ScrollViewer.VerticalScrollBarVisibility: Hidden
- SelectedItem: bind SelectedGuild
- VirtualizingStackPanel.IsVirtualizing: false
-
- ItemTemplate: DataTemplate {
- TransitioningContent {
- OpeningEffect: TransitionEffect {
- Duration: "0:0:0.3"
- Kind: SlideInFromLeft
- }
-
- Border {
- Margin: -8
- Background: Transparent
- Cursor: CursorType.Hand
-
- Image {
- Margin: [12, 4, 12, 4]
- Width: 48
- Height: 48
- Source: bind IconUrl
- ToolTip: bind Name
- OpacityMask: RadialGradientBrush {
- GradientStops: [
- GradientStop { Color: "#FF000000", Offset: 0 }
- GradientStop { Color: "#FF000000", Offset: 0.96 }
- GradientStop { Color: "#00000000", Offset: 1 }
- ]
- }
- }
- }
- }
- }
- }
- }
-
- // Channels
- Border {
- ListBox {
- ItemsSource: bind AvailableChannels
- HorizontalContentAlignment: Stretch
- VirtualizingStackPanel.IsVirtualizing: false
-
- ItemTemplate: DataTemplate {
- TransitioningContent {
- OpeningEffect: TransitionEffect {
- Duration: "0:0:0.3"
- Kind: SlideInFromLeft
- }
-
- @StackPanelHorizontal {
- Margin: -8
- Background: Transparent
- Cursor: CursorType.Hand
- InputBindings: [
- MouseBinding {
- Command: bind DataContext.ShowExportSetupCommand from $ancestor
- CommandParameter: bind
- MouseAction: LeftClick
- }
- ]
-
- PackIcon {
- Margin: [16, 7, 0, 6]
- Kind: PackIconKind.Pound
- VerticalAlignment: Center
- }
- TextBlock {
- Margin: [3, 8, 8, 8]
- FontSize: 14
- Text: bind Name
- VerticalAlignment: Center
- }
- }
- }
- }
- }
- }
- }
-
- // Content placeholder
- StackPanel {
- Margin: [32, 32, 8, 8]
- Visibility: bind IsDataAvailable
- convert (bool b) => b ? Visibility.Hidden : Visibility.Visible
-
- TextBlock {
- FontSize: 18
- Text: "DiscordChatExporter needs your authorization token to work."
- }
-
- TextBlock {
- Margin: [0, 8, 0, 0]
- FontSize: 16
- Text: "To obtain it, follow these steps:"
- }
-
- TextBlock {
- Margin: [8, 0, 0, 0]
- FontSize: 14
-
- Run {
- Text: "1. Open the Discord app"
- }
- LineBreak { }
- Run {
- Text: "2. Log in if you haven't"
- }
- LineBreak { }
- Run {
- Text: "3. Press"
- }
- Run {
- Text: "Ctrl+Shift+I"
- Foreground: resource dyn "PrimaryTextBrush"
- }
- LineBreak { }
- Run {
- Text: "4. Navigate to"
- }
- Run {
- Text: "Application"
- Foreground: resource dyn "PrimaryTextBrush"
- }
- Run { Text: "tab" }
- LineBreak { }
- Run {
- Text: "5. Expand"
- }
- Run {
- Text: "Storage > Local Storage > https://discordapp.com"
- Foreground: resource dyn "PrimaryTextBrush"
- }
- LineBreak { }
- Run {
- Text: "6. Find"
- }
- Run {
- Text: ""token""
- Foreground: resource dyn "PrimaryTextBrush"
- }
- Run {
- Text: "under key and copy the value"
- }
- LineBreak { }
- Run {
- Text: "7. Paste the value in the textbox above"
- }
- }
- }
-
- // Snackbar
- Snackbar "Snackbar" {
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/DiscordChatExporter.Gui/Views/MainWindow.xaml b/DiscordChatExporter.Gui/Views/MainWindow.xaml
new file mode 100644
index 00000000..63c07120
--- /dev/null
+++ b/DiscordChatExporter.Gui/Views/MainWindow.xaml
@@ -0,0 +1,229 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DiscordChatExporter.Gui/Views/MainWindow.ammy.cs b/DiscordChatExporter.Gui/Views/MainWindow.xaml.cs
similarity index 99%
rename from DiscordChatExporter.Gui/Views/MainWindow.ammy.cs
rename to DiscordChatExporter.Gui/Views/MainWindow.xaml.cs
index c51579de..e81c36b0 100644
--- a/DiscordChatExporter.Gui/Views/MainWindow.ammy.cs
+++ b/DiscordChatExporter.Gui/Views/MainWindow.xaml.cs
@@ -28,7 +28,7 @@ namespace DiscordChatExporter.Gui.Views
// Dialog messages
Messenger.Default.Register(this,
m => DialogHost.Show(new ExportSetupDialog()).Forget());
- Messenger.Default.Register(this,
+ Messenger.Default.Register(this,
m => DialogHost.Show(new SettingsDialog()).Forget());
}
}
diff --git a/DiscordChatExporter.Gui/Views/SettingsDialog.ammy b/DiscordChatExporter.Gui/Views/SettingsDialog.ammy
deleted file mode 100644
index 0107f7e2..00000000
--- a/DiscordChatExporter.Gui/Views/SettingsDialog.ammy
+++ /dev/null
@@ -1,52 +0,0 @@
-using MaterialDesignThemes.Wpf
-
-UserControl "DiscordChatExporter.Gui.Views.SettingsDialog" {
- DataContext: bind SettingsViewModel from $resource Container
- Width: 250
-
- StackPanel {
- // Date format
- TextBox {
- Margin: [16, 16, 16, 8]
- HintAssist.Hint: "Date format"
- HintAssist.IsFloating: true
- Text: bind DateFormat
- }
-
- // Group limit
- TextBox {
- Margin: [16, 8, 16, 8]
- HintAssist.Hint: "Message group limit"
- HintAssist.IsFloating: true
- Text: bind MessageGroupLimit
- }
-
- // Auto-update
- DockPanel {
- LastChildFill: false
-
- TextBlock {
- Margin: [16, 8, 16, 8]
- DockPanel.Dock: Left
- Text: "Auto-updates"
- }
-
- ToggleButton {
- Margin: [16, 8, 16, 8]
- DockPanel.Dock: Right
- IsChecked: bind IsAutoUpdateEnabled
- }
- }
-
- // Save
- Button {
- Margin: 8
- Command: DialogHost.CloseDialogCommand
- Content: "SAVE"
- HorizontalAlignment: Right
- IsDefault: true
- IsCancel: true
- Style: resource dyn "MaterialDesignFlatButton"
- }
- }
-}
\ No newline at end of file
diff --git a/DiscordChatExporter.Gui/Views/SettingsDialog.xaml b/DiscordChatExporter.Gui/Views/SettingsDialog.xaml
new file mode 100644
index 00000000..76f9f10d
--- /dev/null
+++ b/DiscordChatExporter.Gui/Views/SettingsDialog.xaml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DiscordChatExporter.Gui/Views/SettingsDialog.ammy.cs b/DiscordChatExporter.Gui/Views/SettingsDialog.xaml.cs
similarity index 100%
rename from DiscordChatExporter.Gui/Views/SettingsDialog.ammy.cs
rename to DiscordChatExporter.Gui/Views/SettingsDialog.xaml.cs
diff --git a/DiscordChatExporter.Gui/lib.ammy b/DiscordChatExporter.Gui/lib.ammy
deleted file mode 100644
index 2b5a8655..00000000
--- a/DiscordChatExporter.Gui/lib.ammy
+++ /dev/null
@@ -1,238 +0,0 @@
-mixin TwoColumns (one = "*", two = "*") for Grid {
- combine ColumnDefinitions: [
- ColumnDefinition { Width: $one }
- ColumnDefinition { Width: $two }
- ]
-}
-
-mixin ThreeColumns (one = none, two = none, three = none) for Grid {
- #TwoColumns($one, $two)
- combine ColumnDefinitions: ColumnDefinition { Width: $three }
-}
-
-mixin FourColumns (one = none, two = none, three = none, four = none) for Grid {
- #ThreeColumns($one, $two, $three)
- combine ColumnDefinitions: ColumnDefinition { Width: $four }
-}
-
-mixin FiveColumns (one = none, two = none, three = none, four = none, five = none) for Grid {
- #FourColumns($one, $two, $three, $four)
- combine ColumnDefinitions: ColumnDefinition { Width: $five }
-}
-
-mixin TwoRows (one = none, two = none) for Grid
-{
- combine RowDefinitions: [
- RowDefinition { Height: $one }
- RowDefinition { Height: $two }
- ]
-}
-
-mixin ThreeRows (one = none, two = none, three = none) for Grid
-{
- #TwoRows($one, $two)
- combine RowDefinitions: RowDefinition { Height: $three }
-}
-
-mixin FourRows (one = none, two = none, three = none, four = none) for Grid
-{
- #ThreeRows($one, $two, $three)
- combine RowDefinitions: RowDefinition { Height: $four }
-}
-
-mixin FiveRows (one = none, two = none, three = none, four = none, five = none) for Grid
-{
- #FourRows($one, $two, $three, $four)
- combine RowDefinitions: RowDefinition { Height: $five }
-}
-
-mixin Cell (row = none, column = none, rowSpan = none, columnSpan = none) for FrameworkElement {
- Grid.Row: $row
- Grid.Column: $column
- Grid.RowSpan: $rowSpan
- Grid.ColumnSpan: $columnSpan
-}
-
-alias ImageCached(source) {
- Image {
- Source: BitmapImage {
- UriCachePolicy: "Revalidate"
- UriSource: $source
- }
- }
-}
-
-mixin Setter(property, value, targetName=none) for Style {
- Setter { Property: $property, Value: $value, TargetName: $targetName }
-}
-
-/*
-mixin AddSetter(property, value, targetName=none) for Style {
- combine Setters: #Setter($property, $value, $targetName) {}
-}*/
-
-alias DataTrigger(binding, bindingValue) {
- DataTrigger { Binding: $binding, Value: $bindingValue }
-}
-
-alias Trigger(property, value) {
- Trigger { Property: $property, Value: $value }
-}
-
-alias EventTrigger(event, sourceName=none) {
- EventTrigger { RoutedEvent: $event, SourceName: $sourceName }
-}
-
-alias DataTrigger_SetProperty(binding, bindingValue, property, propertyValue) {
- @DataTrigger ($binding, $bindingValue) {
- #Setter($property, $propertyValue)
- }
-}
-
-alias Trigger_SetProperty(triggerProperty, triggerValue, property, propertyValue) {
- @Trigger ($triggerProperty, $triggerValue) {
- #Setter($property, $propertyValue)
- }
-}
-
-alias EventTrigger_SetProperty(event, property, propertyValue) {
- @EventTrigger ($event) {
- #Setter($property, $propertyValue)
- }
-}
-alias VisibleIf_DataTrigger(binding, valueForVisible) {
- @DataTrigger_SetProperty($binding, $valueForVisible, "Visibility", "Visible") {}
-}
-
-alias CollapsedIf_DataTrigger(binding, valueForCollapsed) {
- @DataTrigger_SetProperty($binding, $valueForCollapsed, "Visibility", "Collapsed") {}
-}
-
-alias StackPanelHorizontal() {
- StackPanel {
- Orientation: Horizontal
- }
-}
-
-alias GridItemsControl() {
- ItemsControl {
- ScrollViewer.HorizontalScrollBarVisibility: Disabled,
-
- ItemsPanel: ItemsPanelTemplate {
- WrapPanel {
- IsItemsHost: true
- Orientation: Horizontal
- }
- }
- }
-}
-
-////////////////
-// Animations //
-////////////////
-
-alias DoubleAnimation(property, frm = "0", to = "1", duration = "0:0:1", targetName=none, beginTime=none) {
- DoubleAnimation {
- Storyboard.TargetProperty: $property
- Storyboard.TargetName: $targetName
- From: $frm
- To: $to
- Duration: $duration
- BeginTime: $beginTime
- }
-}
-
-alias DoubleAnimationStoryboard (property, frm = "0", to = "1", duration = "0:0:1", targetName=none) {
- BeginStoryboard {
- Storyboard {
- @DoubleAnimation($property, $frm, $to, $duration, $targetName) {}
- }
- }
-}
-
-mixin DoubleAnimation_PropertyTrigger(triggerProperty, triggerValue, animationProperty, frm, to, duration) for Style {
- combine Triggers: @Trigger ($triggerProperty, $triggerValue) {
- EnterActions: @DoubleAnimationStoryboard($animationProperty, $frm, $to, $duration) {}
- }
-}
-
-mixin DoubleAnimation_PropertyTrigger_Toggle(triggerProperty, triggerValue, animationProperty, frm, to, duration) for Style {
- combine Triggers: @Trigger ($triggerProperty, $triggerValue) {
- EnterActions: @DoubleAnimationStoryboard($animationProperty, $frm, $to, $duration) {}
- ExitActions: @DoubleAnimationStoryboard($animationProperty, $to, $frm, $duration) {}
- }
-}
-
-mixin DoubleAnimation_EventTrigger(triggerEvent, animationProperty, frm, to, duration) for Style {
- combine Triggers: EventTrigger {
- RoutedEvent: $triggerEvent
- @DoubleAnimationStoryboard($animationProperty, $frm, $to, $duration) {}
- }
-}
-
-mixin DoubleAnimation_DataTrigger(binding, value, animationProperty, frm, to, duration) for Style {
- combine Triggers: DataTrigger {
- Binding: $binding
- Value: $value
- EnterActions: @DoubleAnimationStoryboard($animationProperty, $frm, $to, $duration) {}
- }
-}
-
-mixin FadeIn_OnProperty(property, value, frm = "0", to = "1", duration = "0:0:1") for Style {
- #DoubleAnimation_PropertyTrigger($property, $value, "Opacity", $frm, $to, $duration)
-}
-
-mixin FadeOut_OnProperty(property, value, frm = "1", to = "0", duration = "0:0:1") for Style {
- #DoubleAnimation_PropertyTrigger($property, $value, "Opacity", $frm, $to, $duration)
-}
-
-mixin FadeIn_OnEvent(event, frm = "0", to = "1", duration = "0:0:1") for Style {
- #DoubleAnimation_EventTrigger($event, "Opacity", $frm, $to, $duration)
-}
-
-mixin FadeOut_OnEvent(event, frm = "1", to = "0", duration = "0:0:1") for Style {
- #DoubleAnimation_EventTrigger($event, "Opacity", $frm, $to, $duration)
-}
-
-mixin FadeIn_OnData(binding, value, from_ = "0", to = "1", duration = "0:0:1") for Style {
- #DoubleAnimation_DataTrigger($binding, $value, "Opacity", $from_, $to, $duration)
-}
-
-mixin FadeOut_OnData(binding, value, from_ = "1", to = "0", duration = "0:0:1") for Style {
- #DoubleAnimation_DataTrigger($binding, $value, "Opacity", $from_, $to, $duration)
-}
-
-mixin Property_OnBinding(binding, bindingValue, property, propertyValue, initialValue) for Style {
- #Setter("Visibility", $initialValue)
- combine Triggers: [
- @DataTrigger_SetProperty($binding, $bindingValue, $property, $propertyValue) {}
- ]
-}
-
-mixin Visibility_OnBinding(binding, bindingValue, visibilityValue="Visible", initialValue="Collapsed") for Style {
- #Property_OnBinding($binding, $bindingValue, "Visibility", $visibilityValue, $initialValue)
-}
-
-mixin Fade_OnBinding(binding, bindingValue) for Style {
- #Setter("Visibility", "Visible")
- #Setter("Opacity", "0")
-
- combine Triggers: [
- @DataTrigger($binding, $bindingValue) {
- EnterActions: [
- @DoubleAnimationStoryboard("Opacity", 0, 1, "0:0:0.5") {}
- ]
- ExitActions: [
- @DoubleAnimationStoryboard("Opacity", 1, 0, "0:0:0.5") {}
- ]
- #Setter("Opacity", 1)
- }
- @Trigger("Opacity", 0) {
- #Setter("Visibility", "Hidden")
- }
- ]
-}
-
-mixin MergeDictionary (source) for ResourceDictionary {
- combine MergedDictionaries: ResourceDictionary { Source: $source }
-}
\ No newline at end of file
diff --git a/DiscordChatExporter.Gui/packages.config b/DiscordChatExporter.Gui/packages.config
index ffcabf45..ca0c226b 100644
--- a/DiscordChatExporter.Gui/packages.config
+++ b/DiscordChatExporter.Gui/packages.config
@@ -1,10 +1,9 @@
-
-
+
\ No newline at end of file