mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2026-02-06 16:43:33 +00:00
Modifs
This commit is contained in:
parent
6e28f7804f
commit
b3754b77bc
2216 changed files with 6395 additions and 6211 deletions
|
|
@ -114,15 +114,6 @@
|
|||
<Compile Update="Views\Pickers\ItemView.xaml.cs">
|
||||
<DependentUpon>ItemView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Views\Library\ItemDetailPage.xaml.cs">
|
||||
<DependentUpon>ItemDetailPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Views\Library\FilteredItemsPage.xaml.cs">
|
||||
<DependentUpon>FilteredItemsPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Views\Library\ItemsPage.xaml.cs">
|
||||
<DependentUpon>ItemsPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Views\Library\MainTabbedPage.xaml.cs">
|
||||
<DependentUpon>MainTabbedPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
|
@ -220,4 +211,16 @@
|
|||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Views\Library\FilteredItemsPage.xaml.cs_">
|
||||
<DependentUpon>FilteredItemsPage.xaml_</DependentUpon>
|
||||
</None>
|
||||
<None Update="Views\Library\ItemDetailPage.xaml.cs_">
|
||||
<DependentUpon>ItemDetailPage.xaml_</DependentUpon>
|
||||
</None>
|
||||
<None Update="Views\Library\ItemsPage.xaml.cs_">
|
||||
<DependentUpon>ItemsPage.xaml_</DependentUpon>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -118,7 +118,14 @@ namespace AideDeJeu.Pdf
|
|||
{
|
||||
|
||||
}
|
||||
writer.Close();
|
||||
try
|
||||
{
|
||||
writer?.Close();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//stamper.Close();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace AideDeJeu.ViewModels.Library
|
||||
{
|
||||
public class ItemDetailViewModel : BaseViewModel
|
||||
public class ItemDetailViewModelOld : BaseViewModel
|
||||
{
|
||||
Item _Item = null;
|
||||
public Item Item
|
||||
|
|
@ -14,7 +14,7 @@ namespace AideDeJeu.ViewModels.Library
|
|||
}
|
||||
}
|
||||
|
||||
public ItemDetailViewModel(Item item = null)
|
||||
public ItemDetailViewModelOld(Item item = null)
|
||||
{
|
||||
Title = item?.Name;
|
||||
Item = item;
|
||||
|
|
@ -10,11 +10,11 @@ using Xamarin.Forms;
|
|||
|
||||
namespace AideDeJeu.ViewModels.Library
|
||||
{
|
||||
public class ItemsViewModel : BaseViewModel
|
||||
public class ItemsViewModelOld : BaseViewModel
|
||||
{
|
||||
CancellationTokenSource cancellationTokenSource;
|
||||
|
||||
public ItemsViewModel()
|
||||
public ItemsViewModelOld()
|
||||
{
|
||||
LoadItemsCommand = new Command(async () => await ExecuteLoadItemsCommandAsync().ConfigureAwait(false));
|
||||
SearchCommand = new Command<string>((text) =>
|
||||
|
|
@ -77,7 +77,8 @@ namespace AideDeJeu.ViewModels
|
|||
public async Task GotoLibraryPageAsync()
|
||||
{
|
||||
//await Navigation.PushAsync(new Views.ItemDetailPage(),true);
|
||||
await Navigation.PushAsync(new Views.Library.MainTabbedPage(), true);
|
||||
//await Navigation.PushAsync(new Views.Library.MainTabbedPage(), true);
|
||||
await Navigation.PushAsync(new Views.Library.ItemPage("index.md"), true);
|
||||
//TestNotify = new NotifyTaskCompletion<bool>(TestGotoAsync(), true);
|
||||
}
|
||||
|
||||
|
|
@ -154,15 +155,15 @@ namespace AideDeJeu.ViewModels
|
|||
var navigationPage = tabbedPage; //.MainNavigationPage;
|
||||
var lastPage = navigationPage.Navigation.NavigationStack.LastOrDefault();
|
||||
var context = lastPage.BindingContext;
|
||||
Item item = null;
|
||||
if (context is ItemDetailViewModel)
|
||||
{
|
||||
item = (context as ItemDetailViewModel).Item;
|
||||
}
|
||||
else if (context is ItemsViewModel)
|
||||
{
|
||||
item = (context as ItemsViewModel).AllItems;
|
||||
}
|
||||
Item item = (context as ItemViewModel)?.Item;
|
||||
//if (context is ItemDetailViewModel)
|
||||
//{
|
||||
// item = (context as ItemDetailViewModel).Item;
|
||||
//}
|
||||
//else if (context is ItemsViewModel)
|
||||
//{
|
||||
// item = (context as ItemsViewModel).AllItems;
|
||||
//}
|
||||
//await Application.Current.MainPage.DisplayAlert("Id", item.Id, "OK");
|
||||
var vm = Main.Bookmarks;
|
||||
var result = await Application.Current.MainPage.DisplayActionSheet("Ajouter à", "Annuler", "Nouvelle liste", vm.BookmarkCollectionNames.ToArray<string>());
|
||||
|
|
@ -185,9 +186,10 @@ namespace AideDeJeu.ViewModels
|
|||
if (item == null)
|
||||
return;
|
||||
|
||||
|
||||
var items = item as Item;
|
||||
var filterViewModel = items.GetNewFilterViewModel();
|
||||
var itemsViewModel = new ItemsViewModel() { AllItems = items, Filter = filterViewModel };
|
||||
var itemsViewModel = new ItemViewModel() { Item = item, AllItems = items, Filter = filterViewModel };
|
||||
itemsViewModel.LoadItemsCommand.Execute(null);
|
||||
|
||||
SwitchToMainTab();
|
||||
|
|
@ -212,20 +214,20 @@ namespace AideDeJeu.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
public async Task GotoItemsPageAsync(ItemsViewModel itemsVM)
|
||||
public async Task GotoItemsPageAsync(ItemViewModel itemsVM)
|
||||
{
|
||||
if (itemsVM == null)
|
||||
return;
|
||||
|
||||
await Navigation.PushAsync(new ItemsPage(itemsVM), true);
|
||||
await Navigation.PushAsync(new ItemPage(itemsVM), true);
|
||||
}
|
||||
|
||||
public async Task GotoFilteredItemsPageAsync(ItemsViewModel itemsVM)
|
||||
public async Task GotoFilteredItemsPageAsync(ItemViewModel itemsVM)
|
||||
{
|
||||
if (itemsVM == null)
|
||||
return;
|
||||
|
||||
await Navigation.PushAsync(new FilteredItemsPage(itemsVM), true);
|
||||
await Navigation.PushAsync(new ItemPage(itemsVM), true);
|
||||
}
|
||||
|
||||
private ICommand _NavigateToLinkCommand = null;
|
||||
|
|
@ -264,7 +266,7 @@ namespace AideDeJeu.ViewModels
|
|||
{
|
||||
var items = item; // as Items;
|
||||
var filterViewModel = items.GetNewFilterViewModel();
|
||||
var itemsViewModel = new ItemsViewModel() { AllItems = items, Filter = filterViewModel };
|
||||
var itemsViewModel = new ItemViewModel() { AllItems = items, Filter = filterViewModel };
|
||||
itemsViewModel.LoadItemsCommand.Execute(null);
|
||||
if (!string.IsNullOrEmpty(with))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -739,8 +739,8 @@ namespace AideDeJeu.ViewModels
|
|||
modelBuilder.Entity<ClassProficienciesItem>();
|
||||
modelBuilder.Entity<SkillItem>();
|
||||
|
||||
modelBuilder.Entity<Items>();
|
||||
modelBuilder.Entity<Item>();
|
||||
modelBuilder.Entity<Items>().HasIndex(i => new { i.Id, i.Name, i.AltNameText, i.NormalizedName, i.NormalizedAltName });
|
||||
modelBuilder.Entity<Item>().HasIndex(i => new { i.Id, i.Name, i.AltNameText, i.NormalizedName, i.NormalizedAltName });
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using Xamarin.Forms.Xaml;
|
|||
namespace AideDeJeu.Views.Library
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class FilteredItemsPage : MasterDetailPage
|
||||
public partial class FilteredItemsPageOld : MasterDetailPage
|
||||
{
|
||||
MainViewModel Main
|
||||
{
|
||||
|
|
@ -26,13 +26,13 @@ namespace AideDeJeu.Views.Library
|
|||
return _ItemsViewModel;
|
||||
}
|
||||
}
|
||||
public FilteredItemsPage (ItemsViewModel itemsViewModel)
|
||||
public FilteredItemsPageOld (ItemsViewModel itemsViewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = _ItemsViewModel = itemsViewModel;
|
||||
}
|
||||
public FilteredItemsPage()
|
||||
public FilteredItemsPageOld()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:AideDeJeu.Views"
|
||||
xmlns:tools="clr-namespace:AideDeJeu.Tools"
|
||||
x:Class="AideDeJeu.Views.Library.FilteredItemsPage"
|
||||
x:Class="AideDeJeu.Views.Library.FilteredItemsPageOld"
|
||||
x:Name="This"
|
||||
Title="{Binding Title}">
|
||||
<MasterDetailPage.Resources>
|
||||
|
|
@ -12,7 +12,7 @@ using Xamarin.Forms.Xaml;
|
|||
namespace AideDeJeu.Views.Library
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class ItemDetailPage : ContentPage
|
||||
public partial class ItemDetailPageOld : ContentPage
|
||||
{
|
||||
public MainViewModel Main
|
||||
{
|
||||
|
|
@ -24,7 +24,7 @@ namespace AideDeJeu.Views.Library
|
|||
|
||||
ItemDetailViewModel viewModel;
|
||||
|
||||
public ItemDetailPage(ItemDetailViewModel itemVM)
|
||||
public ItemDetailPageOld(ItemDetailViewModel itemVM)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ namespace AideDeJeu.Views.Library
|
|||
//mdMarkdown.NavigateToLink = async (s) => await viewModel.Main.Navigator.NavigateToLinkAsync(s);
|
||||
}
|
||||
|
||||
public ItemDetailPage()
|
||||
public ItemDetailPageOld()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:tools="clr-namespace:AideDeJeu.Tools"
|
||||
xmlns:mdview="clr-namespace:Xam.Forms.Markdown"
|
||||
x:Class="AideDeJeu.Views.Library.ItemDetailPage"
|
||||
x:Class="AideDeJeu.Views.Library.ItemDetailPageOld"
|
||||
Title="{Binding Title}"
|
||||
Icon="spell_book.png"
|
||||
x:Name="This">
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
<ContentPage.ToolbarItems>
|
||||
<ToolbarItem Name="AddToFavorites" Text="Ajouter aux favoris" Order="Primary" Icon="round_star.png" Command="{Binding Main.Navigator.AddToFavoritesCommand}" />
|
||||
<ToolbarItem Name="Print" Text="Générer un PDF" Order="Primary" Icon="scroll_unfurled.png" Command="{Binding Main.Navigator.GeneratePDFCommand}" CommandParameter="{Binding Item.Markdown}" />
|
||||
<ToolbarItem Name="Speak" Text="Écouter / Arrêter" Order="Primary" Icon="round_star.png" Command="{Binding Main.Speech.SpeakItemCommand}" CommandParameter="{Binding Item}}" />
|
||||
</ContentPage.ToolbarItems>
|
||||
<Grid>
|
||||
<!--<ScrollView Orientation="Vertical" BackgroundColor="{StaticResource HDWhite}">
|
||||
|
|
|
|||
|
|
@ -55,6 +55,14 @@ namespace AideDeJeu.Views.Library
|
|||
//LoadPageAsync();
|
||||
}
|
||||
|
||||
public ItemPage(ItemViewModel itemViewModel)
|
||||
{
|
||||
BindingContext = this;
|
||||
InitializeComponent();
|
||||
Path = itemViewModel.Item.Id;
|
||||
//Item = itemViewModel;
|
||||
}
|
||||
|
||||
//protected override void OnAppearing()
|
||||
//{
|
||||
// base.OnAppearing();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using Xamarin.Forms.Xaml;
|
|||
namespace AideDeJeu.Views.Library
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class ItemsPage : ContentPage
|
||||
public partial class ItemsPageOld : ContentPage
|
||||
{
|
||||
public MainViewModel Main
|
||||
{
|
||||
|
|
@ -26,7 +26,7 @@ namespace AideDeJeu.Views.Library
|
|||
return _ItemsViewModel;
|
||||
}
|
||||
}
|
||||
public ItemsPage (ItemsViewModel itemsViewModel)
|
||||
public ItemsPageOld (ItemsViewModel itemsViewModel)
|
||||
{
|
||||
InitializeComponent ();
|
||||
|
||||
|
|
@ -35,12 +35,12 @@ namespace AideDeJeu.Views.Library
|
|||
//mdMarkdown.NavigateToLink = async (s) => await itemsViewModel.Main.Navigator.NavigateToLinkAsync(s);
|
||||
}
|
||||
|
||||
public ItemsPage(string id)
|
||||
public ItemsPageOld(string id)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
public ItemsPage()
|
||||
public ItemsPageOld()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
xmlns:local="clr-namespace:AideDeJeu.Views"
|
||||
xmlns:tools="clr-namespace:AideDeJeu.Tools"
|
||||
xmlns:mdview="clr-namespace:Xam.Forms.Markdown"
|
||||
x:Class="AideDeJeu.Views.Library.ItemsPage"
|
||||
x:Class="AideDeJeu.Views.Library.ItemsPageOld"
|
||||
x:Name="This"
|
||||
Title="{Binding Title}">
|
||||
<ContentPage.Resources>
|
||||
|
|
@ -23,11 +23,11 @@
|
|||
</x:Arguments>
|
||||
</Size>
|
||||
</windows:TabbedPage.HeaderIconsSize>
|
||||
<libviews:ItemDetailPage x:Name="NavigationPage" Title="Bibliothèque" Icon="spell_book.png">
|
||||
<libviews:ItemPage x:Name="NavigationPage" Title="Bibliothèque" Icon="spell_book.png" Path="index.md">
|
||||
<!--<x:Arguments>
|
||||
<views:ItemDetailPage />
|
||||
</x:Arguments>-->
|
||||
</libviews:ItemDetailPage>
|
||||
</libviews:ItemPage>
|
||||
<libviews:BookmarksPage Title="Favoris" Icon="stars_stack.png">
|
||||
<!--<x:Arguments>
|
||||
<views:BookmarksPage />
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@
|
|||
</ShellContent>
|
||||
|
||||
</FlyoutItem>
|
||||
<FlyoutItem Title="Manuel des Règles">
|
||||
<!--<FlyoutItem Title="Manuel des Règles">
|
||||
<ShellContent>
|
||||
<ShellContent.ContentTemplate>
|
||||
<DataTemplate>
|
||||
|
|
@ -243,7 +243,7 @@
|
|||
</DataTemplate>
|
||||
</ShellContent.ContentTemplate>
|
||||
</ShellContent>
|
||||
</FlyoutItem>
|
||||
</FlyoutItem>-->
|
||||
<FlyoutItem Title="Favoris">
|
||||
<ShellContent Title="Favoris" ContentTemplate="{DataTemplate library:BookmarksPage}" FlyoutIcon="stars_stack.png" />
|
||||
</FlyoutItem>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue