@ -0,0 +1,19 @@ |
|||||||
|
Any raw assets you want to be deployed with your application can be placed in |
||||||
|
this directory (and child directories) and given a Build Action of "AndroidAsset". |
||||||
|
|
||||||
|
These files will be deployed with your package and will be accessible using Android's |
||||||
|
AssetManager, like this: |
||||||
|
|
||||||
|
public class ReadAsset : Activity |
||||||
|
{ |
||||||
|
protected override void OnCreate (Bundle bundle) |
||||||
|
{ |
||||||
|
base.OnCreate (bundle); |
||||||
|
|
||||||
|
InputStream input = Assets.Open ("my_asset.txt"); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
Additionally, some Android functions will automatically load asset files: |
||||||
|
|
||||||
|
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); |
@ -0,0 +1,6 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.xamarinstudy"> |
||||||
|
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" /> |
||||||
|
<application android:label="XamarinStudy.Android" android:theme="@style/MainTheme"></application> |
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
||||||
|
</manifest> |
@ -0,0 +1,50 @@ |
|||||||
|
Images, layout descriptions, binary blobs and string dictionaries can be included |
||||||
|
in your application as resource files. Various Android APIs are designed to |
||||||
|
operate on the resource IDs instead of dealing with images, strings or binary blobs |
||||||
|
directly. |
||||||
|
|
||||||
|
For example, a sample Android app that contains a user interface layout (main.xml), |
||||||
|
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) |
||||||
|
would keep its resources in the "Resources" directory of the application: |
||||||
|
|
||||||
|
Resources/ |
||||||
|
drawable-hdpi/ |
||||||
|
icon.png |
||||||
|
|
||||||
|
drawable-ldpi/ |
||||||
|
icon.png |
||||||
|
|
||||||
|
drawable-mdpi/ |
||||||
|
icon.png |
||||||
|
|
||||||
|
layout/ |
||||||
|
main.xml |
||||||
|
|
||||||
|
values/ |
||||||
|
strings.xml |
||||||
|
|
||||||
|
In order to get the build system to recognize Android resources, set the build action to |
||||||
|
"AndroidResource". The native Android APIs do not operate directly with filenames, but |
||||||
|
instead operate on resource IDs. When you compile an Android application that uses resources, |
||||||
|
the build system will package the resources for distribution and generate a class called |
||||||
|
"Resource" that contains the tokens for each one of the resources included. For example, |
||||||
|
for the above Resources layout, this is what the Resource class would expose: |
||||||
|
|
||||||
|
public class Resource { |
||||||
|
public class drawable { |
||||||
|
public const int icon = 0x123; |
||||||
|
} |
||||||
|
|
||||||
|
public class layout { |
||||||
|
public const int main = 0x456; |
||||||
|
} |
||||||
|
|
||||||
|
public class strings { |
||||||
|
public const int first_string = 0xabc; |
||||||
|
public const int second_string = 0xbcd; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main |
||||||
|
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first |
||||||
|
string in the dictionary file values/strings.xml. |
After Width: | Height: | Size: 518 B |
After Width: | Height: | Size: 415 B |
After Width: | Height: | Size: 21 KiB |
@ -0,0 +1,5 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> |
||||||
|
<background android:drawable="@color/launcher_background" /> |
||||||
|
<foreground android:drawable="@mipmap/launcher_foreground" /> |
||||||
|
</adaptive-icon> |
@ -0,0 +1,5 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> |
||||||
|
<background android:drawable="@color/launcher_background" /> |
||||||
|
<foreground android:drawable="@mipmap/launcher_foreground" /> |
||||||
|
</adaptive-icon> |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 51 KiB |
@ -0,0 +1,7 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<resources> |
||||||
|
<color name="launcher_background">#FFFFFF</color> |
||||||
|
<color name="colorPrimary">#3F51B5</color> |
||||||
|
<color name="colorPrimaryDark">#303F9F</color> |
||||||
|
<color name="colorAccent">#FF4081</color> |
||||||
|
</resources> |
@ -0,0 +1,18 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8" ?> |
||||||
|
<resources> |
||||||
|
|
||||||
|
<style name="MainTheme" parent="MainTheme.Base"> |
||||||
|
<!-- As of Xamarin.Forms 4.6 the theme has moved into the Forms binary --> |
||||||
|
<!-- If you want to override anything you can do that here. --> |
||||||
|
<!-- Underneath are a couple of entries to get you started. --> |
||||||
|
|
||||||
|
<!-- Set theme colors from https://aka.ms/material-colors --> |
||||||
|
<!-- colorPrimary is used for the default action bar background --> |
||||||
|
<!--<item name="colorPrimary">#2196F3</item>--> |
||||||
|
<!-- colorPrimaryDark is used for the status bar --> |
||||||
|
<!--<item name="colorPrimaryDark">#1976D2</item>--> |
||||||
|
<!-- colorAccent is used as the default value for colorControlActivated |
||||||
|
which is used to tint widgets --> |
||||||
|
<!--<item name="colorAccent">#FF4081</item>--> |
||||||
|
</style> |
||||||
|
</resources> |
@ -0,0 +1,96 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||||
|
<PropertyGroup> |
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||||
|
<ProjectGuid>{085DC5E8-F22B-4E22-9762-AF0AF8973776}</ProjectGuid> |
||||||
|
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
||||||
|
<TemplateGuid>{6968b3a4-1835-46a3-ac5c-1ae33b475983}</TemplateGuid> |
||||||
|
<OutputType>Library</OutputType> |
||||||
|
<RootNamespace>XamarinStudy.Droid</RootNamespace> |
||||||
|
<AssemblyName>XamarinStudy.Android</AssemblyName> |
||||||
|
<Deterministic>True</Deterministic> |
||||||
|
<AndroidApplication>True</AndroidApplication> |
||||||
|
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile> |
||||||
|
<AndroidResgenClass>Resource</AndroidResgenClass> |
||||||
|
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest> |
||||||
|
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix> |
||||||
|
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix> |
||||||
|
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk> |
||||||
|
<TargetFrameworkVersion>v12.0</TargetFrameworkVersion> |
||||||
|
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent> |
||||||
|
<AndroidUseAapt2>true</AndroidUseAapt2> |
||||||
|
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType> |
||||||
|
<NuGetPackageImportStamp> |
||||||
|
</NuGetPackageImportStamp> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
||||||
|
<DebugSymbols>true</DebugSymbols> |
||||||
|
<DebugType>portable</DebugType> |
||||||
|
<Optimize>false</Optimize> |
||||||
|
<OutputPath>bin\Debug</OutputPath> |
||||||
|
<DefineConstants>DEBUG;</DefineConstants> |
||||||
|
<ErrorReport>prompt</ErrorReport> |
||||||
|
<WarningLevel>4</WarningLevel> |
||||||
|
<AndroidLinkMode>None</AndroidLinkMode> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
||||||
|
<DebugSymbols>true</DebugSymbols> |
||||||
|
<DebugType>portable</DebugType> |
||||||
|
<Optimize>true</Optimize> |
||||||
|
<OutputPath>bin\Release</OutputPath> |
||||||
|
<ErrorReport>prompt</ErrorReport> |
||||||
|
<WarningLevel>4</WarningLevel> |
||||||
|
<AndroidManagedSymbols>true</AndroidManagedSymbols> |
||||||
|
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime> |
||||||
|
</PropertyGroup> |
||||||
|
<ItemGroup> |
||||||
|
<Reference Include="Mono.Android" /> |
||||||
|
<Reference Include="System" /> |
||||||
|
<Reference Include="System.Core" /> |
||||||
|
<Reference Include="System.Numerics" /> |
||||||
|
<Reference Include="System.Numerics.Vectors" /> |
||||||
|
<Reference Include="System.Xml.Linq" /> |
||||||
|
<Reference Include="System.Xml" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" /> |
||||||
|
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<Compile Include="MainActivity.cs" /> |
||||||
|
<Compile Include="Resources\Resource.designer.cs" /> |
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<None Include="Resources\AboutResources.txt" /> |
||||||
|
<None Include="Assets\AboutAssets.txt" /> |
||||||
|
<None Include="Properties\AndroidManifest.xml" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<AndroidResource Include="Resources\values\styles.xml" /> |
||||||
|
<AndroidResource Include="Resources\values\colors.xml" /> |
||||||
|
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" /> |
||||||
|
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" /> |
||||||
|
<AndroidResource Include="Resources\mipmap-hdpi\icon.png" /> |
||||||
|
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" /> |
||||||
|
<AndroidResource Include="Resources\mipmap-mdpi\icon.png" /> |
||||||
|
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" /> |
||||||
|
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png" /> |
||||||
|
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" /> |
||||||
|
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png" /> |
||||||
|
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" /> |
||||||
|
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" /> |
||||||
|
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" /> |
||||||
|
<AndroidResource Include="Resources\drawable\xamarin_logo.png" /> |
||||||
|
<AndroidResource Include="Resources\drawable\icon_about.png" /> |
||||||
|
<AndroidResource Include="Resources\drawable\icon_feed.png" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<ProjectReference Include="..\XamarinStudy\XamarinStudy.csproj"> |
||||||
|
<Project>{FEEC7961-A6A9-47D9-A82D-6B1F0ABFB3D9}</Project> |
||||||
|
<Name>XamarinStudy</Name> |
||||||
|
</ProjectReference> |
||||||
|
</ItemGroup> |
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> |
||||||
|
</Project> |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 394 B |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 394 B |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 392 B |
After Width: | Height: | Size: 836 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,31 @@ |
|||||||
|
<!-- |
||||||
|
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most |
||||||
|
developers. However, you can modify these parameters to modify the behavior of the .NET Native |
||||||
|
optimizer. |
||||||
|
|
||||||
|
Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919 |
||||||
|
|
||||||
|
To fully enable reflection for App1.MyClass and all of its public/private members |
||||||
|
<Type Name="App1.MyClass" Dynamic="Required All"/> |
||||||
|
|
||||||
|
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32 |
||||||
|
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" /> |
||||||
|
|
||||||
|
Using the Namespace directive to apply reflection policy to all the types in a particular namespace |
||||||
|
<Namespace Name="DataClasses.ViewModels" Seralize="All" /> |
||||||
|
--> |
||||||
|
|
||||||
|
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> |
||||||
|
<Application> |
||||||
|
<!-- |
||||||
|
An Assembly element with Name="*Application*" applies to all assemblies in |
||||||
|
the application package. The asterisks are not wildcards. |
||||||
|
--> |
||||||
|
<Assembly Name="*Application*" Dynamic="Required All" /> |
||||||
|
|
||||||
|
|
||||||
|
<!-- Add your application specific runtime directives here. --> |
||||||
|
|
||||||
|
|
||||||
|
</Application> |
||||||
|
</Directives> |
After Width: | Height: | Size: 518 B |
After Width: | Height: | Size: 415 B |
After Width: | Height: | Size: 21 KiB |
@ -0,0 +1,136 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<Shell xmlns="http://xamarin.com/schemas/2014/forms" |
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
||||||
|
xmlns:local="clr-namespace:XamarinStudy.Views" |
||||||
|
Title="XamarinStudy" |
||||||
|
x:Class="XamarinStudy.AppShell"> |
||||||
|
|
||||||
|
<!-- |
||||||
|
The overall app visual hierarchy is defined here, along with navigation. |
||||||
|
|
||||||
|
https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/ |
||||||
|
--> |
||||||
|
|
||||||
|
<Shell.Resources> |
||||||
|
<ResourceDictionary> |
||||||
|
<Style x:Key="BaseStyle" TargetType="Element"> |
||||||
|
<Setter Property="Shell.BackgroundColor" Value="{StaticResource Primary}" /> |
||||||
|
<Setter Property="Shell.ForegroundColor" Value="White" /> |
||||||
|
<Setter Property="Shell.TitleColor" Value="White" /> |
||||||
|
<Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" /> |
||||||
|
<Setter Property="Shell.UnselectedColor" Value="#95FFFFFF" /> |
||||||
|
<Setter Property="Shell.TabBarBackgroundColor" Value="{StaticResource Primary}" /> |
||||||
|
<Setter Property="Shell.TabBarForegroundColor" Value="White"/> |
||||||
|
<Setter Property="Shell.TabBarUnselectedColor" Value="#95FFFFFF"/> |
||||||
|
<Setter Property="Shell.TabBarTitleColor" Value="White"/> |
||||||
|
</Style> |
||||||
|
<Style TargetType="TabBar" BasedOn="{StaticResource BaseStyle}" /> |
||||||
|
<Style TargetType="FlyoutItem" BasedOn="{StaticResource BaseStyle}" /> |
||||||
|
|
||||||
|
<!-- |
||||||
|
Default Styles for all Flyout Items |
||||||
|
https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/flyout#flyoutitem-and-menuitem-style-classes |
||||||
|
--> |
||||||
|
<Style Class="FlyoutItemLabelStyle" TargetType="Label"> |
||||||
|
<Setter Property="TextColor" Value="White"></Setter> |
||||||
|
</Style> |
||||||
|
<Style Class="FlyoutItemLayoutStyle" TargetType="Layout" ApplyToDerivedTypes="True"> |
||||||
|
<Setter Property="VisualStateManager.VisualStateGroups"> |
||||||
|
<VisualStateGroupList> |
||||||
|
<VisualStateGroup x:Name="CommonStates"> |
||||||
|
<VisualState x:Name="Normal"> |
||||||
|
<VisualState.Setters> |
||||||
|
<Setter Property="BackgroundColor" Value="{x:OnPlatform UWP=Transparent, iOS=White}" /> |
||||||
|
<Setter TargetName="FlyoutItemLabel" Property="Label.TextColor" Value="{StaticResource Primary}" /> |
||||||
|
</VisualState.Setters> |
||||||
|
</VisualState> |
||||||
|
<VisualState x:Name="Selected"> |
||||||
|
<VisualState.Setters> |
||||||
|
<Setter Property="BackgroundColor" Value="{StaticResource Primary}" /> |
||||||
|
</VisualState.Setters> |
||||||
|
</VisualState> |
||||||
|
</VisualStateGroup> |
||||||
|
</VisualStateGroupList> |
||||||
|
</Setter> |
||||||
|
</Style> |
||||||
|
|
||||||
|
<!-- |
||||||
|
Custom Style you can apply to any Flyout Item |
||||||
|
--> |
||||||
|
<Style Class="MenuItemLayoutStyle" TargetType="Layout" ApplyToDerivedTypes="True"> |
||||||
|
<Setter Property="VisualStateManager.VisualStateGroups"> |
||||||
|
<VisualStateGroupList> |
||||||
|
<VisualStateGroup x:Name="CommonStates"> |
||||||
|
<VisualState x:Name="Normal"> |
||||||
|
<VisualState.Setters> |
||||||
|
<Setter TargetName="FlyoutItemLabel" Property="Label.TextColor" Value="{StaticResource Primary}" /> |
||||||
|
</VisualState.Setters> |
||||||
|
</VisualState> |
||||||
|
</VisualStateGroup> |
||||||
|
</VisualStateGroupList> |
||||||
|
</Setter> |
||||||
|
</Style> |
||||||
|
</ResourceDictionary> |
||||||
|
</Shell.Resources> |
||||||
|
|
||||||
|
<!-- |
||||||
|
When the Flyout is visible this defines the content to display in the flyout. |
||||||
|
FlyoutDisplayOptions="AsMultipleItems" will create a separate flyout item for each child element |
||||||
|
https://docs.microsoft.com/dotnet/api/xamarin.forms.shellgroupitem.flyoutdisplayoptions?view=xamarin-forms |
||||||
|
--> |
||||||
|
<FlyoutItem Title="About" Icon="icon_about.png"> |
||||||
|
<ShellContent Route="AboutPage" ContentTemplate="{DataTemplate local:AboutPage}" /> |
||||||
|
</FlyoutItem> |
||||||
|
<FlyoutItem Title="Browse" Icon="icon_feed.png"> |
||||||
|
<ShellContent Route="ItemsPage" ContentTemplate="{DataTemplate local:ItemsPage}" /> |
||||||
|
</FlyoutItem> |
||||||
|
|
||||||
|
<!-- When the Flyout is visible this will be a menu item you can tie a click behavior to --> |
||||||
|
<MenuItem Text="Logout" StyleClass="MenuItemLayoutStyle" Clicked="OnMenuItemClicked"> |
||||||
|
</MenuItem> |
||||||
|
|
||||||
|
<!-- |
||||||
|
TabBar lets you define content that won't show up in a flyout menu. When this content is active |
||||||
|
the flyout menu won't be available. This is useful for creating areas of the application where |
||||||
|
you don't want users to be able to navigate away from. If you would like to navigate to this |
||||||
|
content you can do so by calling |
||||||
|
await Shell.Current.GoToAsync("//LoginPage"); |
||||||
|
--> |
||||||
|
<TabBar> |
||||||
|
<ShellContent Route="LoginPage" ContentTemplate="{DataTemplate local:LoginPage}" /> |
||||||
|
</TabBar> |
||||||
|
|
||||||
|
<!-- Optional Templates |
||||||
|
// These may be provided inline as below or as separate classes. |
||||||
|
|
||||||
|
// This header appears at the top of the Flyout. |
||||||
|
// https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/flyout#flyout-header |
||||||
|
<Shell.FlyoutHeaderTemplate> |
||||||
|
<DataTemplate> |
||||||
|
<Grid>ContentHere</Grid> |
||||||
|
</DataTemplate> |
||||||
|
</Shell.FlyoutHeaderTemplate> |
||||||
|
|
||||||
|
// ItemTemplate is for ShellItems as displayed in a Flyout |
||||||
|
// https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/flyout#define-flyoutitem-appearance |
||||||
|
<Shell.ItemTemplate> |
||||||
|
<DataTemplate> |
||||||
|
<ContentView> |
||||||
|
Bindable Properties: Title, Icon |
||||||
|
</ContentView> |
||||||
|
</DataTemplate> |
||||||
|
</Shell.ItemTemplate> |
||||||
|
|
||||||
|
// MenuItemTemplate is for MenuItems as displayed in a Flyout |
||||||
|
// https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/flyout#define-menuitem-appearance |
||||||
|
<Shell.MenuItemTemplate> |
||||||
|
<DataTemplate> |
||||||
|
<ContentView> |
||||||
|
Bindable Properties: Text, Icon |
||||||
|
</ContentView> |
||||||
|
</DataTemplate> |
||||||
|
</Shell.MenuItemTemplate> |
||||||
|
|
||||||
|
--> |
||||||
|
|
||||||
|
</Shell> |
@ -0,0 +1,3 @@ |
|||||||
|
using Xamarin.Forms.Xaml; |
||||||
|
|
||||||
|
[assembly: XamlCompilation(XamlCompilationOptions.Compile)] |
@ -0,0 +1,34 @@ |
|||||||
|
Welcome to Xamarin.Forms! Here are some tips to get started building your app. |
||||||
|
|
||||||
|
Building Your App UI |
||||||
|
-------------------- |
||||||
|
|
||||||
|
XAML Hot Reload quickly applies UI changes as you make them to your running app. |
||||||
|
This is the most productive way to preview and iteratively create your UI. |
||||||
|
|
||||||
|
Try it out: |
||||||
|
|
||||||
|
1. Run the app by clicking the Start Debugging (play) button in the above toolbar. |
||||||
|
2. Open <MainProject>\Views\AboutPage.xaml. |
||||||
|
Don't stop the app - keep it running while making changes. |
||||||
|
3. Change something! Hint: change the Accent color on line 14 from "#96d1ff" to "Pink". |
||||||
|
4. Watch the About screen update on the device or emulator, with the logo background now pink. |
||||||
|
|
||||||
|
Keep going and try more changes! |
||||||
|
|
||||||
|
QuickStart Guide |
||||||
|
---------------- |
||||||
|
|
||||||
|
Learn more of the fundamentals for building apps with Xamarin here: https://aka.ms/xamarin-quickstart |
||||||
|
|
||||||
|
Your App Shell |
||||||
|
-------------- |
||||||
|
|
||||||
|
This template uses Shell, an app container that reduces the complexity of your apps by providing fundamental features including: |
||||||
|
|
||||||
|
- A single place to describe the app's visual hierarchy. |
||||||
|
- Common navigation such as a flyout menu and tabs. |
||||||
|
- A URI-based navigation scheme that permits navigation to any page in the application. |
||||||
|
- An integrated search handler. |
||||||
|
|
||||||
|
Open AppShell.xaml to begin exploring. To learn more about Shell visit: https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/introduction |
@ -0,0 +1,12 @@ |
|||||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||||
|
|
||||||
|
<PropertyGroup> |
||||||
|
<TargetFramework>netstandard2.0</TargetFramework> |
||||||
|
<ProduceReferenceAssembly>true</ProduceReferenceAssembly> |
||||||
|
</PropertyGroup> |
||||||
|
|
||||||
|
<ItemGroup> |
||||||
|
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" /> |
||||||
|
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" /> |
||||||
|
</ItemGroup> |
||||||
|
</Project> |