diff --git a/Qwilight/System/DB.cs b/Qwilight/System/DB.cs index 1b4f07c..240bdb7 100644 --- a/Qwilight/System/DB.cs +++ b/Qwilight/System/DB.cs @@ -898,13 +898,13 @@ dbStatement.Parameters.AddWithValue("noteID", noteFile.GetNoteID512()); dbStatement.ExecuteNonQuery(); } - using (var dbStatement = NewDBStatement(""" - REPLACE - INTO favorite_entry - VALUES(@noteID, @favoriteEntry) - """, ta)) + foreach (var favoriteEntryItem in noteFile.FavoriteEntryItems) { - foreach (var favoriteEntryItem in noteFile.FavoriteEntryItems) + using (var dbStatement = NewDBStatement(""" + REPLACE + INTO favorite_entry + VALUES(@noteID, @favoriteEntry) + """, ta)) { dbStatement.Parameters.AddWithValue("noteID", noteFile.GetNoteID512()); dbStatement.Parameters.AddWithValue("favoriteEntry", favoriteEntryItem.DefaultEntryPath); diff --git a/Qwilight/View/Assets/Assets.xaml b/Qwilight/View/Assets/Assets.xaml index 8ece400..04ea3d7 100644 --- a/Qwilight/View/Assets/Assets.xaml +++ b/Qwilight/View/Assets/Assets.xaml @@ -126,9 +126,6 @@ 10 11 12 - - 0 - 1 0 1 diff --git a/Qwilight/View/FavoriteEntryWindow.xaml b/Qwilight/View/FavoriteEntryWindow.xaml index b624542..af991dd 100644 --- a/Qwilight/View/FavoriteEntryWindow.xaml +++ b/Qwilight/View/FavoriteEntryWindow.xaml @@ -20,7 +20,7 @@ - + diff --git a/Qwilight/ViewModel/FavoriteEntryViewModel.cs b/Qwilight/ViewModel/FavoriteEntryViewModel.cs index 7182dc8..a81a920 100644 --- a/Qwilight/ViewModel/FavoriteEntryViewModel.cs +++ b/Qwilight/ViewModel/FavoriteEntryViewModel.cs @@ -18,12 +18,24 @@ public override VerticalAlignment HeightSystem => VerticalAlignment.Bottom; int _mode; + EntryItem _entryItem; public ObservableCollection FavoriteEntryItemCollection { get; } = new(); public BaseNoteFile NoteFile { get; set; } - public EntryItem EntryItem { get; set; } + public EntryItem EntryItem + { + get => _entryItem; + + set + { + if (SetProperty(ref _entryItem, value)) + { + OnPropertyChanged(nameof(Is3State)); + } + } + } public int Mode { @@ -32,6 +44,8 @@ set => SetProperty(ref _mode, value, nameof(Mode)); } + public bool Is3State => EntryItem.WellNoteFiles.Count > 1; + public override void OnOpened() { base.OnOpened();