-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
102 additions
and
24 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
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,18 +1,59 @@ | ||
// To learn more about WinUI, the WinUI project structure, | ||
// and more about our project templates, see: http://aka.ms/winui-project-info. | ||
|
||
using CommunityToolkit.WinUI.UI; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Polymerium.App.Models; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Polymerium.App.Dialogs | ||
{ | ||
public sealed partial class AddLoaderDialog | ||
{ | ||
private AdvancedCollectionView Versions { get; } | ||
|
||
private string filter = string.Empty; | ||
|
||
|
||
|
||
public string SelectedVersion | ||
{ | ||
get { return (string)GetValue(SelectedVersionProperty); } | ||
set { SetValue(SelectedVersionProperty, value); } | ||
} | ||
|
||
// Using a DependencyProperty as the backing store for SelectedVersion. This enables animation, styling, binding, etc... | ||
public static readonly DependencyProperty SelectedVersionProperty = | ||
DependencyProperty.Register(nameof(SelectedVersion), typeof(string), typeof(AddLoaderDialog), new PropertyMetadata(string.Empty)); | ||
|
||
|
||
|
||
public AddLoaderDialog(XamlRoot root, string identity, IEnumerable<LoaderVersionModel> versions) | ||
{ | ||
XamlRoot = root; | ||
InitializeComponent(); | ||
|
||
Versions = new AdvancedCollectionView(versions.OrderByDescending(x => x.ReleasedAt).ToList()) { Filter = Filter }; | ||
} | ||
|
||
private bool Filter(object obj) | ||
{ | ||
if (obj is LoaderVersionModel model) | ||
{ | ||
return model.Version.Contains(filter); | ||
} | ||
return false; | ||
} | ||
|
||
private void VersionBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) | ||
{ | ||
if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) | ||
{ | ||
filter = VersionBox.Text; | ||
Versions.Refresh(); | ||
} | ||
} | ||
} | ||
} |
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,12 +1,9 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Trident.Abstractions.Resources; | ||
|
||
namespace Polymerium.App.Models | ||
{ | ||
public record LoaderVersionModel(string Identity, string Version, DateTimeOffset ReleasedAt,bool Highlighted = false) | ||
public record LoaderVersionModel(string Identity, string Version, DateTimeOffset ReleasedAt, ReleaseType Type, bool Highlighted = false) | ||
{ | ||
} | ||
} | ||
} |
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,14 +1,9 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Trident.Abstractions; | ||
using Trident.Abstractions; | ||
|
||
namespace Polymerium.App.Tasks; | ||
public class UpdateTask : TaskBase | ||
{ | ||
public UpdateTask(string key, Metadata metadata) : base(key, $"Updating {key}...", "Preparing") | ||
{ | ||
} | ||
} | ||
} |
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
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