Added EF and DB to the core, crude demo in the UI
This commit is contained in:
@@ -6,9 +6,23 @@
|
||||
xmlns:local="using:WinWARP.Ui.Views"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:m="using:WinWARP.Core.Models.Entities"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Button Grid.Row="0" Command="{x:Bind ViewModel.AddSubscriptionCommand}" Content="Add Subscription" />
|
||||
<TextBox Grid.Row="1" Text="{x:Bind ViewModel.NewSubscriptionLink, Mode=TwoWay}" />
|
||||
<ListBox Grid.Row="2" ItemsSource="{x:Bind ViewModel.Subscriptions}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="m:Subscription">
|
||||
<TextBlock Text="{x:Bind Link}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
@@ -12,6 +13,7 @@ using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using WinWARP.Core.ViewModels;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
@@ -22,8 +24,14 @@ namespace WinWARP.Ui.Views;
|
||||
/// </summary>
|
||||
public sealed partial class SubsSettingsPage : Page
|
||||
{
|
||||
public SubsSettingsViewModel ViewModel { get; }
|
||||
|
||||
public SubsSettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
ViewModel = App.Services.GetRequiredService<SubsSettingsViewModel>();
|
||||
DataContext = ViewModel;
|
||||
ViewModel.LoadSubscriptionsAsync().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user