├── README.md ├── images ├── Xam1.png ├── Xam2.png ├── Blazor1.PNG ├── Blazor2.PNG └── BlazorXamarin.jpg ├── BlazXam ├── MSC.BlazXam.Blazor │ ├── Pages │ │ ├── Index.razor │ │ ├── _Host.cshtml │ │ ├── Error.razor │ │ ├── CurrentWeather.razor │ │ └── Cities.razor │ ├── wwwroot │ │ ├── favicon.ico │ │ └── css │ │ │ ├── open-iconic │ │ │ ├── font │ │ │ │ ├── fonts │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ └── open-iconic.woff │ │ │ │ └── css │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── FONT-LICENSE │ │ │ └── site.css │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Shared │ │ ├── MainLayout.razor │ │ └── NavMenu.razor │ ├── _Imports.razor │ ├── App.razor │ ├── MSC.BlazXam.Blazor.csproj │ ├── Program.cs │ └── Startup.cs ├── MSC.BlazXam.Xam │ ├── MSC.BlazXam.Xam │ │ ├── AssemblyInfo.cs │ │ ├── AppShell.xaml.cs │ │ ├── Services │ │ │ ├── IDataStore.cs │ │ │ ├── APIDataStore.cs │ │ │ └── MockDataStore.cs │ │ ├── Models │ │ │ └── Item.cs │ │ ├── ViewModels │ │ │ ├── AboutViewModel.cs │ │ │ ├── ItemDetailViewModel.cs │ │ │ ├── BaseViewModel.cs │ │ │ └── ItemsViewModel.cs │ │ ├── App.xaml │ │ ├── Views │ │ │ ├── AboutPage.xaml.cs │ │ │ ├── ItemDetailPage.xaml.cs │ │ │ ├── ItemsPage.xaml.cs │ │ │ ├── ItemDetailPage.xaml │ │ │ ├── ItemsPage.xaml │ │ │ └── AboutPage.xaml │ │ ├── App.xaml.cs │ │ ├── MSC.BlazXam.Xam.csproj │ │ ├── ViewModelsDesign │ │ │ └── ItemsViewModelDesign.cs │ │ └── AppShell.xaml │ ├── MSC.BlazXam.Xam.iOS │ │ ├── Resources │ │ │ ├── Default.png │ │ │ ├── Default@2x.png │ │ │ ├── tab_about.png │ │ │ ├── tab_feed.png │ │ │ ├── tab_about@2x.png │ │ │ ├── tab_about@3x.png │ │ │ ├── tab_feed@2x.png │ │ │ ├── tab_feed@3x.png │ │ │ ├── xamarin_logo.png │ │ │ ├── Default-568h@2x.png │ │ │ ├── xamarin_logo@2x.png │ │ │ ├── xamarin_logo@3x.png │ │ │ ├── Default-Portrait.png │ │ │ ├── Default-Portrait@2x.png │ │ │ └── LaunchScreen.storyboard │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon120.png │ │ │ │ ├── Icon152.png │ │ │ │ ├── Icon167.png │ │ │ │ ├── Icon180.png │ │ │ │ ├── Icon20.png │ │ │ │ ├── Icon29.png │ │ │ │ ├── Icon40.png │ │ │ │ ├── Icon58.png │ │ │ │ ├── Icon60.png │ │ │ │ ├── Icon76.png │ │ │ │ ├── Icon80.png │ │ │ │ ├── Icon87.png │ │ │ │ ├── Icon1024.png │ │ │ │ └── Contents.json │ │ ├── Entitlements.plist │ │ ├── Main.cs │ │ ├── AppDelegate.cs │ │ ├── Info.plist │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── MSC.BlazXam.Xam.iOS.csproj │ └── MSC.BlazXam.Xam.Android │ │ ├── Resources │ │ ├── mipmap-hdpi │ │ │ ├── icon.png │ │ │ └── launcher_foreground.png │ │ ├── mipmap-mdpi │ │ │ ├── icon.png │ │ │ └── launcher_foreground.png │ │ ├── drawable │ │ │ ├── tab_about.png │ │ │ ├── tab_feed.png │ │ │ └── xamarin_logo.png │ │ ├── mipmap-xhdpi │ │ │ ├── icon.png │ │ │ └── launcher_foreground.png │ │ ├── mipmap-xxhdpi │ │ │ ├── icon.png │ │ │ └── launcher_foreground.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── icon.png │ │ │ └── launcher_foreground.png │ │ ├── mipmap-anydpi-v26 │ │ │ ├── icon.xml │ │ │ └── icon_round.xml │ │ ├── values │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ ├── layout │ │ │ ├── Toolbar.xml │ │ │ └── Tabbar.xml │ │ └── AboutResources.txt │ │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ │ ├── Assets │ │ └── AboutAssets.txt │ │ ├── MainActivity.cs │ │ └── MSC.BlazXam.Xam.Android.csproj ├── MSC.BlazXam.Config │ ├── MSC.BlazXam.Config.csproj │ └── Config.cs ├── MSC.BlazXam.Models │ ├── MSC.BlazXam.Models.csproj │ ├── DMA.cs │ ├── Elevation.cs │ ├── Temperature.cs │ ├── Metric.cs │ ├── Imperial.cs │ ├── Country.cs │ ├── Region.cs │ ├── Source.cs │ ├── GeoPosition.cs │ ├── TimeZone.cs │ ├── AdministrativeArea.cs │ ├── AccuWeatherCurrentConditModel.cs │ ├── AccuWeatherTopCitiesModel.cs │ └── Details.cs ├── MSC.BlazXam.BizLogic │ ├── MSC.BlazXam.BizLogic.csproj │ └── HTTPClientService.cs ├── MSC.BlazXam.BizLogicTest │ ├── MSC.BlazXam.BizLogicTest.csproj │ └── TestHTTPClientService.cs └── MSC.BlazXam.Blaz.sln ├── .gitignore └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # BlazXamPub 2 | Blazor Xamarin Code Sharing project 3 | -------------------------------------------------------------------------------- /images/Xam1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/images/Xam1.png -------------------------------------------------------------------------------- /images/Xam2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/images/Xam2.png -------------------------------------------------------------------------------- /images/Blazor1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/images/Blazor1.PNG -------------------------------------------------------------------------------- /images/Blazor2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/images/Blazor2.PNG -------------------------------------------------------------------------------- /images/BlazorXamarin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/images/BlazorXamarin.jpg -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Hello, world!

4 | 5 | Welcome to your new app. 6 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Xamarin.Forms.Xaml; 2 | 3 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)] -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Blazor/wwwroot/favicon.ico -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/Default.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/Default@2x.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/tab_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/tab_about.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/tab_feed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/tab_feed.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/tab_about@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/tab_about@2x.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/tab_about@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/tab_about@3x.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/tab_feed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/tab_feed@2x.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/tab_feed@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/tab_feed@3x.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/xamarin_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/xamarin_logo.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/xamarin_logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/xamarin_logo@2x.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/xamarin_logo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/xamarin_logo@3x.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Blazor/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Blazor/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Blazor/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Blazor/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Config/MSC.BlazXam.Config.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/MSC.BlazXam.Models.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-hdpi/icon.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-mdpi/icon.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/drawable/tab_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/drawable/tab_about.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/drawable/tab_feed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/drawable/tab_feed.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-xhdpi/icon.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-xxhdpi/icon.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/drawable/xamarin_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/drawable/xamarin_logo.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-xxxhdpi/icon.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-hdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-hdpi/launcher_foreground.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-mdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-mdpi/launcher_foreground.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-xhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-xhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-xxhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-xxhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robintschroeder/BlazXamPub/HEAD/BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/DMA.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class DMA 8 | { 9 | public string EnglishName { get; set; } 10 | public string ID { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/Elevation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class Elevation 8 | { 9 | public Imperial Imperial { get; set; } 10 | public Metric Metric { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/Temperature.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class Temperature 8 | { 9 | public Imperial Imperial { get; set; } 10 | public Metric Metric { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Config/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MSC.BlazXam 4 | { 5 | public static class Config 6 | { 7 | // Sign up here to get a free API key for AccuWeather 8 | // https://developer.accuweather.com/ 9 | public const string AccuWeatherKey = "{PUT-YOUR-KEY-RIGHT-HERE}"; 10 | } 11 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/Metric.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class Metric 8 | { 9 | public string Unit { get; set; } 10 | public int UnitType { get; set; } 11 | public double Value { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/Imperial.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class Imperial 8 | { 9 | public string Unit { get; set; } 10 | public int UnitType { get; set; } 11 | public double Value { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-anydpi-v26/icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/mipmap-anydpi-v26/icon_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | #3F51B5 5 | #303F9F 6 | #FF4081 7 | 8 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/Country.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class Country 8 | { 9 | public string EnglishName { get; set; } 10 | public string ID { get; set; } 11 | public string LocalizedName { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/Region.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class Region 8 | { 9 | public string EnglishName { get; set; } 10 | public string ID { get; set; } 11 | public string LocalizedName { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/Source.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class Source 8 | { 9 | public string DataType { get; set; } 10 | 11 | //public string Source { get; set; } 12 | public int SourceId { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/GeoPosition.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class GeoPosition 8 | { 9 | public Elevation Elevation { get; set; } 10 | public double Latitude { get; set; } 11 | public double Longitude { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/AppShell.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using Xamarin.Forms; 5 | 6 | namespace MSC.BlazXam.Xam 7 | { 8 | public partial class AppShell : Xamarin.Forms.Shell 9 | { 10 | public AppShell() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/Services/IDataStore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace MSC.BlazXam.Xam.Services 6 | { 7 | public interface IDataStore 8 | { 9 | Task GetItemAsync(string id); 10 | 11 | Task> GetItemsAsync(bool forceRefresh = false); 12 | } 13 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.JSInterop 8 | @using MSC.BlazXam.Blazor 9 | @using MSC.BlazXam.Blazor.Shared 10 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/TimeZone.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class TimeZone 8 | { 9 | public string Code { get; set; } 10 | public double GmtOffset { get; set; } 11 | public bool IsDaylightSaving { get; set; } 12 | public string Name { get; set; } 13 | public DateTime? NextOffsetChange { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/Models/Item.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MSC.BlazXam.Xam.Models 4 | { 5 | public class Item 6 | { 7 | public string City { get; set; } 8 | public string CityDetails { get { return $"{City} - Population: {String.Format("{0:n0}", Population)}"; } } 9 | public string Country { get; set; } 10 | public string Id { get; set; } 11 | public int Population { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/layout/Toolbar.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/MSC.BlazXam.Blazor.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/ViewModels/AboutViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | 4 | using Xamarin.Forms; 5 | 6 | namespace MSC.BlazXam.Xam.ViewModels 7 | { 8 | public class AboutViewModel : BaseViewModel 9 | { 10 | public AboutViewModel() 11 | { 12 | Title = "About"; 13 | 14 | OpenWebCommand = new Command(() => Device.OpenUri(new Uri("https://xamarin.com/platform"))); 15 | } 16 | 17 | public ICommand OpenWebCommand { get; } 18 | } 19 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.BizLogic/MSC.BlazXam.BizLogic.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/App.xaml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/Views/AboutPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using Xamarin.Forms; 4 | using Xamarin.Forms.Xaml; 5 | 6 | namespace MSC.BlazXam.Xam.Views 7 | { 8 | // Learn more about making custom code visible in the Xamarin.Forms previewer 9 | // by visiting https://aka.ms/xamarinforms-previewer 10 | [DesignTimeVisible(false)] 11 | public partial class AboutPage : ContentPage 12 | { 13 | public AboutPage() 14 | { 15 | InitializeComponent(); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/AdministrativeArea.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class AdministrativeArea 8 | { 9 | public string CountryID { get; set; } 10 | public string EnglishName { get; set; } 11 | public string EnglishType { get; set; } 12 | public string ID { get; set; } 13 | public int Level { get; set; } 14 | public string LocalizedName { get; set; } 15 | public string LocalizedType { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace MSC.BlazXam.Xam.iOS 9 | { 10 | public class Application 11 | { 12 | // This is the main entry point of the application. 13 | static void Main(string[] args) 14 | { 15 | // if you want to use a different Application Delegate class from "AppDelegate" 16 | // you can specify it here. 17 | UIApplication.Main(args, null, "AppDelegate"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/layout/Tabbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace MSC.BlazXam.Blazor.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | 5 | 6 | 7 | 8 | 9 | 10 | MSC.BlazXam.Blazor 11 | 12 | 13 | 14 | 15 | 16 | 17 | @(await Html.RenderComponentAsync(RenderMode.ServerPrerendered)) 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.BizLogicTest/MSC.BlazXam.BizLogicTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with your package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/AccuWeatherCurrentConditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class AccuWeatherCurrentConditModel 8 | { 9 | public int EpochTime { get; set; } 10 | public bool HasPrecipitation { get; set; } 11 | public bool IsDayTime { get; set; } 12 | public string Link { get; set; } 13 | public DateTime LocalObservationDateTime { get; set; } 14 | public string MobileLink { get; set; } 15 | public object PrecipitationType { get; set; } 16 | public Temperature Temperature { get; set; } 17 | public int WeatherIcon { get; set; } 18 | public string WeatherText { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/error" 2 | 3 | 4 |

Error.

5 |

An error occurred while processing your request.

6 | 7 |

Development Mode

8 |

9 | Swapping to Development environment will display more detailed information about the error that occurred. 10 |

11 |

12 | The Development environment shouldn't be enabled for deployed applications. 13 | It can result in displaying sensitive information from exceptions to end users. 14 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 15 | and restarting the app. 16 |

-------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xamarin.Forms; 3 | using Xamarin.Forms.Xaml; 4 | using MSC.BlazXam.Xam.Services; 5 | using MSC.BlazXam.Xam.Views; 6 | 7 | namespace MSC.BlazXam.Xam 8 | { 9 | public partial class App : Application 10 | { 11 | public App() 12 | { 13 | InitializeComponent(); 14 | 15 | DependencyService.Register(); 16 | MainPage = new AppShell(); 17 | } 18 | 19 | protected override void OnResume() 20 | { 21 | // Handle when your app resumes 22 | } 23 | 24 | protected override void OnSleep() 25 | { 26 | // Handle when your app sleeps 27 | } 28 | 29 | protected override void OnStart() 30 | { 31 | // Handle when your app starts 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Hosting; 10 | using Microsoft.Extensions.Logging; 11 | 12 | namespace MSC.BlazXam.Blazor 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IHostBuilder CreateHostBuilder(string[] args) => 22 | Host.CreateDefaultBuilder(args) 23 | .ConfigureWebHostDefaults(webBuilder => 24 | { 25 | webBuilder.UseStartup(); 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/AccuWeatherTopCitiesModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class AccuWeatherTopCitiesModel 8 | { 9 | public AdministrativeArea AdministrativeArea { get; set; } 10 | public Country Country { get; set; } 11 | public List DataSets { get; set; } 12 | public Details Details { get; set; } 13 | public string EnglishName { get; set; } 14 | public GeoPosition GeoPosition { get; set; } 15 | public bool IsAlias { get; set; } 16 | public string Key { get; set; } 17 | public string LocalizedName { get; set; } 18 | public string PrimaryPostalCode { get; set; } 19 | public int Rank { get; set; } 20 | public Region Region { get; set; } 21 | public List SupplementalAdminAreas { get; set; } 22 | public TimeZone TimeZone { get; set; } 23 | public string Type { get; set; } 24 | public int Version { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 | 7 | 8 |
9 | 22 |
23 | 24 | @code { 25 | bool collapseNavMenu = true; 26 | 27 | string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 28 | 29 | void ToggleNavMenu() 30 | { 31 | collapseNavMenu = !collapseNavMenu; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.BizLogicTest/TestHTTPClientService.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | using System.Threading.Tasks; 3 | 4 | namespace MSC.BlazXam.BizLogicTest 5 | { 6 | [TestClass] 7 | public class TestHTTPClientService 8 | { 9 | [TestCleanup] 10 | public void Cleanup() 11 | { 12 | } 13 | 14 | [TestInitialize] 15 | public void Setup() 16 | { 17 | } 18 | 19 | [TestMethod] 20 | public async Task TestGetAccuWeatherCurrentWeatherData() 21 | { 22 | //locationId = 349727 - should be new york 23 | var reply = await MSC.BlazXam.BizLogic.HTTPClientService.GetAccuWeatherCurrentConditionsDataAsync("349727"); 24 | 25 | Assert.AreEqual(true, !string.IsNullOrEmpty(reply.Link)); 26 | } 27 | 28 | [TestMethod] 29 | public async Task TestGetAccuWeatherTopCitiesData() 30 | { 31 | var reply = await MSC.BlazXam.BizLogic.HTTPClientService.GetAccuWeatherTopCitiesDataAsync(); 32 | 33 | Assert.AreEqual(true, reply.Count == 50); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/Services/APIDataStore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using MSC.BlazXam.BizLogic; 6 | using MSC.BlazXam.Xam.Models; 7 | 8 | namespace MSC.BlazXam.Xam.Services 9 | { 10 | public class APIDataStore : IDataStore 11 | { 12 | Task IDataStore.GetItemAsync(string id) 13 | { 14 | throw new NotImplementedException(); 15 | } 16 | 17 | async Task> IDataStore.GetItemsAsync(bool forceRefresh) 18 | { 19 | var items = new List(); 20 | 21 | var topCities = await HTTPClientService.GetAccuWeatherTopCitiesDataAsync(); 22 | foreach (var city in topCities) 23 | { 24 | items.Add(new Item() 25 | { 26 | Id = city.Key, 27 | City = city.EnglishName, 28 | Country = city.Country.EnglishName, 29 | Population = city.Details.Population 30 | }); 31 | } 32 | 33 | return items; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/Views/ItemDetailPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using Xamarin.Forms; 4 | using Xamarin.Forms.Xaml; 5 | 6 | using MSC.BlazXam.Xam.Models; 7 | using MSC.BlazXam.Xam.ViewModels; 8 | 9 | namespace MSC.BlazXam.Xam.Views 10 | { 11 | // Learn more about making custom code visible in the Xamarin.Forms previewer 12 | // by visiting https://aka.ms/xamarinforms-previewer 13 | [DesignTimeVisible(false)] 14 | public partial class ItemDetailPage : ContentPage 15 | { 16 | private ItemDetailViewModel viewModel = new ItemDetailViewModel(); 17 | 18 | public ItemDetailPage(string id, string city, string country) 19 | { 20 | InitializeComponent(); 21 | viewModel.Init(id, city, country); 22 | BindingContext = viewModel; 23 | } 24 | 25 | public ItemDetailPage() 26 | { 27 | InitializeComponent(); 28 | viewModel.Init("349727", "New York", "United States"); 29 | BindingContext = viewModel; 30 | } 31 | 32 | protected override void OnAppearing() 33 | { 34 | base.OnAppearing(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/Services/MockDataStore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using MSC.BlazXam.Xam.Models; 6 | 7 | namespace MSC.BlazXam.Xam.Services 8 | { 9 | public class MockDataStore : IDataStore 10 | { 11 | private List items; 12 | 13 | public MockDataStore() 14 | { 15 | items = new List(); 16 | var mockItems = new List 17 | { 18 | new Item() { Id = "123456", City = "New York", Country = "United States" }, 19 | new Item() { Id = "789456", City = "Paris", Country = "France" } 20 | }; 21 | 22 | foreach (var item in mockItems) 23 | { 24 | items.Add(item); 25 | } 26 | } 27 | 28 | public async Task GetItemAsync(string id) 29 | { 30 | return await Task.FromResult(items.FirstOrDefault(s => s.Id == id)); 31 | } 32 | 33 | public async Task> GetItemsAsync(bool forceRefresh = false) 34 | { 35 | return await Task.FromResult(items); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | MSBuild:Compile 21 | 22 | 23 | MSBuild:Compile 24 | 25 | 26 | MSBuild:Compile 27 | 28 | 29 | MSBuild:Compile 30 | 31 | 32 | MSBuild:Compile 33 | 34 | 35 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/ViewModels/ItemDetailViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MSC.BlazXam.Models; 3 | using MSC.BlazXam.Xam.Models; 4 | 5 | namespace MSC.BlazXam.Xam.ViewModels 6 | { 7 | public class ItemDetailViewModel : BaseViewModel 8 | { 9 | private string city; 10 | private string country; 11 | private AccuWeatherCurrentConditModel currentWeather; 12 | 13 | public ItemDetailViewModel() 14 | { 15 | } 16 | 17 | public string City 18 | { 19 | get { return city; } 20 | set { SetProperty(ref city, value); } 21 | } 22 | 23 | public string Country 24 | { 25 | get { return country; } 26 | set { SetProperty(ref country, value); } 27 | } 28 | 29 | public AccuWeatherCurrentConditModel CurrentWeather 30 | { 31 | get { return currentWeather; } 32 | set { SetProperty(ref currentWeather, value); } 33 | } 34 | 35 | public async void Init(string id, string city, string country) 36 | { 37 | CurrentWeather = await MSC.BlazXam.BizLogic.HTTPClientService.GetAccuWeatherCurrentConditionsDataAsync(id); 38 | City = city; 39 | Country = country; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace MSC.BlazXam.Xam.iOS 9 | { 10 | // The UIApplicationDelegate for the application. This class is responsible for launching the 11 | // User Interface of the application, as well as listening (and optionally responding) to 12 | // application events from iOS. 13 | [Register("AppDelegate")] 14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 15 | { 16 | // 17 | // This method is invoked when the application has loaded and is ready to run. In this 18 | // method you should instantiate the window, load the UI into it and then make the window 19 | // visible. 20 | // 21 | // You have 17 seconds to return from this method, or iOS will terminate your application. 22 | // 23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 24 | { 25 | global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental"); 26 | global::Xamarin.Forms.Forms.Init(); 27 | LoadApplication(new App()); 28 | 29 | return base.FinishedLaunching(app, options); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Models/Details.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MSC.BlazXam.Models 6 | { 7 | public class Details 8 | { 9 | public string BandMap { get; set; } 10 | public string CanonicalLocationKey { get; set; } 11 | public string CanonicalPostalCode { get; set; } 12 | public string Climo { get; set; } 13 | public DMA DMA { get; set; } 14 | public string Key { get; set; } 15 | public string LocalRadar { get; set; } 16 | public string LocationStem { get; set; } 17 | public string MarineStation { get; set; } 18 | public double? MarineStationGMTOffset { get; set; } 19 | public string MediaRegion { get; set; } 20 | public string Metar { get; set; } 21 | public string NXMetro { get; set; } 22 | public string NXState { get; set; } 23 | public string PartnerID { get; set; } 24 | public int Population { get; set; } 25 | public string PrimaryWarningCountyCode { get; set; } 26 | public string PrimaryWarningZoneCode { get; set; } 27 | public string Satellite { get; set; } 28 | public List Sources { get; set; } 29 | public string StationCode { get; set; } 30 | public double StationGmtOffset { get; set; } 31 | public string Synoptic { get; set; } 32 | public string VideoCode { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/Pages/CurrentWeather.razor: -------------------------------------------------------------------------------- 1 | @page "/currentweather/{id}/{cityname}/{countryname}" 2 | @using MSC.BlazXam.BizLogic 3 | @using MSC.BlazXam.Models 4 | 5 |

Current Weather Conditions

6 | 7 | @if (weather == null) 8 | { 9 |

Loading...

10 | } 11 | else if (weather.WeatherText == null) 12 | { 13 |

Error... we couldn't find the city you are looking for!

14 | } 15 | else 16 | { 17 |

@CityName, @CountryName

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
Current Weather: @weather.WeatherText
Current Temp (Metric): @weather.Temperature.Metric.Value @weather.Temperature.Metric.Unit
Current Temp (Imperial): @weather.Temperature.Imperial.Value @weather.Temperature.Imperial.Unit
31 | } 32 | 33 | @code { 34 | 35 | [Parameter] 36 | public string Id { get; set; } 37 | [Parameter] 38 | public string CityName { get; set; } 39 | [Parameter] 40 | public string CountryName { get; set; } 41 | 42 | AccuWeatherCurrentConditModel weather; 43 | 44 | protected override async Task OnInitializedAsync() 45 | { 46 | weather = (await HTTPClientService.GetAccuWeatherCurrentConditionsDataAsync(Id)); 47 | } 48 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("MSC.BlazXam.Xam.Android")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("MSC.BlazXam.Xam.Android")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | 32 | // Add some common permissions, these can be removed if not needed 33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] 35 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/Pages/Cities.razor: -------------------------------------------------------------------------------- 1 | @page "/cities" 2 | @using MSC.BlazXam.BizLogic 3 | @using MSC.BlazXam.Models 4 | 5 |

Cities

6 | 7 | @if (cities == null) 8 | { 9 |

Loading...

10 | } 11 | else if (!cities.Any()) 12 | { 13 |

14 | Error... try again later! 15 | (Free key is limited to 50 calls per day) 16 |

17 | } 18 | else 19 | { 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | @foreach (var city in cities) 30 | { 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | } 39 | 40 |
CityCountryPopulation
@city.EnglishName@city.Country.EnglishName@String.Format("{0:n0}", city.Details.Population)Current Weather Conditions
41 | } 42 | 43 | @code { 44 | AccuWeatherTopCitiesModel[] cities; 45 | 46 | protected override async Task OnInitializedAsync() 47 | { 48 | cities = (await HTTPClientService.GetAccuWeatherTopCitiesDataAsync()).ToArray(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.Content.PM; 5 | using Android.Runtime; 6 | using Android.Views; 7 | using Android.Widget; 8 | using Android.OS; 9 | 10 | namespace MSC.BlazXam.Xam.Droid 11 | { 12 | [Activity(Label = "MSC.BlazXam.Xam", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 13 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity 14 | { 15 | protected override void OnCreate(Bundle savedInstanceState) 16 | { 17 | TabLayoutResource = Resource.Layout.Tabbar; 18 | ToolbarResource = Resource.Layout.Toolbar; 19 | 20 | base.OnCreate(savedInstanceState); 21 | 22 | global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental"); 23 | Xamarin.Essentials.Platform.Init(this, savedInstanceState); 24 | global::Xamarin.Forms.Forms.Init(this, savedInstanceState); 25 | LoadApplication(new App()); 26 | } 27 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults) 28 | { 29 | Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); 30 | 31 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationPortraitUpsideDown 20 | UIInterfaceOrientationLandscapeLeft 21 | UIInterfaceOrientationLandscapeRight 22 | 23 | MinimumOSVersion 24 | 8.0 25 | CFBundleDisplayName 26 | MSC.BlazXam.Xam 27 | CFBundleIdentifier 28 | com.companyname.MSC.BlazXam.Xam 29 | CFBundleVersion 30 | 1.0 31 | UILaunchStoryboardName 32 | LaunchScreen 33 | CFBundleName 34 | MSC.BlazXam.Xam 35 | XSAppIconAssets 36 | Assets.xcassets/AppIcon.appiconset 37 | 38 | 39 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/Views/ItemsPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Xamarin.Forms; 8 | using Xamarin.Forms.Xaml; 9 | 10 | using MSC.BlazXam.Xam.Models; 11 | using MSC.BlazXam.Xam.Views; 12 | using MSC.BlazXam.Xam.ViewModels; 13 | 14 | namespace MSC.BlazXam.Xam.Views 15 | { 16 | // Learn more about making custom code visible in the Xamarin.Forms previewer 17 | // by visiting https://aka.ms/xamarinforms-previewer 18 | [DesignTimeVisible(false)] 19 | public partial class ItemsPage : ContentPage 20 | { 21 | private ItemsViewModel viewModel; 22 | 23 | public ItemsPage() 24 | { 25 | InitializeComponent(); 26 | 27 | BindingContext = viewModel = new ItemsViewModel(); 28 | } 29 | 30 | protected override void OnAppearing() 31 | { 32 | base.OnAppearing(); 33 | 34 | if (viewModel.Items.Count == 0) 35 | viewModel.LoadItemsCommand.Execute(null); 36 | } 37 | 38 | private async void OnItemSelected(object sender, SelectedItemChangedEventArgs args) 39 | { 40 | var item = args.SelectedItem as Item; 41 | if (item == null) 42 | return; 43 | 44 | await Navigation.PushAsync(new ItemDetailPage(item.Id, item.City, item.Country)); 45 | 46 | // Manually deselect item. 47 | ItemsListView.SelectedItem = null; 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MSC.BlazXam.Xam.iOS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MSC.BlazXam.Xam.iOS")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/ViewModels/BaseViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Runtime.CompilerServices; 5 | 6 | using Xamarin.Forms; 7 | 8 | using MSC.BlazXam.Xam.Models; 9 | using MSC.BlazXam.Xam.Services; 10 | 11 | namespace MSC.BlazXam.Xam.ViewModels 12 | { 13 | public class BaseViewModel : INotifyPropertyChanged 14 | { 15 | public IDataStore DataStore => DependencyService.Get>() ?? new MockDataStore(); 16 | 17 | bool isBusy = false; 18 | public bool IsBusy 19 | { 20 | get { return isBusy; } 21 | set { SetProperty(ref isBusy, value); } 22 | } 23 | 24 | string title = string.Empty; 25 | public string Title 26 | { 27 | get { return title; } 28 | set { SetProperty(ref title, value); } 29 | } 30 | 31 | protected bool SetProperty(ref T backingStore, T value, 32 | [CallerMemberName]string propertyName = "", 33 | Action onChanged = null) 34 | { 35 | if (EqualityComparer.Default.Equals(backingStore, value)) 36 | return false; 37 | 38 | backingStore = value; 39 | onChanged?.Invoke(); 40 | OnPropertyChanged(propertyName); 41 | return true; 42 | } 43 | 44 | #region INotifyPropertyChanged 45 | public event PropertyChangedEventHandler PropertyChanged; 46 | protected void OnPropertyChanged([CallerMemberName] string propertyName = "") 47 | { 48 | var changed = PropertyChanged; 49 | if (changed == null) 50 | return; 51 | 52 | changed.Invoke(this, new PropertyChangedEventArgs(propertyName)); 53 | } 54 | #endregion 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/Views/ItemDetailPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 16 | 29 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.Android/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.xml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. 51 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Blazor/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Components; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.AspNetCore.HttpsPolicy; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using Microsoft.Extensions.Hosting; 12 | 13 | namespace MSC.BlazXam.Blazor 14 | { 15 | public class Startup 16 | { 17 | public Startup(IConfiguration configuration) 18 | { 19 | Configuration = configuration; 20 | } 21 | 22 | public IConfiguration Configuration { get; } 23 | 24 | // This method gets called by the runtime. Use this method to add services to the container. 25 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | services.AddRazorPages(); 29 | services.AddServerSideBlazor(); 30 | } 31 | 32 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 33 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 34 | { 35 | if (env.IsDevelopment()) 36 | { 37 | app.UseDeveloperExceptionPage(); 38 | } 39 | else 40 | { 41 | app.UseExceptionHandler("/Error"); 42 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 43 | app.UseHsts(); 44 | } 45 | 46 | app.UseHttpsRedirection(); 47 | app.UseStaticFiles(); 48 | 49 | app.UseRouting(); 50 | 51 | app.UseEndpoints(endpoints => 52 | { 53 | endpoints.MapBlazorHub(); 54 | endpoints.MapFallbackToPage("/_Host"); 55 | }); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/ViewModelsDesign/ItemsViewModelDesign.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using MSC.BlazXam.Xam.Models; 3 | 4 | namespace MSC.BlazXam.Xam.ViewModelsDesign 5 | { 6 | public static class ViewModelLocator 7 | { 8 | private static ItemsViewModel_2 _itemsViewModel_2; 9 | private static ItemsViewModel_Empty _itemsViewModel_Empty; 10 | 11 | public static ItemsViewModel_2 ItemsViewModel_2 => 12 | _itemsViewModel_2 ?? (_itemsViewModel_2 = new ItemsViewModel_2()); 13 | 14 | public static ItemsViewModel_Empty ItemsViewModel_Empty => 15 | _itemsViewModel_Empty ?? (_itemsViewModel_Empty = new ItemsViewModel_Empty()); 16 | } 17 | 18 | public class ItemsViewModel_2 19 | { 20 | public bool IsShowEmptyItemsListMessage 21 | { 22 | get { return false; } 23 | } 24 | 25 | public ObservableCollection Items 26 | { 27 | get 28 | { 29 | return new ObservableCollection() 30 | { 31 | new Item() { Id = "123456", City = "New York", Country = "United States" , Population = 123456789 }, 32 | new Item() { Id = "789456", City = "Paris", Country = "France" , Population = 987654321 } 33 | }; 34 | } 35 | } 36 | 37 | public string ItemsPageMessage 38 | { 39 | get 40 | { 41 | return string.Empty; 42 | } 43 | } 44 | } 45 | 46 | public class ItemsViewModel_Empty 47 | { 48 | public bool IsShowEmptyItemsListMessage 49 | { 50 | get { return true; } 51 | } 52 | 53 | public ObservableCollection Items 54 | { 55 | get 56 | { 57 | return new ObservableCollection(); 58 | } 59 | } 60 | 61 | public string ItemsPageMessage 62 | { 63 | get 64 | { 65 | return "Sample ItemsPageMessage"; 66 | } 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/Views/ItemsPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 45 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/ViewModels/ItemsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.ObjectModel; 3 | using System.Diagnostics; 4 | using System.Threading.Tasks; 5 | 6 | using Xamarin.Forms; 7 | 8 | using MSC.BlazXam.Xam.Models; 9 | using MSC.BlazXam.Xam.Views; 10 | 11 | namespace MSC.BlazXam.Xam.ViewModels 12 | { 13 | public class ItemsViewModel : BaseViewModel 14 | { 15 | private bool _isShowEmptyItemsListMessage; 16 | private ObservableCollection _items; 17 | private string _itemsPageMessage; 18 | 19 | public ItemsViewModel() 20 | { 21 | Title = "Browse"; 22 | Items = new ObservableCollection(); 23 | LoadItemsCommand = new Command(async () => await ExecuteLoadItemsCommand()); 24 | } 25 | 26 | public bool IsShowEmptyItemsListMessage 27 | { 28 | get { return _isShowEmptyItemsListMessage; } 29 | set { SetProperty(ref _isShowEmptyItemsListMessage, value); } 30 | } 31 | 32 | public ObservableCollection Items 33 | { 34 | get { return _items; } 35 | set { SetProperty(ref _items, value); } 36 | } 37 | 38 | public string ItemsPageMessage 39 | { 40 | get { return _itemsPageMessage; } 41 | set { SetProperty(ref _itemsPageMessage, value); } 42 | } 43 | 44 | public Command LoadItemsCommand { get; set; } 45 | 46 | private async Task ExecuteLoadItemsCommand() 47 | { 48 | if (IsBusy) 49 | return; 50 | 51 | IsBusy = true; 52 | 53 | try 54 | { 55 | Items.Clear(); 56 | var items = await DataStore.GetItemsAsync(true); 57 | foreach (var item in items) 58 | { 59 | Items.Add(item); 60 | } 61 | 62 | if (Items.Count == 0) 63 | { 64 | IsShowEmptyItemsListMessage = true; 65 | ItemsPageMessage = "No Cities Returned! API only allows 50 calls per day!"; 66 | } 67 | else 68 | { 69 | IsShowEmptyItemsListMessage = false; 70 | ItemsPageMessage = string.Empty; 71 | } 72 | } 73 | catch (Exception ex) 74 | { 75 | Debug.WriteLine(ex); 76 | } 77 | finally 78 | { 79 | IsBusy = false; 80 | } 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Resources/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "scale": "2x", 5 | "size": "20x20", 6 | "idiom": "iphone", 7 | "filename": "Icon40.png" 8 | }, 9 | { 10 | "scale": "3x", 11 | "size": "20x20", 12 | "idiom": "iphone", 13 | "filename": "Icon60.png" 14 | }, 15 | { 16 | "scale": "2x", 17 | "size": "29x29", 18 | "idiom": "iphone", 19 | "filename": "Icon58.png" 20 | }, 21 | { 22 | "scale": "3x", 23 | "size": "29x29", 24 | "idiom": "iphone", 25 | "filename": "Icon87.png" 26 | }, 27 | { 28 | "scale": "2x", 29 | "size": "40x40", 30 | "idiom": "iphone", 31 | "filename": "Icon80.png" 32 | }, 33 | { 34 | "scale": "3x", 35 | "size": "40x40", 36 | "idiom": "iphone", 37 | "filename": "Icon120.png" 38 | }, 39 | { 40 | "scale": "2x", 41 | "size": "60x60", 42 | "idiom": "iphone", 43 | "filename": "Icon120.png" 44 | }, 45 | { 46 | "scale": "3x", 47 | "size": "60x60", 48 | "idiom": "iphone", 49 | "filename": "Icon180.png" 50 | }, 51 | { 52 | "scale": "1x", 53 | "size": "20x20", 54 | "idiom": "ipad", 55 | "filename": "Icon20.png" 56 | }, 57 | { 58 | "scale": "2x", 59 | "size": "20x20", 60 | "idiom": "ipad", 61 | "filename": "Icon40.png" 62 | }, 63 | { 64 | "scale": "1x", 65 | "size": "29x29", 66 | "idiom": "ipad", 67 | "filename": "Icon29.png" 68 | }, 69 | { 70 | "scale": "2x", 71 | "size": "29x29", 72 | "idiom": "ipad", 73 | "filename": "Icon58.png" 74 | }, 75 | { 76 | "scale": "1x", 77 | "size": "40x40", 78 | "idiom": "ipad", 79 | "filename": "Icon40.png" 80 | }, 81 | { 82 | "scale": "2x", 83 | "size": "40x40", 84 | "idiom": "ipad", 85 | "filename": "Icon80.png" 86 | }, 87 | { 88 | "scale": "1x", 89 | "size": "76x76", 90 | "idiom": "ipad", 91 | "filename": "Icon76.png" 92 | }, 93 | { 94 | "scale": "2x", 95 | "size": "76x76", 96 | "idiom": "ipad", 97 | "filename": "Icon152.png" 98 | }, 99 | { 100 | "scale": "2x", 101 | "size": "83.5x83.5", 102 | "idiom": "ipad", 103 | "filename": "Icon167.png" 104 | }, 105 | { 106 | "scale": "1x", 107 | "size": "1024x1024", 108 | "idiom": "ios-marketing", 109 | "filename": "Icon1024.png" 110 | } 111 | ], 112 | "properties": {}, 113 | "info": { 114 | "version": 1, 115 | "author": "xcode" 116 | } 117 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.BizLogic/HTTPClientService.cs: -------------------------------------------------------------------------------- 1 | using MSC.BlazXam.Models; 2 | using Newtonsoft.Json; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Diagnostics; 6 | using System.Net.Http; 7 | using System.Threading.Tasks; 8 | 9 | namespace MSC.BlazXam.BizLogic 10 | { 11 | public static class HTTPClientService 12 | { 13 | public static async Task GetAccuWeatherCurrentConditionsDataAsync(string locationId) 14 | { 15 | var locData = new AccuWeatherCurrentConditModel(); 16 | 17 | try 18 | { 19 | HttpClient client = new HttpClient(); 20 | client.MaxResponseContentBufferSize = 256000; 21 | var urlStr = $"https://dataservice.accuweather.com/currentconditions/v1/{locationId}?apikey={Config.AccuWeatherKey}&language=en-us&details=false "; 22 | var uri = new Uri(urlStr); 23 | var response = await client.GetAsync(uri); 24 | if (response.IsSuccessStatusCode) 25 | { 26 | var content = await response.Content.ReadAsStringAsync(); 27 | var list = JsonConvert.DeserializeObject>(content); 28 | if (list.Count == 1) { locData = list[0]; } 29 | } 30 | } 31 | catch (Exception ex) 32 | { 33 | Debug.WriteLine($"ERROR { ex.Message}"); 34 | //TODO: log error here with your favorite logging tool 35 | } 36 | 37 | return locData; 38 | } 39 | 40 | public static async Task> GetAccuWeatherTopCitiesDataAsync() 41 | { 42 | var locData = new List(); 43 | 44 | try 45 | { 46 | HttpClient client = new HttpClient(); 47 | client.MaxResponseContentBufferSize = 256000; 48 | var urlStr = $"https://dataservice.accuweather.com/locations/v1/topcities/50?apikey={Config.AccuWeatherKey}&language=en-us&details=true"; 49 | var uri = new Uri(urlStr); 50 | var response = await client.GetAsync(uri); 51 | if (response.IsSuccessStatusCode) 52 | { 53 | var content = await response.Content.ReadAsStringAsync(); 54 | locData = JsonConvert.DeserializeObject>(content); 55 | } 56 | } 57 | catch (Exception ex) 58 | { 59 | Debug.WriteLine($"ERROR { ex.Message}"); 60 | //TODO: log error here with your favorite logging tool 61 | } 62 | 63 | Debug.WriteLine($"SUCCESS Retrieved {locData.Count} Records"); 64 | 65 | return locData; 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /BlazXam/MSC.BlazXam.Xam/MSC.BlazXam.Xam/AppShell.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 15 | 16 | #2196F3 17 | 28 |