Idk, dev work goin on

This commit is contained in:
2026-09-09 16:19:45 +03:00 Unverified
parent b0d8bcd742
commit 17a0a9f7a6
318 changed files with 11908 additions and 81 deletions
+47
View File
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using WinWARP.Core.Enums;
using WinWARP.Core.Services.Interfaces;
using WinWARP.Ui.Helpers;
using WinWARP.Ui.Views.Dialogs;
namespace WinWARP.Ui.Services;
public class DialogService : IDialogService
{
private readonly XamlRootTracker _tracker;
public DialogService(XamlRootTracker tracker)
{
_tracker = tracker;
}
public async Task<(CommonDialogResult Result, string Title, string URL, int UpdateInterval)> ShowAddSubscriptionAsync()
{
var dialog = App.Services.GetRequiredService<AddSubscriptionDialog>();
//dialog.Title = "Add new subscription";
//dialog.PrimaryButtonText = "Add";
//dialog.CloseButtonText = "Cancel";
dialog.XamlRoot = _tracker.XamlRoot;
dialog.Style = Application.Current.Resources["DefaultContentDialogStyle"] as Style;
var result = await dialog.ShowAsync();
var mappedResult = result switch
{
ContentDialogResult.Primary => CommonDialogResult.Primary,
ContentDialogResult.Secondary => CommonDialogResult.Secondary,
ContentDialogResult.None => CommonDialogResult.Cancel,
_ => CommonDialogResult.None
};
return (mappedResult, dialog.ViewModel.CustomName, dialog.ViewModel.SubscriptionLink, dialog.ViewModel.UpdateInterval);
}
}