1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2026-03-23 07:16:17 +00:00

Merge commit 'da08a4d387' into version_ios

This commit is contained in:
yostane 2018-05-12 16:29:24 +02:00
commit 0953431a11
10 changed files with 33 additions and 95 deletions

View file

@ -48,6 +48,20 @@ namespace AideDeJeu.ViewModels
}
public ObservableCollection<Item> Items { get; private set; } = new ObservableCollection<Item>();
private Item _SelectedItem;
public Item SelectedItem
{
get
{
return _SelectedItem;
}
set
{
SetProperty(ref _SelectedItem, value);
GotoItemCommand.Execute(_SelectedItem);
}
}
public Command LoadItemsCommand { get; private set; }
public Command<Item> GotoItemCommand { get; private set; }

View file

@ -2,12 +2,11 @@
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AideDeJeu.Views"
xmlns:tools="clr-namespace:AideDeJeu.Tools"
xmlns:tools="clr-namespace:AideDeJeu.Tools"
x:Class="AideDeJeu.Views.MainPage"
x:Name="This"
x:Name="This"
IsPresented="False"
Title="{Binding ItemsType,Converter={StaticResource ItemTypeToStringConverter}}"
>
Title="{Binding ItemsType,Converter={StaticResource ItemTypeToStringConverter}}">
<MasterDetailPage.Resources>
<ResourceDictionary>
<ControlTemplate x:Key="SpellsMasterDataTemplate">
@ -80,7 +79,6 @@
<MasterDetailPage.Master>
<ContentPage Title=" ">
<ContentView ControlTemplate="{Binding ItemsType, Converter={StaticResource ItemsTypeTemplateConverter}}" BindingContext="{Binding}" />
<!--<ContentView ControlTemplate="{StaticResource SpellsMasterDataTemplate}" BindingContext="{Binding}" />-->
</ContentPage>
</MasterDetailPage.Master>
<MasterDetailPage.Detail>
@ -89,20 +87,6 @@
<ToolbarItem Name="Spells" Text="Sorts" Order="Primary" Icon="spell_book.png" Command="{Binding SwitchToSpells}" />
<ToolbarItem Name="Monsters" Text="Monstres" Order="Primary" Icon="dragon_head.png" Command="{Binding SwitchToMonsters}" />
<ToolbarItem Name="About" Text="À propos de..." Order="Primary" Icon="wooden_sign.png" Command="{Binding AboutCommand}" />
<!--<ToolbarItem Name="Home" Text="Accueil" Order="Primary" Icon="ic_home.png" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/" />
<ToolbarItem Name="Spells" Text="Sorts" Order="Primary" Icon="ic_home.png" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/" />-->
<!--<ToolbarItem Name="Blog" Text="Blog" Order="Primary" Icon="ic_blog.png" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/Blog/" />
<ToolbarItem Name="Wikis" Text="Wikis" Order="Primary" Icon="ic_wikis.png" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/Wiki/" />
<ToolbarItem Name="Forum" Text="Forum" Order="Primary" Icon="ic_forum.png" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/Forum/" />
<ToolbarItem Name="Gallery2" Text="Galerie" Order="Secondary" Icon="ic_gallery.png" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/Media/" />
<ToolbarItem Name="Plays2" Text="Parties" Order="Secondary" Icon="ic_plays.png" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/Wiki/Parties.MainPage.ashx" />
<ToolbarItem Name="Search2" Text="Rechercher" Order="Secondary" Icon="ic_search.png" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/search/default.aspx" />-->
<!--<ToolbarItem Text="Profil" Order="Secondary" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/forum/yaf_cp_profile.aspx" />
<ToolbarItem Text="Messages privés" Order="Secondary" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/forum/default.aspx?g=cp_pm" />
<ToolbarItem Text="Connexion" Order="Secondary" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/members/login.aspx" />
<ToolbarItem Text="Déconnexion" Order="Secondary" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/members/logout.aspx" />
<ToolbarItem Text="Inscription" Order="Secondary" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/members/register.aspx" />-->
</ContentPage.ToolbarItems>
<StackLayout Orientation="Vertical">
<SearchBar x:Name="SearchBar" SearchCommand="{Binding SearchCommand}" SearchCommandParameter="{Binding Text, Source={x:Reference SearchBar}}">
@ -110,65 +94,30 @@
<tools:TextChangedBehavior />
</SearchBar.Behaviors>
</SearchBar>
<ListView x:Name="ItemsListView"
ItemsSource="{Binding Items}"
VerticalOptions="FillAndExpand"
HasUnevenRows="true"
RefreshCommand="{Binding LoadItemsCommand}"
IsPullToRefreshEnabled="true"
IsRefreshing="{Binding IsBusy, Mode=OneWay}"
CachingStrategy="RecycleElement"
ItemSelected="OnItemSelected">
ItemsSource="{Binding Items}"
VerticalOptions="FillAndExpand"
HasUnevenRows="true"
RefreshCommand="{Binding LoadItemsCommand}"
IsPullToRefreshEnabled="true"
IsRefreshing="{Binding IsBusy, Mode=OneWay}"
CachingStrategy="RecycleElement"
SelectedItem="{Binding SelectedItem}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="10">
<Label Text="{Binding NamePHB}"
LineBreakMode="NoWrap"
Style="{DynamicResource subsubsection}"
FontSize="16" />
<!--<Label Text="{Binding Description}"
LineBreakMode="NoWrap"
Style="{DynamicResource ListItemDetailTextStyle}"
FontSize="13" />-->
LineBreakMode="NoWrap"
Style="{DynamicResource subsubsection}"
FontSize="16" />
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<!--<WebView x:Name="MainView" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Navigating="OnNavigating" Source="{Binding Source}" />-->
<!--<ActivityIndicator x:Name="aiProgress" Color="Black" IsRunning="True" IsVisible="True" />-->
</StackLayout>
</ContentPage>
</MasterDetailPage.Detail>
</MasterDetailPage>
<!--<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:AideDeJeu.Views"
x:Class="AideDeJeu.Views.MainPage">
<TabbedPage.Children>
<NavigationPage Title="Browse">
<NavigationPage.Icon>
<OnPlatform x:TypeArguments="FileImageSource">
<On Platform="iOS" Value="tab_feed.png"/>
</OnPlatform>
</NavigationPage.Icon>
<x:Arguments>
<views:ItemsPage />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="About">
<NavigationPage.Icon>
<OnPlatform x:TypeArguments="FileImageSource">
<On Platform="iOS" Value="tab_about.png"/>
</OnPlatform>
</NavigationPage.Icon>
<x:Arguments>
<views:AboutPage />
</x:Arguments>
</NavigationPage>
</TabbedPage.Children>
</TabbedPage>-->

View file

@ -27,35 +27,6 @@ namespace AideDeJeu.Views
return true;
}
async void OnItemSelected(object sender, SelectedItemChangedEventArgs args)
{
viewModel.GotoItemCommand.Execute(args.SelectedItem);
//if (args.SelectedItem is Spell)
//{
// var item = args.SelectedItem as Spell;
// if (item == null)
// return;
// var vm = new SpellDetailViewModel(item);
// vm.LoadItemCommand.Execute(null);
// await Navigation.PushAsync(new SpellDetailPage(vm));
//}
//else if (args.SelectedItem is Monster)
//{
// var item = args.SelectedItem as Monster;
// if (item == null)
// return;
// var vm = new MonsterDetailViewModel(item);
// vm.LoadItemCommand.Execute(null);
// await Navigation.PushAsync(new MonsterDetailPage(vm));
//}
// Manually deselect item.
ItemsListView.SelectedItem = null;
}
protected override void OnAppearing()
{
base.OnAppearing();

View file

@ -1 +0,0 @@
<svg style="height: 512px; width: 512px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M0 0h512v512H0z" fill="#000" fill-opacity="1"></path><g class="" style="touch-action: none;" transform="translate(0,0)"><path d="M102.594 25.97l90.062 345.78L481.844 395 391.75 49.22 102.594 25.97zm-18.906 1.593c-30.466 11.873-55.68 53.098-49.75 75.312l3.25 11.78c.667-1.76 1.36-3.522 2.093-5.28C49.19 85.668 65.84 62.61 89.657 50.47l-5.97-22.907zm44.937 18.906l247.813 21.593 80.937 305.156-249.344-20.064L128.626 46.47zM94.53 69.155c-16.66 10.01-29.916 28.068-38 47.406-5.245 12.552-8.037 25.64-8.75 36.532l64.814 235.28c.293-.55.572-1.105.875-1.655 10.6-19.254 27.822-37.696 51.124-48.47L94.53 69.156zm74.876 287.563c-17.673 9.067-31.144 23.712-39.562 39-4.464 8.105-7.262 16.36-8.688 23.75l11.688 42.405 1.625.125c-3.825-27.528 11.382-60.446 41.25-81.03l-6.314-24.25zm26.344 34.03c-32.552 17.26-46.49 52.402-41.844 72.906l289.844 24.53c-5.315-7.75-8.637-17.84-8.594-28.342l-22.562-9.063 46.625-7.31-13.595-12.97c5.605-6.907 13.688-13.025 24.78-17.656L195.75 390.75z" fill="#fff" fill-opacity="1"></path></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.