WIP: page setup minus my-stuff

This commit is contained in:
Ray committed 2021-08-03 17:43:16 +01:00
1 parent d302425b88
commit 8d69e7ffab
15 files changed
+300 -116

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:views="clr-namespace:MobileApp1.Views"
x:Class="MobileApp1.Views.AboutPage"
Title="About">
<ContentPage.Content>
<StackLayout Margin="20">
<views:AboutView />
</StackLayout>
</ContentPage.Content>
</ContentPage>
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MobileApp1.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class AboutPage : ContentPage
{
public AboutPage()
{
InitializeComponent();
}
}
}
@@ -24,7 +24,7 @@ namespace MobileApp1.Views
{
isBusy = value;
LoginPage cp = ContentViewHelper.GetContentPage<LoginPage>(this);
LoginPage cp = ContentViewHelper.GetParentElement<LoginPage>(this);
if (cp != null)
{
cp.IsBusy = value;
@@ -24,7 +24,7 @@ namespace MobileApp1.Views
{
isBusy = value;
LoginPage cp = ContentViewHelper.GetContentPage<LoginPage>(this);
LoginPage cp = ContentViewHelper.GetParentElement<LoginPage>(this);
if (cp != null)
{
cp.IsBusy = value;
+33 -7
View File
@@ -10,30 +10,56 @@
<StackLayout>
<Image Source="company_logo.png" WidthRequest="{OnPlatform iOS=180, Android=180}" HorizontalOptions="Center" Margin="0, 0, 0, 20" />
<ListView x:Name="listView" x:FieldModifier="Public">
<ListView x:Name="listView1">
<!--<ListView.Footer>
<StackLayout VerticalOptions="Start">
<Grid Padding="5, 10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Grid.Row="0" Grid.Column="0" Source="logout.png" Margin="3" />
<Label Grid.Row="0" Grid.Column="1" Text="Logout" />
</Grid>
</StackLayout>
</ListView.Footer>-->
<ListView.ItemsSource>
<x:Array Type="{x:Type models:FlyoutPageItem}">
<models:FlyoutPageItem Title="Home" Icon="home.png" TargetType="{x:Type views:BlankPage}" />
<models:FlyoutPageItem Title="Home" Icon="home.png" TargetType="{x:Type views:HomePage}" />
<models:FlyoutPageItem Title="My Stuff" Icon="layers.png" TargetType="{x:Type views:BlankPage}" />
<models:FlyoutPageItem Title="Settings" Icon="settings.png" TargetType="{x:Type views:BlankPage}" />
<models:FlyoutPageItem Title="About" Icon="help.png" TargetType="{x:Type views:BlankPage}" />
<models:FlyoutPageItem Title="Settings" Icon="settings.png" TargetType="{x:Type views:SettingsPage}" />
<models:FlyoutPageItem Title="About" Icon="help.png" TargetType="{x:Type views:AboutPage}" />
<models:FlyoutPageItem Title="Logout" Icon="logout.png" TargetType="{x:Type views:BlankPage}" />
</x:Array>
</ListView.ItemsSource>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Padding="5, 10">
<Grid Padding="5, 10, 5, 10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="30" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="{Binding Icon}" />
<Image Grid.Column="0" Source="{Binding Icon}" />
<Label Grid.Column="1" Text="{Binding Title}" />
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<!--<ListView x:Name="listView" x:FieldModifier="Public" VerticalOptions="Start">
<StackLayout>
<Grid Padding="5, 10" VerticalOptions="Start">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="logout.png" />
<Label Grid.Column="1" Text="Logout" />
</Grid>
</StackLayout>
</ListView>-->
</StackLayout>
</ContentPage>
+34 -1
View File
@@ -1,4 +1,6 @@
using Xamarin.Forms;
using MobileApp1.Models;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MobileApp1.Views
@@ -9,6 +11,37 @@ namespace MobileApp1.Views
public FlyoutMenuPage()
{
InitializeComponent();
listView1.ItemSelected += listView1_ItemSelected;
}
private async void listView1_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{
await Task.Run(() =>
{
var item = e.SelectedItem as FlyoutPageItem;
if (item == null)
{
return;
}
MainPage mainPage = ContentPageHelper.GetMainPage(this);
if (mainPage == null)
{
return;
}
ContentPageHelper.SetDetailPage(this, item.TargetType);
Device.BeginInvokeOnMainThread(() =>
{
listView1.SelectedItem = null;
mainPage.IsPresented = false;
});
});
}
}
}
+29
View File
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:views="clr-namespace:MobileApp1.Views"
x:Class="MobileApp1.Views.HomePage"
Title="Home">
<ContentPage.Content>
<ScrollView>
<StackLayout Margin="20">
<views:CompanyHeaderView />
<Label Text="Welcome to XYZ" FontSize="Body" />
<Label x:Name="label1" Text="Hi, John." />
<Label Text="" Margin="0, 0, 0, 10" />
<Label Text="Notices" FontSize="Body" />
<Label x:Name="label2" Text="You have no notices" />
<Label Text="" Margin="0, 0, 0, 10" />
<Label Text="Messages" FontSize="Body" />
<Label x:Name="label3" Text="You have no messages" />
<Label Text="" Margin="0, 0, 0, 10" />
<Button x:Name="button1" Margin="0, 20, 0, 0" Text="Let's Get Started" Clicked="button1_Clicked" ></Button>
</StackLayout>
</ScrollView>
</ContentPage.Content>
</ContentPage>
+25
View File
@@ -0,0 +1,25 @@
using System;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MobileApp1.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class HomePage : ContentPage
{
public HomePage()
{
InitializeComponent();
}
private async void button1_Clicked(object sender, EventArgs e)
{
await Task.Run(() =>
{
ContentPageHelper.SetDetailPage(this, typeof(BlankPage));
});
}
}
}
+1 -1
View File
@@ -8,7 +8,7 @@
<FlyoutPage.Detail>
<NavigationPage>
<x:Arguments>
<views:BlankPage />
<views:HomePage />
</x:Arguments>
</NavigationPage>
</FlyoutPage.Detail>
+1 -33
View File
@@ -1,6 +1,4 @@
using MobileApp1.Models;
using System;
using Xamarin.Forms;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MobileApp1.Views
@@ -11,36 +9,6 @@ namespace MobileApp1.Views
public MainPage()
{
InitializeComponent();
flyoutPage.listView.ItemSelected += listView1_OnItemSelected;
}
//private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
//{
// var item = e.SelectedItem as MainPageFlyoutMenuItem;
// if (item == null)
// return;
// var page = (Page)Activator.CreateInstance(item.TargetType);
// page.Title = item.Title;
// Detail = new NavigationPage(page);
// IsPresented = false;
// FlyoutPage.ListView.SelectedItem = null;
//}
private void listView1_OnItemSelected(object sender, SelectedItemChangedEventArgs e)
{
var item = e.SelectedItem as FlyoutPageItem;
if (item == null)
{
return;
}
Detail = new NavigationPage((Page)Activator.CreateInstance(item.TargetType));
flyoutPage.listView.SelectedItem = null;
IsPresented = false;
}
}
+51
View File
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MobileApp1.Views.SettingsPage"
Title="Settings">
<ContentPage.Content>
<ScrollView>
<StackLayout Margin="20">
<Grid Padding="0, 0, 0, 10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Text="CheckBox Setting" VerticalTextAlignment="Center" />
<CheckBox Grid.Row="0" Grid.Column="1" HorizontalOptions="EndAndExpand" />
<Label Grid.Row="1" Grid.Column="0" Text="Switch Setting" VerticalTextAlignment="Center" />
<Switch Grid.Row="1" Grid.Column="1" HorizontalOptions="EndAndExpand" />
<Label Grid.Row="2" Grid.Column="0" Text="Date Setting" VerticalTextAlignment="Center" />
<DatePicker Grid.Row="2" Grid.Column="1" HorizontalOptions="EndAndExpand" Format="dd/MM/yyyy" />
<Label Grid.Row="3" Grid.Column="0" Text="TextBox Setting" VerticalTextAlignment="Center" />
<Entry Grid.Row="3" Grid.Column="1" HorizontalOptions="EndAndExpand" />
<Label Grid.Row="4" Grid.Column="0" Text="Picker Setting" VerticalTextAlignment="Center" />
<Picker Grid.Row="4" Grid.Column="1" HorizontalOptions="EndAndExpand" MinimumWidthRequest="100" />
<!--<Label Grid.Row="5" Grid.Column="0" Text="TextBox Setting" VerticalTextAlignment="Center" />
<RadioButton Grid.Row="5" Grid.Column="1" HorizontalOptions="EndAndExpand" />-->
<!--<Label Grid.Row="6" Grid.Column="0" Text="TextBox Setting" VerticalTextAlignment="Center" />
<Slider Grid.Row="6" Grid.Column="1" HorizontalOptions="FillAndExpand" Minimum="0" Maximum="100" />-->
<!--<Label Grid.Row="5" Grid.Column="0" Text="TextBox Setting" VerticalTextAlignment="Center" />
<Stepper Grid.Row="5" Grid.Column="1" HorizontalOptions="EndAndExpand" MinimumWidthRequest="100" />-->
<Label Grid.Row="5" Grid.Column="0" Text="Time Setting" VerticalTextAlignment="Center" />
<TimePicker Grid.Row="5" Grid.Column="1" HorizontalOptions="EndAndExpand" Format="HH:mm" />
</Grid>
<Button x:Name="button1" Margin="0, 20, 0, 0" Text="Save"></Button>
</StackLayout>
</ScrollView>
</ContentPage.Content>
</ContentPage>
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MobileApp1.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class SettingsPage : ContentPage
{
public SettingsPage()
{
InitializeComponent();
}
}
}