-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error handling and reformat XAML for clarity
- Added `using System.IO;` to `SpotifyWebClient.cs`. - Enhanced `JsonException` handling in `SpotifyWebClient.cs` to write response content to `data.json` if it does not exist. - Reformatted `HistoryWindow.xaml` for better readability: - Adjusted indentation and line breaks. - Changed the order of attributes. - Ensured attributes are on separate lines. - Replaced `PackIconFontAwesome` with `PackIconMaterial` for the refresh button. - Made minor adjustments to `DataGrid` and `ListBox` elements.
- Loading branch information
Showing
2 changed files
with
84 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,106 @@ | ||
<controls:MetroWindow x:Class="Songify_Slim.Views.HistoryWindow" | ||
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:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" | ||
mc:Ignorable="d" | ||
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" | ||
xmlns:properties="clr-namespace:Songify_Slim.Properties" | ||
|
||
Title="{x:Static properties:Resources.WinTitle_History}" Height="247.9" Width="588" Loaded="MetroWindow_Loaded" | ||
WindowStartupLocation="CenterOwner" Closed="MetroWindow_Closed"> | ||
<controls:MetroWindow | ||
x:Class="Songify_Slim.Views.HistoryWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:properties="clr-namespace:Songify_Slim.Properties" | ||
Title="{x:Static properties:Resources.WinTitle_History}" | ||
Width="588" | ||
Height="247.9" | ||
Closed="MetroWindow_Closed" | ||
Loaded="MetroWindow_Loaded" | ||
WindowStartupLocation="CenterOwner" | ||
mc:Ignorable="d"> | ||
|
||
<controls:MetroWindow.RightWindowCommands> | ||
<controls:WindowCommands> | ||
<ToggleButton x:Name="Tglbtn_Save" Checked="Tglbtn_Save_Checked" Unchecked="Tglbtn_Save_Checked" /> | ||
<ToggleButton x:Name="Tglbtn_Upload" Checked="Tglbtn_Upload_Checked" Unchecked="Tglbtn_Upload_Checked" /> | ||
<Button x:Name="Btn_CpyHistoryURL" Click="Btn_CpyHistoryURL_Click" ToolTip="Copy the history URL."> | ||
<ToggleButton | ||
x:Name="Tglbtn_Save" | ||
Checked="Tglbtn_Save_Checked" | ||
Unchecked="Tglbtn_Save_Checked" /> | ||
<ToggleButton | ||
x:Name="Tglbtn_Upload" | ||
Checked="Tglbtn_Upload_Checked" | ||
Unchecked="Tglbtn_Upload_Checked" /> | ||
<Button | ||
x:Name="Btn_CpyHistoryURL" | ||
Click="Btn_CpyHistoryURL_Click" | ||
ToolTip="Copy the history URL."> | ||
<StackPanel Orientation="Horizontal"> | ||
<iconPacks:PackIconMaterial Kind="Link" VerticalAlignment="Center" HorizontalAlignment="Center" /> | ||
<iconPacks:PackIconMaterial | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Kind="Link" /> | ||
</StackPanel> | ||
</Button> | ||
<Button x:Name="BtnRefresh" Click="BtnRefresh_Click"> | ||
<iconPacks:PackIconFontAwesome Width="15" Height="15" Kind="SyncAltSolid" /> | ||
<iconPacks:PackIconMaterial | ||
Width="15" | ||
Height="15" | ||
Kind="Refresh" /> | ||
</Button> | ||
</controls:WindowCommands> | ||
</controls:MetroWindow.RightWindowCommands> | ||
|
||
<Grid> | ||
<DataGrid x:Name="dgvHistorySongs" Margin="148,10,10,19" SelectionMode="Single" CanUserReorderColumns="False" | ||
CanUserResizeColumns="False" CanUserSortColumns="False"> | ||
<DataGrid | ||
x:Name="dgvHistorySongs" | ||
Margin="148,10,10,19" | ||
CanUserReorderColumns="False" | ||
CanUserResizeColumns="False" | ||
CanUserSortColumns="False" | ||
SelectionMode="Single"> | ||
<DataGrid.ContextMenu> | ||
<ContextMenu> | ||
<MenuItem Header="Delete" Click="DgvItemDelete_Click" /> | ||
<MenuItem Click="DgvItemDelete_Click" Header="Delete" /> | ||
</ContextMenu> | ||
</DataGrid.ContextMenu> | ||
<DataGrid.Columns> | ||
<DataGridTextColumn Header="{x:Static properties:Resources.s_Time}" IsReadOnly="True" Binding="{Binding Path=Time}" /> | ||
<DataGridTextColumn Header="{x:Static properties:Resources.s_Name}" IsReadOnly="True" Binding="{Binding Path=Name}" Width="*" /> | ||
<DataGridTextColumn | ||
Binding="{Binding Path=Time}" | ||
Header="{x:Static properties:Resources.s_Time}" | ||
IsReadOnly="True" /> | ||
<DataGridTextColumn | ||
Width="*" | ||
Binding="{Binding Path=Name}" | ||
Header="{x:Static properties:Resources.s_Name}" | ||
IsReadOnly="True" /> | ||
</DataGrid.Columns> | ||
</DataGrid> | ||
|
||
<ListBox x:Name="LbxHistory" HorizontalAlignment="Left" Width="133" Margin="10,10,0,19" | ||
SelectionChanged="LbxHistory_SelectionChanged"> | ||
<ListBox | ||
x:Name="LbxHistory" | ||
Width="133" | ||
Margin="10,10,0,19" | ||
HorizontalAlignment="Left" | ||
SelectionChanged="LbxHistory_SelectionChanged"> | ||
<ListBox.ContextMenu> | ||
<ContextMenu> | ||
<MenuItem Header="Delete" Click="MenuItemDelete_Click" /> | ||
<MenuItem Click="MenuItemDelete_Click" Header="Delete" /> | ||
</ContextMenu> | ||
</ListBox.ContextMenu> | ||
</ListBox> | ||
<StatusBar Height="14" VerticalAlignment="Bottom" Padding="0" ScrollViewer.CanContentScroll="True" Margin="0" | ||
UseLayoutRounding="False"> | ||
<Label x:Name="Lbl_Status" FontSize="10" Padding="0" VerticalContentAlignment="Bottom" | ||
HorizontalContentAlignment="Stretch" Width="340" HorizontalAlignment="Left" Margin="0,-4" | ||
VerticalAlignment="Top" Foreground="{DynamicResource MahApps.Brushes.IdealForeground}"/> | ||
<StatusBar | ||
Height="14" | ||
Margin="0" | ||
Padding="0" | ||
VerticalAlignment="Bottom" | ||
ScrollViewer.CanContentScroll="True" | ||
UseLayoutRounding="False"> | ||
<Label | ||
x:Name="Lbl_Status" | ||
Width="340" | ||
Margin="0,-4" | ||
Padding="0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
HorizontalContentAlignment="Stretch" | ||
VerticalContentAlignment="Bottom" | ||
FontSize="10" | ||
Foreground="{DynamicResource MahApps.Brushes.IdealForeground}" /> | ||
</StatusBar> | ||
</Grid> | ||
</controls:MetroWindow> |