when I click on an item on the list on the front page and when I press the back button nothing seems to click on the list. has worked before but has only updated the nugets for syncfusion. I get no error. only the menubar button that work. i using the standard startpage from syncfusion. just edited the colors Does anyone have a tip on what I can do? ps using the
ParallaxListView not the SfListView. here is the code i using
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="VTFKHakkespettboka.AppLayout.Views.HomePage"
xmlns:gradient="clr-namespace:Syncfusion.XForms.Graphics;assembly=Syncfusion.Core.XForms"
xmlns:viewModels="clr-namespace:VTFKHakkespettboka.AppLayout.ViewModels;assembly=VTFKHakkespettboka"
xmlns:controls="clr-namespace:VTFKHakkespettboka.AppLayout.Controls;assembly=VTFKHakkespettboka"
xmlns:views="clr-namespace:VTFKHakkespettboka.AppLayout.Views;assembly=VTFKHakkespettboka"
NavigationPage.HasNavigationBar="False">
x:Name="listView"
Grid.Row="0"
Grid.RowSpan="2"
HasUnevenRows="True"
ItemsSource="{Binding Templates}"
ScrollChanged="ListView_OnScrollChanged"
SelectionChanged="ListView_OnSelectionChanged"
SeparatorVisibility="None">
Grid.RowSpan="3"
Grid.Column="0"
Aspect="AspectFit"
HeightRequest="80"
Style="{StaticResource ItemImageStyle}"
WidthRequest="80" />
Grid.Row="0"
Grid.Column="1"
Orientation="Horizontal">
Margin="0"
Padding="0"
BackgroundColor="#04B875"
CornerRadius="10"
HasShadow="False"
IsVisible="{Binding IsUpdate}">
Margin="5,1"
FontFamily="Nunito-Black"
FontSize="10"
Text="{Binding UpdateType}"
TextColor="{DynamicResource ListViewText}" />
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="2"
Style="{StaticResource ItemDescriptionStyle}" />
Grid.Row="2"
Grid.Column="1"
Style="{StaticResource ItemCountLabelStyle}" />
x:Name="ListViewHeader"
Margin="0,0,0,-3"
HeightRequest="275"
IsClippedToBounds="True"
RowSpacing="0">
Grid.Row="1"
Grid.RowSpan="2"
ColumnSpacing="0"
HeightRequest="200"
Opacity="0.9"
RowSpacing="0">
x:Name="HeaderImage"
Grid.Row="1"
Grid.RowSpan="2"
Grid.Column="0"
Clicked="OnImageButtonClicked"
Style="{StaticResource HeaderIconStyle}" />
x:Name="BrandName"
Grid.Row="2"
Grid.Column="1"
FontFamily="Nunito-Black"
FontSize="Medium"
HorizontalOptions="StartAndExpand"
Text="VTFK Hakkespettboka"
TextColor="{DynamicResource ActionBarLabel}" />
Grid.Row="1"
Margin="0,0,0,-60"
HorizontalOptions="StartAndExpand"
Opacity="1"
Source="HeaderTriangle.png"
VerticalOptions="EndAndExpand"
WidthRequest="170" />
Grid.Row="1"
Margin="0,0,0,-110"
HorizontalOptions="EndAndExpand"
Opacity="1"
Source="InvertedTriangle.png"
VerticalOptions="EndAndExpand"
WidthRequest="190" />
Grid.Row="2"
Padding="0"
BackgroundColor="{DynamicResource backgroundColor2}"
CornerRadius="{OnPlatform 20,
iOS=10}"
HasShadow="False" />
x:Name="SettingsIcon"
Clicked="ShowSettings"
IsVisible="false"
Style="{StaticResource ActionBarSettingIconStyle}"
VerticalOptions="Start" />
x:Name="SignInBtn"
Clicked="OnSignInClicked"
IsVisible="false"
Style="{StaticResource ActionBarLoginIconStyle}"
VerticalOptions="Start" />
x:Name="SettingsIcon2"
Clicked="Test"
Style="{StaticResource ActionBarSettingIconStyle}"
VerticalOptions="Start" />
x:Name="ActionBar"
Padding="0,0,0,20"
IsClippedToBounds="True"
IsVisible="false"
RowSpacing="0">
Clicked="ShowSettings"
Style="{StaticResource ActionBarSettingIconStyle}"
VerticalOptions="CenterAndExpand" />
Grid.Row="2"
Padding="0"
BackgroundColor="{DynamicResource Gray-White}"
CornerRadius="{OnPlatform 20,
iOS=10}"
HasShadow="False" />
using Microsoft.Identity.Client;
using System;
using System.Linq;
using VTFKHakkespettboka.AppLayout.Controls;
using VTFKHakkespettboka.AppLayout.Models;
using Xamarin.Forms;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Xaml;
namespace VTFKHakkespettboka.AppLayout.Views
{
/// <summary>
/// UITemplate home page
/// </summary>
[Preserve(AllMembers = true)]
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class HomePage
{
#region Fields
private const double TranslatedHeaderX = 15;
private const double TranslatedHeaderY = 10;
private bool loaded;
private bool isNavigationInQueue;
private double actualHeaderX, actualHeaderY;
private double headerDeltaX, headerDeltaY;
private double scrollDensity;
private double width;
private double height;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="HomePage" /> class.
/// </summary>
public HomePage()
{
InitializeComponent();
}
#endregion
#region Methods
protected override void OnSizeAllocated(double width, double height)
{
base.OnSizeAllocated(width, height);
if (Device.RuntimePlatform == "UWP" ||
!AppSettings.Instance.IsSafeAreaEnabled)
{
return;
}
if (width == this.width && height == this.height)
{
return;
}
var safeAreaHeight = AppSettings.Instance.SafeAreaHeight;
this.width = width;
this.height = height;
if (width < height)
{
iOSSafeArea.Height = iOSSafeAreaTitle.Height = safeAreaHeight;
ListViewHeader.HeightRequest += safeAreaHeight;
DefaultActionBar.Height = DefaultActionBar.Height.Value + safeAreaHeight;
}
else
{
iOSSafeArea.Height = iOSSafeAreaTitle.Height = 0;
ListViewHeader.HeightRequest = 275;
DefaultActionBar.Height = 60;
}
}
//protected override void OnAppearing()
//{
//this.isNavigationInQueue = false;
//base.OnAppearing();
//}
protected override async void OnAppearing()
{
try
{
// Look for existing account
var accounts = await App.AuthenticationClient.GetAccountsAsync();
if (accounts.Count() >= 1)
{
AuthenticationResult result = await App.AuthenticationClient
.AcquireTokenSilent(Constants.Scopes, accounts.FirstOrDefault())
.ExecuteAsync();
await Navigation.PushAsync(new HomePageIKT());
}
}
catch
{
// Do nothing - the user isn't logged in
}
base.OnAppearing();
}
async void OnSignInClicked(object sender, EventArgs e)
{
AuthenticationResult result;
try
{
result = await App.AuthenticationClient
.AcquireTokenInteractive(Constants.Scopes)
.WithPrompt(Prompt.ForceLogin)
.WithParentActivityOrWindow(App.UIParent)
.ExecuteAsync();
await Navigation.PushAsync(new HomePageIKT());
}
catch (MsalUiRequiredException ex)
{
if (ex.ErrorCode != "authentication_canceled")
{
await DisplayAlert("Det har oppstått en feil", "Exception message: " + ex.Message, "Avvis");
}
}
}
protected override bool OnBackButtonPressed()
{
if (!this.SettingsView.IsVisible)
{
return base.OnBackButtonPressed();
}
this.SettingsView.Hide();
return true;
}
private void ListView_OnScrollChanged(object sender, ScrollChangedEventArgs e)
{
if (!this.loaded)
{
this.scrollDensity = Application.Current.MainPage.Width / listView.WidthInPixel;
this.headerDeltaX = this.actualHeaderX - TranslatedHeaderX;
this.headerDeltaY = this.actualHeaderY - TranslatedHeaderY;
this.loaded = true;
}
var scrollValue = e.Position * this.scrollDensity;
var factor = (scrollValue + 215) / 215;
if (scrollValue <= -215)
{
ActionBar.IsVisible = true;
}
else if (scrollValue > -215)
{
HeaderImage.Opacity = factor;
BrandName.Opacity = (scrollValue + 75) / 75;
ActionBar.IsVisible = false;
SettingsIcon.TranslationY = scrollValue * -1;
}
}
private void Test(object sender, EventArgs e)
{
Navigation.PushAsync(new Settings());
}
private void OnImageButtonClicked(object sender, EventArgs e)
{
Navigation.PushAsync(new Login.LoginPopupPage());
}
private void ListView_OnSelectionChanged(object sender, SelectedItemChangedEventArgs e)
{
if (e.SelectedItem == null || this.isNavigationInQueue)
{
return;
}
this.isNavigationInQueue = true;
Navigation.PushAsync(new TemplatePage(e.SelectedItem as Category));
}
private void ShowSettings(object sender, EventArgs e)
{
//SettingsView.Show();
Navigation.PushAsync(new Settings());
}
#endregion
}
}