diff --git a/azure_m/azure_m/azure_m.Android/Resources/Resource.designer.cs b/azure_m/azure_m/azure_m.Android/Resources/Resource.designer.cs
index 6648f0ea329973503f5997e21d027e096e0032c9..af6ee1777cec61cb88ca8954b9386a56f4422489 100644
--- a/azure_m/azure_m/azure_m.Android/Resources/Resource.designer.cs
+++ b/azure_m/azure_m/azure_m.Android/Resources/Resource.designer.cs
@@ -14,7 +14,7 @@ namespace azure_m.Droid
{
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.2.4.160")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.3.0.26")]
public partial class Resource
{
@@ -16739,16 +16739,19 @@ namespace azure_m.Droid
public const int tooltip_frame_light = 2131165352;
// aapt resource value: 0x7F0700A9
- public const int user0 = 2131165353;
+ public const int up4 = 2131165353;
// aapt resource value: 0x7F0700AA
- public const int view3 = 2131165354;
+ public const int user0 = 2131165354;
// aapt resource value: 0x7F0700AB
- public const int vm2 = 2131165355;
+ public const int view3 = 2131165355;
// aapt resource value: 0x7F0700AC
- public const int xamarin_logo = 2131165356;
+ public const int vm2 = 2131165356;
+
+ // aapt resource value: 0x7F0700AD
+ public const int xamarin_logo = 2131165357;
static Drawable()
{
diff --git a/azure_m/azure_m/azure_m.Android/Resources/drawable/up4.png b/azure_m/azure_m/azure_m.Android/Resources/drawable/up4.png
new file mode 100644
index 0000000000000000000000000000000000000000..7ffb99ee816262318234c6dac2adb39f84682932
Binary files /dev/null and b/azure_m/azure_m/azure_m.Android/Resources/drawable/up4.png differ
diff --git a/azure_m/azure_m/azure_m.Android/azure_m.Android.csproj b/azure_m/azure_m/azure_m.Android/azure_m.Android.csproj
index 581cc9c8ce5625c6d4841f42193aff48b8d28d42..07da096f73ab91765db3872d9eb7ae3dcee7463a 100644
--- a/azure_m/azure_m/azure_m.Android/azure_m.Android.csproj
+++ b/azure_m/azure_m/azure_m.Android/azure_m.Android.csproj
@@ -170,5 +170,8 @@
+
+
+
\ No newline at end of file
diff --git a/azure_m/azure_m/azure_m/AppShell.xaml b/azure_m/azure_m/azure_m/AppShell.xaml
index defe5efdcbbcd2545dedb681a1ff336f8ca091dd..72c32bf3e4dd4584d51e3df87e87eac636a57a98 100644
--- a/azure_m/azure_m/azure_m/AppShell.xaml
+++ b/azure_m/azure_m/azure_m/AppShell.xaml
@@ -4,9 +4,63 @@
xmlns:local="clr-namespace:azure_m.Views" xmlns:azure_m="clr-namespace:azure_m" x:DataType="azure_m:AppShell"
Title="Azure"
Shell.NavBarHasShadow="True"
+
x:Class="azure_m.AppShell"
>
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/azure_m/azure_m/azure_m/AppShell.xaml.cs b/azure_m/azure_m/azure_m/AppShell.xaml.cs
index 4bad98c3e9619d45afc6ad9356d42ebc589efa45..50872d0493b8b9b9cbb801ba13ee03a2b4f02c09 100644
--- a/azure_m/azure_m/azure_m/AppShell.xaml.cs
+++ b/azure_m/azure_m/azure_m/AppShell.xaml.cs
@@ -8,6 +8,7 @@ namespace azure_m
{
public partial class AppShell : Xamarin.Forms.Shell
{
+
public AppShell()
{
InitializeComponent();
@@ -15,11 +16,7 @@ namespace azure_m
Routing.RegisterRoute(nameof(NewItemPage), typeof(NewItemPage));
Routing.RegisterRoute(nameof(VirtualNetworkPage), typeof(VirtualNetworkPage));
Routing.RegisterRoute(nameof(MonitorPage), typeof(MonitorPage));
- }
-
- private async void OnMenuItemClicked(object sender, EventArgs e)
- {
- await Shell.Current.GoToAsync("//LoginPage");
+ this.CurrentItem = Home;
}
private void onMenuBtn_Clicked(object sender, EventArgs e)
@@ -29,5 +26,12 @@ namespace azure_m
}
+ private void StarFlyoutItem_Clicked(object sender, EventArgs e)
+ {
+ StarItems.IsVisible = !StarItems.IsVisible;
+ StarItems.IsEnabled = !StarItems.IsEnabled;
+ ///HACK: 通过数据绑定控制这里的ImageSource
+ StarFlyoutItem.IconImageSource = StarFlyoutItem.IconImageSource.ToString().Equals("File: up4.png") ? "down4.png" : "up4.png";
+ }
}
}
diff --git a/azure_m/azure_m/azure_m/Models/Resources.cs b/azure_m/azure_m/azure_m/Models/Resources.cs
index a54b1c4070fc1c18ff8c277b2c9afa9e64e4879d..9b2e267341a9267f94a38042f6e2e6b74464555a 100644
--- a/azure_m/azure_m/azure_m/Models/Resources.cs
+++ b/azure_m/azure_m/azure_m/Models/Resources.cs
@@ -24,7 +24,23 @@ namespace azure_m.Models
public string Kind { get; set; }
public string Location { get; set; }
public string ManagedBy { get; set; }
+ public string Name { get; set; }
//public object Properties { get; set; }
//public string provisioningState { get; set; }
+
+ public Resource()
+ {
+
+ }
+
+ public Resource(string changeTime, string createdTime, string kind, string location, string managedBy, string name)
+ {
+ ChangeTime = changeTime;
+ CreatedTime = createdTime;
+ Kind = kind;
+ Location = location;
+ ManagedBy = managedBy;
+ Name = name;
+ }
}
}
diff --git a/azure_m/azure_m/azure_m/Views/MainPage.xaml b/azure_m/azure_m/azure_m/Views/MainPage.xaml
index 09dd92d996b2778115cc60b08571f55557c90f46..d6944bfd2a7deeecb600cbfd338e187d01209795 100644
--- a/azure_m/azure_m/azure_m/Views/MainPage.xaml
+++ b/azure_m/azure_m/azure_m/Views/MainPage.xaml
@@ -87,16 +87,15 @@
-
+
-
-
-
-
+
+
+
+
-
@@ -112,14 +111,12 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/azure_m/azure_m/azure_m/Views/MainPage.xaml.cs b/azure_m/azure_m/azure_m/Views/MainPage.xaml.cs
index 28e2468c6a1dfdd9c8de891ad5fe26bb76677c63..4c0fbd7b36ccd0ade3b2726b78e399a3f6303949 100644
--- a/azure_m/azure_m/azure_m/Views/MainPage.xaml.cs
+++ b/azure_m/azure_m/azure_m/Views/MainPage.xaml.cs
@@ -1,17 +1,68 @@
using System;
+using System.Collections.Generic;
using System.ComponentModel;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
+using azure_m.Models;
namespace azure_m.Views
{
public partial class MainPage : ContentPage
{
+ List ResourcesLayout = null;
+
public MainPage()
{
InitializeComponent();
+ GetResources();
+ }
+
+ ///
+ ///
+ ///
+ /// 0表示Recent,1表示Favorite
+ public void GetResources(int type = 0)
+ {
+ ResourceLayout.Children.Clear();
+ List resources = new List();
+ //查询指定资源,放置在ResourcesLayout中
+ //resources = await GetResourcesByApi(type)...
+ //resources.sort by type nad name
+
+ ///DEBUG
+ if(type == 0)
+ {
+ resources.Add(new Resource("1小时前", "", "虚拟机", "jp", "", "vm"));
+ resources.Add(new Resource("2小时前", "", "虚拟机", "jp", "", "vm"));
+ }
+
+ resources.ForEach(o => {
+ Grid grid = new Grid
+ {
+ HorizontalOptions = LayoutOptions.FillAndExpand,
+ ColumnDefinitions =
+ {
+ new ColumnDefinition { Width = GridLength.Auto },
+ new ColumnDefinition { Width = GridLength.Auto },
+ new ColumnDefinition { Width = GridLength.Auto },
+ new ColumnDefinition { Width = GridLength.Auto }
+ }
+ };
+ grid.Children.Add(new Image { Source=getSourceByType(o.Kind), HeightRequest=15, VerticalOptions=LayoutOptions.Center},0,0);
+ grid.Children.Add(new Label { Text=o.Name, HeightRequest=grid.Height, VerticalOptions=LayoutOptions.Center, HorizontalOptions=LayoutOptions.Start},1,0);
+ grid.Children.Add(new Label { Text = o.Kind, HeightRequest=grid.Height, VerticalOptions=LayoutOptions.Center, HorizontalOptions=LayoutOptions.Center},2,0);
+ grid.Children.Add(new Label { Text = o.ChangeTime, HeightRequest=grid.Height, VerticalOptions=LayoutOptions.Center, HorizontalOptions= LayoutOptions.End},3,0);
+
+ ResourceLayout.Children.Add(grid);
+ });
+
}
+ private ImageSource getSourceByType(string kind)
+ {
+ //DEBUG
+ return "vm2.png";
+ }
private void swapBtnColors()
{
@@ -28,6 +79,7 @@ namespace azure_m.Views
{
swapBtnColors();
//异步 querying datas, 在此期间出现一个刷新标志
+ GetResources(1);
}
@@ -35,6 +87,7 @@ namespace azure_m.Views
{
swapBtnColors();
//异步 querying datas, 在此期间出现一个刷新标志
+ GetResources(1);
}
public void OnMyIcon_Clicked(object sender, EventArgs e)
@@ -77,8 +130,7 @@ namespace azure_m.Views
}
public void OnMonitor_Clicked(object sender, EventArgs e)
{
- //Navigation.PushAsync(new Monitor());
- DisplayAlert("Alert", "MonitorPage", "OK");
+ Navigation.PushAsync(new MonitorPage());
}
public void OnMoreService_Clicked(object sender, EventArgs e)
{
@@ -86,5 +138,9 @@ namespace azure_m.Views
DisplayAlert("Alert", "AllService", "OK");
}
+ private void MoreResourceBtn_Clicked(object sender, EventArgs e)
+ {
+ DisplayAlert("MoreResourceBtn_Clicked", "", "ok");
+ }
}
}
\ No newline at end of file